sm4

package
v0.0.0-...-0e35c09 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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

func ReadPwdFromFile(path string, pwd []byte) (key []byte, err error)

ReadPwdFromFile *

  • @Description: 从文件读取sm4秘钥
  • @param path sm4秘钥文件路径
  • @param pwd 密码
  • @return key 秘钥
  • @return err

func SecretText

func SecretText(mab string, key []byte) (secretText string, err error)

SecretText *

  • @Description: 银联联机UtvtSm4Mac算法
  • @param mab mab MAC ELEMEMENT BLOCK
  • @param key 秘钥
  • @return secretText 加密因子
  • @return err

func WritePwdToFile

func WritePwdToFile(path string, key, pwd []byte) (err error)

WritePwdToFile *

  • @Description: 将sm4秘钥写入文件
  • @param path sm4秘钥文件保存路径
  • @param key 秘钥
  • @param pwd 密码
  • @return err

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL