Documentation ¶
Index ¶
- func Decrypt(data, key []byte, mode smconstant.EncryptMode) (out []byte, err error)
- func Encrypt(data, key []byte, mode smconstant.EncryptMode) (out []byte, err error)
- func ReadPwdFromFile(path string, pwd []byte) (key []byte, err error)
- func SecretText(mab string, key []byte) (secretText string, err error)
- func WritePwdToFile(path string, key, pwd []byte) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶
func Decrypt(data, key []byte, mode smconstant.EncryptMode) (out []byte, err error)
Decrypt *
- @Description: SM4解密
- @param data
- @param key
- @param mode
- @return out
- @return err
func Encrypt ¶
func Encrypt(data, key []byte, mode smconstant.EncryptMode) (out []byte, err error)
Encrypt *
- @Description: SM4加密
- @param data
- @param key
- @param mode
- @return out
- @return err
func ReadPwdFromFile ¶
ReadPwdFromFile *
- @Description: 从文件读取sm4秘钥
- @param path sm4秘钥文件路径
- @param pwd 密码
- @return key 秘钥
- @return err
func SecretText ¶
SecretText *
- @Description: 银联联机UtvtSm4Mac算法
- @param mab mab MAC ELEMEMENT BLOCK
- @param key 秘钥
- @return secretText 加密因子
- @return err
func WritePwdToFile ¶
WritePwdToFile *
- @Description: 将sm4秘钥写入文件
- @param path sm4秘钥文件保存路径
- @param key 秘钥
- @param pwd 密码
- @return err
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.