Versions in this module Expand all Collapse all v1 v1.0.1 Feb 8, 2024 v1.0.0 Feb 8, 2024 Changes in this version + func AesDecrypt(cipherData []byte, opts ...AesOption) ([]byte, error) + func AesDecryptHex(cipherStr string, opts ...AesOption) (string, error) + func AesEncrypt(rawData []byte, opts ...AesOption) ([]byte, error) + func AesEncryptHex(rawData string, opts ...AesOption) (string, error) + func DesDecrypt(cipherData []byte, opts ...DesOption) ([]byte, error) + func DesDecryptHex(cipherStr string, opts ...DesOption) (string, error) + func DesEncrypt(rawData []byte, opts ...DesOption) ([]byte, error) + func DesEncryptHex(rawData string, opts ...DesOption) (string, error) + func Hash(hashType crypto.Hash, rawData []byte) (string, error) + func HashAndSaltPassword(password string) (string, error) + func Md5(rawData []byte) string + func RsaDecrypt(privateKey []byte, cipherData []byte, opts ...RsaOption) ([]byte, error) + func RsaDecryptHex(privateKey []byte, cipherHex string, opts ...RsaOption) (string, error) + func RsaEncrypt(publicKey []byte, rawData []byte, opts ...RsaOption) ([]byte, error) + func RsaEncryptHex(publicKey []byte, rawData []byte, opts ...RsaOption) (string, error) + func RsaSign(privateKey []byte, rawData []byte, opts ...RsaOption) ([]byte, error) + func RsaSignBase64(privateKey []byte, rawData []byte, opts ...RsaOption) (string, error) + func RsaVerify(publicKey []byte, rawData []byte, signData []byte, opts ...RsaOption) error + func RsaVerifyBase64(publicKey []byte, rawData []byte, signBase64 string, opts ...RsaOption) error + func Sha1(rawData []byte) string + func Sha256(rawData []byte) string + func Sha512(rawData []byte) string + func VerifyPassword(password string, hashed string) bool + type AesOption func(*aesOptions) + func WithAesKey(key []byte) AesOption + func WithAesModeCBC() AesOption + func WithAesModeCFB() AesOption + func WithAesModeCTR() AesOption + func WithAesModeECB() AesOption + type DesOption func(*desOptions) + func WithDesKey(key []byte) DesOption + func WithDesModeCBC() DesOption + func WithDesModeCFB() DesOption + func WithDesModeCTR() DesOption + func WithDesModeECB() DesOption + type RsaOption func(*rsaOptions) + func WithRsaFormatPKCS1() RsaOption + func WithRsaFormatPKCS8() RsaOption + func WithRsaHashType(hash crypto.Hash) RsaOption + func WithRsaHashTypeMd5() RsaOption + func WithRsaHashTypeSha1() RsaOption + func WithRsaHashTypeSha256() RsaOption + func WithRsaHashTypeSha512() RsaOption