Documentation
¶
Index ¶
- Variables
- func AesEcbDecrypt(secret []byte, s string) (string, error)
- func AesEcbEncrypt(secret []byte, plain string) (string, error)
- func LoadPrivKey(content string) (*rsa.PrivateKey, error)
- func LoadPubKey(content string) (*rsa.PublicKey, error)
- func NewECBDecrypter(b cipher.Block) cipher.BlockMode
- func NewECBEncrypter(b cipher.Block) cipher.BlockMode
- func PKCSPadding(ciphertext []byte, blockSize int) []byte
- func PKCSTrimming(encrypt []byte) []byte
- type ECBDecrypter
- type ECBEncrypter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PUB_PEM_BEGIN = "-----BEGIN PUBLIC KEY-----" PUB_PEM_END = "-----END PUBLIC KEY-----" PRIV_PEM_BEGIN = "-----BEGIN PRIVATE KEY-----" PRIV_PEM_END = "-----END PRIVATE KEY-----" ErrDecodePemFailed = errors.New("failed to decode public key pem") ErrInvalidKey = errors.New("invalid key") )
Functions ¶
func AesEcbDecrypt ¶ added in v0.1.1
AES/ECB/PKCSPadding decode hex string and decrypt.
func AesEcbEncrypt ¶ added in v0.1.1
AES/ECB/PKCSPadding encrypt and encoded as hex string.
func LoadPrivKey ¶
func LoadPrivKey(content string) (*rsa.PrivateKey, error)
func NewECBDecrypter ¶ added in v0.1.1
ECB block mode for decryption.
func NewECBEncrypter ¶ added in v0.1.1
ECB block mode for encryption.
func PKCSPadding ¶ added in v0.1.1
PKCS5/7 Padding
Types ¶
type ECBDecrypter ¶ added in v0.1.1
type ECBDecrypter ecb
func (*ECBDecrypter) BlockSize ¶ added in v0.1.1
func (ec *ECBDecrypter) BlockSize() int
func (*ECBDecrypter) CryptBlocks ¶ added in v0.1.1
func (ec *ECBDecrypter) CryptBlocks(dst, src []byte)
type ECBEncrypter ¶ added in v0.1.1
type ECBEncrypter ecb
func (*ECBEncrypter) BlockSize ¶ added in v0.1.1
func (ec *ECBEncrypter) BlockSize() int
func (*ECBEncrypter) CryptBlocks ¶ added in v0.1.1
func (ec *ECBEncrypter) CryptBlocks(dst, src []byte)
Click to show internal directories.
Click to hide internal directories.