Versions in this module Expand all Collapse all v1 v1.0.1 Apr 5, 2026 v1.0.0 Apr 4, 2026 Changes in this version + const CBCMode + const CFBMode + const CTRMode + const ECBMode + const OFBMode + const PrintBase64 + const PrintHex + const RSA_KEY_SIZE_1024 + const RSA_KEY_SIZE_2048 + const RSA_KEY_SIZE_256 + const RSA_KEY_SIZE_512 + func AesDecrypt(content string, key string, iv string) string + func AesDecryptCBC(content string, key string) string + func AesDecryptECB(content string, key string) string + func AesEncrypt(content string, key string, iv string) string + func AesEncryptCBC(content string, key string) string + func AesEncryptECB(content string, key string) string + func Base64Decrypt(content string) string + func Base64Encrypt(content string) string + func DESDecryptCBC(content string, key string, iv string) string + func DESDecryptECB(content string, key string) string + func DESEncryptCBC(content string, key string, iv string) string + func DESEncryptECB(content string, key string) string + func DSAGenerateKeyPair(size dsa.ParameterSizes, privateKeyPath string, publicKeyPath string) error + func DSASign(content string, privKeyPath string) (r, s *big.Int, err error) + func DSAVerify(content string, pubKeyPath string, r, s *big.Int) (bool, error) + func HMacMD5File(filePath string, key string) (string, error) + func HMacMD5String(s string, key string) string + func HMacSha1File(filePath string, key string) (string, error) + func HMacSha1String(s string, key string) string + func HMacSha256File(filePath string, key string) (string, error) + func HMacSha256String(s string, key string) string + func MD5File(filePath string) (string, error) + func MD5String(s string) string + func RC4Decrypt(content string, key string) string + func RC4Encrypt(content string, key string) string + func RSADecrypt(content string, privateKeyPath string) (string, error) + func RSAEncrypt(content string, publicKeyPath string) (string, error) + func RSAGenerateKeyPair(size int, privateKeyPath string, publicKeyPath string) error + func Sha1File(filePath string) (string, error) + func Sha1String(s string) string + func Sha256File(filePath string) (string, error) + func Sha256String(s string) string + type Cipher struct + DecodeType int + FillMode FillMode + GroupMode int + Iv []byte + Key []byte + Output CipherText + func (c *Cipher) Decode(cipherText string) ([]byte, error) + func (c *Cipher) Decrypt(block cipher.Block, cipherData []byte) (err error) + func (c *Cipher) Encode() string + func (c *Cipher) Encrypt(block cipher.Block, plainData []byte) (err error) + func (c *Cipher) Fill(plainText []byte, blockSize int) []byte + func (c *Cipher) NewECBDecrypter(block cipher.Block, cipherData []byte) + func (c *Cipher) NewECBEncrypter(block cipher.Block, plainData []byte) + func (c *Cipher) UnFill(plainText []byte) (data []byte, err error) + type CipherText []byte + type Crypto interface + Decrypt func(cipherText string) (string, error) + Encrypt func(plainText []byte) (string, error) + type FillMode int + const Pkcs7 + const PkcsZero