Documentation ¶
Index ¶
- func Aes128CBCDecrypt(key [16]byte, ciphertext []byte) (plaintext []byte, err error)
- func Aes128CBCEncrypt(key [16]byte, plaintext []byte) (ciphertext []byte, err error)
- func Aes128CFBDecrypt(key [16]byte, cipherReader io.Reader) (plainReader io.Reader, err error)
- func Aes128CFBEncrypt(key [16]byte, plainReader io.Reader) (cipherReader io.Reader, err error)
- func Aes128CTRDecrypt(key [16]byte, cipherReader io.Reader) (plainReader io.Reader, err error)
- func Aes128CTREncrypt(key [16]byte, plainReader io.Reader) (cipherReader io.Reader, err error)
- func Aes128ECBDecrypt(key [16]byte, ciphertext []byte) (plaintext []byte, err error)
- func Aes128ECBEncrypt(key [16]byte, plaintext []byte) (ciphertext []byte, err error)
- func Aes128OFBDecrypt(key [16]byte, cipherReader io.Reader) (plainReader io.Reader, err error)
- func Aes128OFBEncrypt(key [16]byte, plainReader io.Reader) (cipherReader io.Reader, err error)
- func Aes192CBCDecrypt(key [24]byte, ciphertext []byte) (plaintext []byte, err error)
- func Aes192CBCEncrypt(key [24]byte, plaintext []byte) (ciphertext []byte, err error)
- func Aes192CFBDecrypt(key [24]byte, cipherReader io.Reader) (plainReader io.Reader, err error)
- func Aes192CFBEncrypt(key [24]byte, plainReader io.Reader) (cipherReader io.Reader, err error)
- func Aes192CTRDecrypt(key [24]byte, cipherReader io.Reader) (plainReader io.Reader, err error)
- func Aes192CTREncrypt(key [24]byte, plainReader io.Reader) (cipherReader io.Reader, err error)
- func Aes192ECBDecrypt(key [24]byte, ciphertext []byte) (plaintext []byte, err error)
- func Aes192ECBEncrypt(key [24]byte, plaintext []byte) (ciphertext []byte, err error)
- func Aes192OFBDecrypt(key [24]byte, cipherReader io.Reader) (plainReader io.Reader, err error)
- func Aes192OFBEncrypt(key [24]byte, plainReader io.Reader) (cipherReader io.Reader, err error)
- func Aes256CBCDecrypt(key [32]byte, ciphertext []byte) (plaintext []byte, err error)
- func Aes256CBCEncrypt(key [32]byte, plaintext []byte) (ciphertext []byte, err error)
- func Aes256CFBDecrypt(key [32]byte, cipherReader io.Reader) (plainReader io.Reader, err error)
- func Aes256CFBEncrypt(key [32]byte, plainReader io.Reader) (cipherReader io.Reader, err error)
- func Aes256CTRDecrypt(key [32]byte, cipherReader io.Reader) (plainReader io.Reader, err error)
- func Aes256CTREncrypt(key [32]byte, plainReader io.Reader) (cipherReader io.Reader, err error)
- func Aes256ECBDecrypt(key [32]byte, ciphertext []byte) (plaintext []byte, err error)
- func Aes256ECBEncrypt(key [32]byte, plaintext []byte) (ciphertext []byte, err error)
- func Aes256OFBDecrypt(key [32]byte, cipherReader io.Reader) (plainReader io.Reader, err error)
- func Aes256OFBEncrypt(key [32]byte, plainReader io.Reader) (cipherReader io.Reader, err error)
- func Base64Decode(raw []byte) []byte
- func Base64DecodeStr(bs64str string) string
- func Base64Encode(raw []byte) []byte
- func Base64EncodeStr(raw string) string
- func CRandBytes(numBytes int) []byte
- func CRandHex(numDigits int) string
- func CReader() io.Reader
- func Convert16bytes(b []byte) (b16 [16]byte)
- func Convert24bytes(b []byte) (b24 [24]byte)
- func Convert32bytes(b []byte) (b32 [32]byte)
- func DecryptAES(src []byte, key []byte) ([]byte, error)
- func EncryptAES(src []byte, key []byte) ([]byte, error)
- func HmacMD5(key, origData []byte) (sum []byte)
- func HmacSHA1(key, origData []byte) (sum []byte)
- func HmacSHA256(key, origData []byte) (sum []byte)
- func HmacSHA512(key, origData []byte) (sum []byte)
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(plaintext []byte) []byte
- func RsaDecrypt(privateKey, ciphertext []byte) ([]byte, error)
- func RsaEncrypt(publicKey, origData []byte) ([]byte, error)
- func Sha256(bytes []byte) []byte
- type Address
- type AesMode
- type PrivKey
- type PubKey
- type Symmetric
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Aes128CBCDecrypt ¶ added in v0.0.2
Aes128CBCDecrypt aes-128-cbc 解密
func Aes128CBCEncrypt ¶ added in v0.0.2
Aes128CBCEncrypt aes-128-cbc 加密
func Aes128CFBDecrypt ¶ added in v0.0.2
Aes128CFBDecrypt aes-128-cfb 解密
func Aes128CFBEncrypt ¶ added in v0.0.2
Aes128CFBEncrypt aes-128-cfb 加密
func Aes128CTRDecrypt ¶ added in v0.0.2
Aes128CTRDecrypt aes-128-ctr 解密
func Aes128CTREncrypt ¶ added in v0.0.2
Aes128CTREncrypt aes-128-ctr 加密
func Aes128ECBDecrypt ¶ added in v0.0.2
Aes128ECBDecrypt aes-128-ecb 解密
func Aes128ECBEncrypt ¶ added in v0.0.2
Aes128ECBEncrypt aes-128-ecb 加密
func Aes128OFBDecrypt ¶ added in v0.0.2
Aes128OFBDecrypt aes-128-ofb 解密
func Aes128OFBEncrypt ¶ added in v0.0.2
Aes128OFBEncrypt aes-128-ofb 加密
func Aes192CBCDecrypt ¶ added in v0.0.2
Aes192CBCDecrypt aes-192-cbc 解密
func Aes192CBCEncrypt ¶ added in v0.0.2
Aes192CBCEncrypt aes-192-cbc 加密
func Aes192CFBDecrypt ¶ added in v0.0.2
Aes192CFBDecrypt aes-192-cfb 解密
func Aes192CFBEncrypt ¶ added in v0.0.2
Aes192CFBEncrypt aes-192-cfb 加密
func Aes192CTRDecrypt ¶ added in v0.0.2
Aes192CTRDecrypt aes-192-ctr 解密
func Aes192CTREncrypt ¶ added in v0.0.2
Aes192CTREncrypt aes-192-ctr 加密
func Aes192ECBDecrypt ¶ added in v0.0.2
Aes192ECBDecrypt aes-192-ecb 解密
func Aes192ECBEncrypt ¶ added in v0.0.2
Aes192ECBEncrypt aes-192-ecb 加密
func Aes192OFBDecrypt ¶ added in v0.0.2
Aes192OFBDecrypt aes-192-ofb 解密
func Aes192OFBEncrypt ¶ added in v0.0.2
Aes192OFBEncrypt aes-192-ofb 加密
func Aes256CBCDecrypt ¶ added in v0.0.2
Aes256CBCDecrypt aes-256-cbc 解密
func Aes256CBCEncrypt ¶ added in v0.0.2
Aes256CBCEncrypt aes-256-cbc 加密
func Aes256CFBDecrypt ¶ added in v0.0.2
Aes256CFBDecrypt aes-256-cfb 解密
func Aes256CFBEncrypt ¶ added in v0.0.2
Aes256CFBEncrypt aes-256-cfb 加密
func Aes256CTRDecrypt ¶ added in v0.0.2
Aes256CTRDecrypt aes-256-ctr 解密
func Aes256CTREncrypt ¶ added in v0.0.2
Aes256CTREncrypt aes-256-ctr 加密
func Aes256ECBDecrypt ¶ added in v0.0.2
Aes256ECBDecrypt aes-256-ecb 解密
func Aes256ECBEncrypt ¶ added in v0.0.2
Aes256ECBEncrypt aes-256-ecb 加密
func Aes256OFBDecrypt ¶ added in v0.0.2
Aes256OFBDecrypt aes-256-ofb 解密
func Aes256OFBEncrypt ¶ added in v0.0.2
Aes256OFBEncrypt aes-256-ofb 加密
func CRandBytes ¶ added in v0.0.9
This only uses the OS's randomness
func CRandHex ¶ added in v0.0.9
CRandHex returns a hex encoded string that's floor(numDigits/2) * 2 long.
Note: CRandHex(24) gives 96 bits of randomness that are usually strong enough for most purposes.
func Convert16bytes ¶ added in v0.0.2
Convert16bytes 将 []byte 转为 [16]byte
func Convert24bytes ¶ added in v0.0.2
Convert24bytes 将 []byte 转为 [24]byte
func Convert32bytes ¶ added in v0.0.2
Convert32bytes 将 []byte 转为 [32]byte
func HmacSHA256 ¶ added in v0.0.2
HmacSHA256 HMAC-SHA-256签名认证
func HmacSHA512 ¶ added in v0.0.2
HmacSHA512 HMAC-SHA-512签名认证
func PKCS5Padding ¶ added in v0.0.2
PKCS5Padding PKCS5 Padding
func PKCS5UnPadding ¶ added in v0.0.2
PKCS5UnPadding PKCS5 UnPadding
Types ¶
type Address ¶ added in v0.0.9
An address is a []byte, but hex-encoded even in JSON. []byte leaves us the option to change the address length. Use an alias so Unmarshal methods (with ptr receivers) are available too.