Documentation ¶
Index ¶
- Variables
- func AESECBPKCSDecrypt(key, crypted []byte) ([]byte, error)
- func AESECBPKCSEncrypt(key, source []byte) ([]byte, error)
- func NewECBDecrypter(key []byte) (cipher.BlockMode, error)
- func NewECBEncrypter(key []byte) (cipher.BlockMode, error)
- func PKCS5Padding(buf []byte) ([]byte, error)
- func PKCS5UnPadding(buf []byte) ([]byte, error)
- func PKCSPadding(buf []byte, n int) ([]byte, error)
- func PKCSUnPadding(buf []byte, n int) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorPaddingBadMultple = errors.New(common.FormatNamespaceString("Bad PKCS#7 padding - bad multiple")) ErrorPaddingNotAMultiple = errors.New(common.FormatNamespaceString("Bad PKCS#7 padding - not a multiple of blocksize")) ErrorPaddingTooLong = errors.New(common.FormatNamespaceString("Bad PKCS#7 padding - too long")) ErrorPaddingTooShort = errors.New(common.FormatNamespaceString("Bad PKCS#7 padding - too short")) ErrorPaddingNotAllTheSame = errors.New(common.FormatNamespaceString("Bad PKCS#7 padding - not all the same")) )
Errors padding & unpadding can return
Functions ¶
func AESECBPKCSDecrypt ¶
AESECBPKCSDecrypt AES/ECB/PKCSPadding Decrypt
func AESECBPKCSEncrypt ¶
AESECBPKCSEncrypt AES/ECB/PKCSPadding Encrypt
func NewECBDecrypter ¶
NewECBDecrypter returns a BlockMode which decrypts in electronic code book mode, using the given Block.
func NewECBEncrypter ¶
NewECBEncrypter returns a BlockMode which encrypts in electronic code book key, using the given AES key.
func PKCS5Padding ¶
PKCS5Padding PKCS#5: buf using PKCS#7 to a multiple of 8.
func PKCS5UnPadding ¶
PKCS5UnPadding buf using PKCS#7 from a multiple of 8 returning a slice of
func PKCSPadding ¶
PKCSPadding buf using PKCS#7 to a multiple of n.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.