Documentation ¶
Index ¶
- Constants
- func AESDecrypt(encrypted []byte, key []byte, iv []byte) (decrypted []byte, err error)
- func AESDecryptBase64(encrypted string, key []byte, iv []byte) (decrypted []byte, err error)
- func AESEncrypt(unencrypted []byte, key []byte, iv []byte) (encrypted []byte, err error)
- func AESEncryptBase64(unencrypted []byte, key []byte, iv []byte) (encrypted string, err error)
- func AESNonceDecrypt(encrypted []byte, key []byte) (decrypted []byte, err error)
- func AESNonceDecryptBase64(encrypted string, key []byte) (decrypted []byte, err error)
- func AESNonceEncrypt(unencrypted []byte, key []byte) (encrypted []byte, err error)
- func AESNonceEncryptBase64(unencrypted []byte, key []byte) (encrypted string, err error)
- func PKCS7Padding(data []byte, blockSize int) []byte
- func PKCS7Unpadding(data []byte) []byte
Constants ¶
const IVSize = 16
IVSize AES IV size
Variables ¶
This section is empty.
Functions ¶
func AESDecrypt ¶
AESDecrypt decrypt data with given key and iv. Data will be unpadding with PKCS7Unpadding. Return decrypted data and any error if raised.
func AESDecryptBase64 ¶
AESDecryptBase64 decrypt base64 encoded data with given key and iv. Data will be unpadding with PKCS7Unpadding. Return decrypted data and any error if raised.
func AESEncrypt ¶
AESEncrypt aes encrypt with given data,key and iv. Data will be padding with PKCS7Padding Return encrytped data and any error if raised.
func AESEncryptBase64 ¶
AESEncryptBase64 aes encrypt with given data,key and iv. Data will be padding with PKCS7Padding Return base64 encoded encrytped data and any error if raised.
func AESNonceDecrypt ¶
AESNonceDecrypt decrypt data with given key. IV will load form first bytes of data. Data will be unpadding with PKCS7Unpadding. Return decrypted data and any error if raised.
func AESNonceDecryptBase64 ¶
AESNonceDecryptBase64 decrypt base64 encoded data with given key. IV will load form first bytes of data. Data will be unpadding with PKCS7Unpadding. Return decrypted data and any error if raised.
func AESNonceEncrypt ¶
AESNonceEncrypt aes encrypt data with given key and random bytes as IV. Data will be padding with PKCS7Padding Random IV will prefix encryped data return encrypted data and any error if raisd.
func AESNonceEncryptBase64 ¶
AESNonceEncryptBase64 aes encrypt data with given key and random bytes as IV. Data will be padding with PKCS7Padding Random IV will prefix encryped data return base64 encoded encrypted data and any error if raisd.
func PKCS7Padding ¶
PKCS7Padding padding data as PKCS7 Reference http://blog.studygolang.com/167.html
func PKCS7Unpadding ¶
PKCS7Unpadding unpadding data as PKCS7 Reference http://blog.studygolang.com/167.html
Types ¶
This section is empty.