Documentation ¶
Index ¶
- Variables
- func AddCipher(oid asn1.ObjectIdentifier, cipher CipherFunc)
- func AddGostSbox(name string, sbox GostSbox)
- func AllCipher() map[string]CipherFunc
- func CheckCipher(c Cipher) bool
- func CheckCipherFromName(name string) bool
- func GetCipherName(c Cipher) string
- func GetGostSboxByOID(oid asn1.ObjectIdentifier) ([][]byte, bool)
- type Cipher
- type CipherCBC
- func (this CipherCBC) Decrypt(key, params, ciphertext []byte) ([]byte, error)
- func (this CipherCBC) Encrypt(rand io.Reader, key, plaintext []byte) ([]byte, []byte, error)
- func (this CipherCBC) HasKeyLength() bool
- func (this CipherCBC) KeySize() int
- func (this CipherCBC) NeedPasswordBmpString() bool
- func (this CipherCBC) OID() asn1.ObjectIdentifier
- func (this CipherCBC) WithHasKeyLength(hasKeyLength bool) CipherCBC
- func (this CipherCBC) WithNeedPasswordBmpString(needPassBmp bool) CipherCBC
- type CipherCCM
- func (this CipherCCM) Decrypt(key, param, ciphertext []byte) ([]byte, error)
- func (this CipherCCM) Encrypt(rand io.Reader, key, plaintext []byte) ([]byte, []byte, error)
- func (this CipherCCM) HasKeyLength() bool
- func (this CipherCCM) KeySize() int
- func (this CipherCCM) NeedPasswordBmpString() bool
- func (this CipherCCM) OID() asn1.ObjectIdentifier
- func (this CipherCCM) WithHasKeyLength(hasKeyLength bool) CipherCCM
- func (this CipherCCM) WithNeedPasswordBmpString(needPassBmp bool) CipherCCM
- type CipherCCMIv
- func (this CipherCCMIv) Decrypt(key, param, ciphertext []byte) ([]byte, error)
- func (this CipherCCMIv) Encrypt(rand io.Reader, key, plaintext []byte) ([]byte, []byte, error)
- func (this CipherCCMIv) HasKeyLength() bool
- func (this CipherCCMIv) KeySize() int
- func (this CipherCCMIv) NeedPasswordBmpString() bool
- func (this CipherCCMIv) OID() asn1.ObjectIdentifier
- func (this CipherCCMIv) WithHasKeyLength(hasKeyLength bool) CipherCCMIv
- func (this CipherCCMIv) WithNeedPasswordBmpString(needPassBmp bool) CipherCCMIv
- type CipherCFB
- func (this CipherCFB) Decrypt(key, params, ciphertext []byte) ([]byte, error)
- func (this CipherCFB) Encrypt(rand io.Reader, key, plaintext []byte) ([]byte, []byte, error)
- func (this CipherCFB) HasKeyLength() bool
- func (this CipherCFB) KeySize() int
- func (this CipherCFB) NeedPasswordBmpString() bool
- func (this CipherCFB) OID() asn1.ObjectIdentifier
- func (this CipherCFB) WithHasKeyLength(hasKeyLength bool) CipherCFB
- func (this CipherCFB) WithNeedPasswordBmpString(needPassBmp bool) CipherCFB
- type CipherCFB1
- func (this CipherCFB1) Decrypt(key, params, ciphertext []byte) ([]byte, error)
- func (this CipherCFB1) Encrypt(rand io.Reader, key, plaintext []byte) ([]byte, []byte, error)
- func (this CipherCFB1) HasKeyLength() bool
- func (this CipherCFB1) KeySize() int
- func (this CipherCFB1) NeedPasswordBmpString() bool
- func (this CipherCFB1) OID() asn1.ObjectIdentifier
- func (this CipherCFB1) WithHasKeyLength(hasKeyLength bool) CipherCFB1
- func (this CipherCFB1) WithNeedPasswordBmpString(needPassBmp bool) CipherCFB1
- type CipherCFB8
- func (this CipherCFB8) Decrypt(key, params, ciphertext []byte) ([]byte, error)
- func (this CipherCFB8) Encrypt(rand io.Reader, key, plaintext []byte) ([]byte, []byte, error)
- func (this CipherCFB8) HasKeyLength() bool
- func (this CipherCFB8) KeySize() int
- func (this CipherCFB8) NeedPasswordBmpString() bool
- func (this CipherCFB8) OID() asn1.ObjectIdentifier
- func (this CipherCFB8) WithHasKeyLength(hasKeyLength bool) CipherCFB8
- func (this CipherCFB8) WithNeedPasswordBmpString(needPassBmp bool) CipherCFB8
- type CipherECB
- func (this CipherECB) Decrypt(key, params, ciphertext []byte) ([]byte, error)
- func (this CipherECB) Encrypt(rand io.Reader, key, plaintext []byte) ([]byte, []byte, error)
- func (this CipherECB) HasKeyLength() bool
- func (this CipherECB) KeySize() int
- func (this CipherECB) NeedPasswordBmpString() bool
- func (this CipherECB) OID() asn1.ObjectIdentifier
- func (this CipherECB) WithHasKeyLength(hasKeyLength bool) CipherECB
- func (this CipherECB) WithNeedPasswordBmpString(needPassBmp bool) CipherECB
- type CipherFunc
- type CipherGCM
- func (this CipherGCM) Decrypt(key, param, ciphertext []byte) ([]byte, error)
- func (this CipherGCM) Encrypt(rand io.Reader, key, plaintext []byte) ([]byte, []byte, error)
- func (this CipherGCM) HasKeyLength() bool
- func (this CipherGCM) KeySize() int
- func (this CipherGCM) NeedPasswordBmpString() bool
- func (this CipherGCM) OID() asn1.ObjectIdentifier
- func (this CipherGCM) WithHasKeyLength(hasKeyLength bool) CipherGCM
- func (this CipherGCM) WithNeedPasswordBmpString(needPassBmp bool) CipherGCM
- type CipherGCMIv
- func (this CipherGCMIv) Decrypt(key, param, ciphertext []byte) ([]byte, error)
- func (this CipherGCMIv) Encrypt(rand io.Reader, key, plaintext []byte) ([]byte, []byte, error)
- func (this CipherGCMIv) HasKeyLength() bool
- func (this CipherGCMIv) KeySize() int
- func (this CipherGCMIv) NeedPasswordBmpString() bool
- func (this CipherGCMIv) OID() asn1.ObjectIdentifier
- func (this CipherGCMIv) WithHasKeyLength(hasKeyLength bool) CipherGCMIv
- func (this CipherGCMIv) WithNeedPasswordBmpString(needPassBmp bool) CipherGCMIv
- type CipherGostCFB
- func (this CipherGostCFB) Decrypt(key, params, ciphertext []byte) ([]byte, error)
- func (this CipherGostCFB) Encrypt(rand io.Reader, key, plaintext []byte) ([]byte, []byte, error)
- func (this CipherGostCFB) HasKeyLength() bool
- func (this CipherGostCFB) KeySize() int
- func (this CipherGostCFB) NeedPasswordBmpString() bool
- func (this CipherGostCFB) OID() asn1.ObjectIdentifier
- func (this CipherGostCFB) WithHasKeyLength(hasKeyLength bool) CipherGostCFB
- func (this CipherGostCFB) WithNeedPasswordBmpString(needPassBmp bool) CipherGostCFB
- func (this CipherGostCFB) WithSbox(name string) CipherGostCFB
- type CipherOFB
- func (this CipherOFB) Decrypt(key, params, ciphertext []byte) ([]byte, error)
- func (this CipherOFB) Encrypt(rand io.Reader, key, plaintext []byte) ([]byte, []byte, error)
- func (this CipherOFB) HasKeyLength() bool
- func (this CipherOFB) KeySize() int
- func (this CipherOFB) NeedPasswordBmpString() bool
- func (this CipherOFB) OID() asn1.ObjectIdentifier
- func (this CipherOFB) WithHasKeyLength(hasKeyLength bool) CipherOFB
- func (this CipherOFB) WithNeedPasswordBmpString(needPassBmp bool) CipherOFB
- type CipherRC2CBC
- func (this CipherRC2CBC) Decrypt(key, params, ciphertext []byte) ([]byte, error)
- func (this CipherRC2CBC) Encrypt(rand io.Reader, key, plaintext []byte) ([]byte, []byte, error)
- func (this CipherRC2CBC) HasKeyLength() bool
- func (this CipherRC2CBC) KeySize() int
- func (this CipherRC2CBC) NeedPasswordBmpString() bool
- func (this CipherRC2CBC) OID() asn1.ObjectIdentifier
- func (this CipherRC2CBC) WithHasKeyLength(hasKeyLength bool) CipherRC2CBC
- func (this CipherRC2CBC) WithKeySize(keySize int) CipherRC2CBC
- func (this CipherRC2CBC) WithNeedPasswordBmpString(needPassBmp bool) CipherRC2CBC
- func (this CipherRC2CBC) WithRC2Version(rc2Version int) CipherRC2CBC
- type CipherRC5CBC
- func (this CipherRC5CBC) Decrypt(key, params, ciphertext []byte) ([]byte, error)
- func (this CipherRC5CBC) Encrypt(rand io.Reader, key, plaintext []byte) ([]byte, []byte, error)
- func (this CipherRC5CBC) HasKeyLength() bool
- func (this CipherRC5CBC) KeySize() int
- func (this CipherRC5CBC) NeedPasswordBmpString() bool
- func (this CipherRC5CBC) OID() asn1.ObjectIdentifier
- func (this CipherRC5CBC) WithHasKeyLength(hasKeyLength bool) CipherRC5CBC
- func (this CipherRC5CBC) WithKeySize(keySize int) CipherRC5CBC
- func (this CipherRC5CBC) WithNeedPasswordBmpString(needPassBmp bool) CipherRC5CBC
- func (this CipherRC5CBC) WithRounds(rounds uint) CipherRC5CBC
- func (this CipherRC5CBC) WithWordSize(wordSize uint) CipherRC5CBC
- type Ciphers
- type GostSbox
Constants ¶
This section is empty.
Variables ¶
var AES128CBC = CipherCBC{ // contains filtered or unexported fields }
AES128CBC is the 128-bit key AES cipher in CBC mode.
var AES128CCM = CipherCCM{ // contains filtered or unexported fields }
AES128CCM is the 128-bit key AES cipher in CCM mode.
var AES128CCMIv = CipherCCMIv{ // contains filtered or unexported fields }
AES128CCMIv is the 128-bit key AES cipher in CCM mode.
var AES128CFB = CipherCFB{ // contains filtered or unexported fields }
AES128CFB is the 128-bit key AES cipher in CFB mode.
var AES128ECB = CipherECB{ // contains filtered or unexported fields }
AES128ECB is the 128-bit key AES cipher in ECB mode.
var AES128GCM = CipherGCM{ // contains filtered or unexported fields }
AES128GCM is the 128-bit key AES cipher in GCM mode.
var AES128GCMIv = CipherGCMIv{ // contains filtered or unexported fields }
AES128GCMIv is the 128-bit key AES cipher in GCM mode.
var AES128OFB = CipherOFB{ // contains filtered or unexported fields }
AES128OFB is the 128-bit key AES cipher in OFB mode.
var AES192CBC = CipherCBC{ // contains filtered or unexported fields }
AES192CBC is the 192-bit key AES cipher in CBC mode.
var AES192CCM = CipherCCM{ // contains filtered or unexported fields }
AES192CCM is the 192-bit key AES cipher in CCM mode.
var AES192CCMIv = CipherCCMIv{ // contains filtered or unexported fields }
AES192CCMIv is the 192-bit key AES cipher in CCM mode.
var AES192CFB = CipherCFB{ // contains filtered or unexported fields }
AES192CFB is the 192-bit key AES cipher in CFB mode.
var AES192ECB = CipherECB{ // contains filtered or unexported fields }
AES192ECB is the 192-bit key AES cipher in ECB mode.
var AES192GCM = CipherGCM{ // contains filtered or unexported fields }
AES192GCM is the 192-bit key AES cipher in GCM mode.
var AES192GCMIv = CipherGCMIv{ // contains filtered or unexported fields }
AES192GCMIv is the 192-bit key AES cipher in GCM mode.
var AES192OFB = CipherOFB{ // contains filtered or unexported fields }
AES192OFB is the 192-bit key AES cipher in OFB mode.
var AES256CBC = CipherCBC{ // contains filtered or unexported fields }
AES256CBC is the 256-bit key AES cipher in CBC mode.
var AES256CCM = CipherCCM{ // contains filtered or unexported fields }
AES256CCM is the 256-bit key AES cipher in CCM mode.
var AES256CCMIv = CipherCCMIv{ // contains filtered or unexported fields }
AES256CCMIv is the 256-bit key AES cipher in CCM mode.
var AES256CFB = CipherCFB{ // contains filtered or unexported fields }
AES256CFB is the 256-bit key AES cipher in CFB mode.
var AES256ECB = CipherECB{ // contains filtered or unexported fields }
AES256ECB is the 256-bit key AES cipher in ECB mode.
var AES256GCM = CipherGCM{ // contains filtered or unexported fields }
AES256GCM is the 256-bit key AES cipher in GCM mode.
var AES256GCMIv = CipherGCMIv{ // contains filtered or unexported fields }
AES256GCMIv is the 256-bit key AES cipher in GCM mode.
var AES256OFB = CipherOFB{ // contains filtered or unexported fields }
AES256OFB is the 256-bit key AES cipher in OFB mode.
var CipherMap = map[string]Cipher{ "DESCBC": DESCBC, "DESEDE3CBC": DESEDE3CBC, "RC2CBC": RC2CBC, "RC2_40CBC": RC2_40CBC, "RC2_64CBC": RC2_64CBC, "RC2_128CBC": RC2_128CBC, "RC5CBC": RC5CBC, "RC5_128CBC": RC5_128CBC, "RC5_192CBC": RC5_192CBC, "RC5_256CBC": RC5_256CBC, "AES128ECB": AES128ECB, "AES128CBC": AES128CBC, "AES128OFB": AES128OFB, "AES128CFB": AES128CFB, "AES128GCM": AES128GCM, "AES128GCMIv": AES128GCMIv, "AES128CCM": AES128CCM, "AES128CCMIv": AES128CCMIv, "AES192ECB": AES192ECB, "AES192CBC": AES192CBC, "AES192OFB": AES192OFB, "AES192CFB": AES192CFB, "AES192GCM": AES192GCM, "AES192GCMIv": AES192GCMIv, "AES192CCM": AES192CCM, "AES192CCMIv": AES192CCMIv, "AES256ECB": AES256ECB, "AES256CBC": AES256CBC, "AES256OFB": AES256OFB, "AES256CFB": AES256CFB, "AES256GCM": AES256GCM, "AES256GCMIv": AES256GCMIv, "AES256CCM": AES256CCM, "AES256CCMIv": AES256CCMIv, "SM4ECB": SM4ECB, "SM4CBC": SM4CBC, "SM4OFB": SM4OFB, "SM4CFB": SM4CFB, "SM4CFB1": SM4CFB1, "SM4CFB8": SM4CFB8, "SM4GCM": SM4GCM, "SM4GCMIv": SM4GCMIv, "SM4CCM": SM4CCM, "SM4CCMIv": SM4CCMIv, "GostCipher": GostCipher, }
Cipher 列表
var DESCBC = CipherCBC{ // contains filtered or unexported fields }
DESCBC is the 56-bit key DES cipher in CBC mode.
var DESEDE3CBC = CipherCBC{ // contains filtered or unexported fields }
TripleDESCBC is the 168-bit key 3DES cipher in CBC mode.
var GostCipher = CipherGostCFB{ // contains filtered or unexported fields }
GostCipher is the 256-bit key Gost cipher in CFB mode.
var RC2CBC = CipherRC2CBC{ // contains filtered or unexported fields }
RC2CBC is the [40-bit, 64-bit, 168-bit] key RC2 cipher in CBC mode. [rc2Version, keySize] = [58, 16] | [120, 8] | [160, 5]
var RC2_128CBC = RC2CBC.WithRC2Version(58).WithKeySize(16)
var RC2_40CBC = RC2CBC.WithRC2Version(160).WithKeySize(5)
var RC2_64CBC = RC2CBC.WithRC2Version(120).WithKeySize(8)
var RC5CBC = CipherRC5CBC{ // contains filtered or unexported fields }
RC5CBC is the [16, 24, 32] bytes key RC5 cipher in CBC mode. wordSize = [32, 64] | rounds = [8, 127]
var RC5_128CBC = RC5CBC.WithKeySize(16)
var RC5_192CBC = RC5CBC.WithKeySize(24)
var RC5_256CBC = RC5CBC.WithKeySize(32)
var SM4CBC = CipherCBC{ // contains filtered or unexported fields }
SM4CBC is the 128-bit key SM4 cipher in CBC mode.
var SM4CCM = CipherCCM{ // contains filtered or unexported fields }
SM4CCM is the 128-bit key SM4 cipher in CCM mode.
var SM4CCMIv = CipherCCMIv{ // contains filtered or unexported fields }
SM4CCMIv is the 128-bit key SM4 cipher in CCM mode.
var SM4CFB = CipherCFB{ // contains filtered or unexported fields }
SM4CFB is the 128-bit key SM4 cipher in CFB mode.
var SM4CFB1 = CipherCFB1{ // contains filtered or unexported fields }
SM4CFB1 is the 128-bit key SM4 cipher in CFB mode.
var SM4CFB8 = CipherCFB8{ // contains filtered or unexported fields }
SM4CFB8 is the 128-bit key SM4 cipher in CFB mode.
var SM4ECB = CipherECB{ // contains filtered or unexported fields }
SM4ECB is the 128-bit key SM4 cipher in ECB mode.
var SM4GCM = CipherGCM{ // contains filtered or unexported fields }
SM4GCM is the 128-bit key SM4 cipher in GCM mode.
var SM4GCMIv = CipherGCMIv{ // contains filtered or unexported fields }
SM4GCMIv is the 128-bit key SM4 cipher in GCM mode.
var SM4OFB = CipherOFB{ // contains filtered or unexported fields }
SM4OFB is the 128-bit key SM4 cipher in OFB mode.
Functions ¶
func AddGostSbox ¶ added in v1.0.2050
func GetGostSboxByOID ¶ added in v1.0.2050
func GetGostSboxByOID(oid asn1.ObjectIdentifier) ([][]byte, bool)
Types ¶
type Cipher ¶
type Cipher interface { // oid OID() asn1.ObjectIdentifier // 值大小 KeySize() int // 是否有 KeyLength HasKeyLength() bool // 密码是否需要 Bmp 处理 NeedPasswordBmpString() bool // 加密, 返回: [加密后数据, 参数, error] Encrypt(rand io.Reader, key, plaintext []byte) ([]byte, []byte, error) // 解密 Decrypt(key, params, ciphertext []byte) ([]byte, error) }
加密接口
type CipherCBC ¶
type CipherCBC struct {
// contains filtered or unexported fields
}
cbc 模式加密
func (CipherCBC) HasKeyLength ¶ added in v1.0.2039
是否有 KeyLength
func (CipherCBC) NeedPasswordBmpString ¶ added in v1.0.2039
密码是否需要 Bmp 处理
func (CipherCBC) WithHasKeyLength ¶ added in v1.0.2039
func (CipherCBC) WithNeedPasswordBmpString ¶ added in v1.0.2039
type CipherCCM ¶
type CipherCCM struct {
// contains filtered or unexported fields
}
ccm 模式加密
func (CipherCCM) HasKeyLength ¶ added in v1.0.2039
是否有 KeyLength
func (CipherCCM) NeedPasswordBmpString ¶ added in v1.0.2039
密码是否需要 Bmp 处理
func (CipherCCM) WithHasKeyLength ¶ added in v1.0.2039
func (CipherCCM) WithNeedPasswordBmpString ¶ added in v1.0.2039
type CipherCCMIv ¶ added in v1.0.2029
type CipherCCMIv struct {
// contains filtered or unexported fields
}
ccm 模式加密
func (CipherCCMIv) Decrypt ¶ added in v1.0.2029
func (this CipherCCMIv) Decrypt(key, param, ciphertext []byte) ([]byte, error)
解密
func (CipherCCMIv) HasKeyLength ¶ added in v1.0.2039
func (this CipherCCMIv) HasKeyLength() bool
是否有 KeyLength
func (CipherCCMIv) NeedPasswordBmpString ¶ added in v1.0.2039
func (this CipherCCMIv) NeedPasswordBmpString() bool
密码是否需要 Bmp 处理
func (CipherCCMIv) WithHasKeyLength ¶ added in v1.0.2039
func (this CipherCCMIv) WithHasKeyLength(hasKeyLength bool) CipherCCMIv
func (CipherCCMIv) WithNeedPasswordBmpString ¶ added in v1.0.2039
func (this CipherCCMIv) WithNeedPasswordBmpString(needPassBmp bool) CipherCCMIv
type CipherCFB ¶
type CipherCFB struct {
// contains filtered or unexported fields
}
CFB 模式加密
func (CipherCFB) HasKeyLength ¶ added in v1.0.2039
是否有 KeyLength
func (CipherCFB) NeedPasswordBmpString ¶ added in v1.0.2039
密码是否需要 Bmp 处理
func (CipherCFB) WithHasKeyLength ¶ added in v1.0.2039
func (CipherCFB) WithNeedPasswordBmpString ¶ added in v1.0.2039
type CipherCFB1 ¶
type CipherCFB1 struct {
// contains filtered or unexported fields
}
CFB1 模式加密
func (CipherCFB1) Decrypt ¶
func (this CipherCFB1) Decrypt(key, params, ciphertext []byte) ([]byte, error)
解密
func (CipherCFB1) HasKeyLength ¶ added in v1.0.2039
func (this CipherCFB1) HasKeyLength() bool
是否有 KeyLength
func (CipherCFB1) NeedPasswordBmpString ¶ added in v1.0.2039
func (this CipherCFB1) NeedPasswordBmpString() bool
密码是否需要 Bmp 处理
func (CipherCFB1) WithHasKeyLength ¶ added in v1.0.2039
func (this CipherCFB1) WithHasKeyLength(hasKeyLength bool) CipherCFB1
func (CipherCFB1) WithNeedPasswordBmpString ¶ added in v1.0.2039
func (this CipherCFB1) WithNeedPasswordBmpString(needPassBmp bool) CipherCFB1
type CipherCFB8 ¶
type CipherCFB8 struct {
// contains filtered or unexported fields
}
CFB8 模式加密
func (CipherCFB8) Decrypt ¶
func (this CipherCFB8) Decrypt(key, params, ciphertext []byte) ([]byte, error)
解密
func (CipherCFB8) HasKeyLength ¶ added in v1.0.2039
func (this CipherCFB8) HasKeyLength() bool
是否有 KeyLength
func (CipherCFB8) NeedPasswordBmpString ¶ added in v1.0.2039
func (this CipherCFB8) NeedPasswordBmpString() bool
密码是否需要 Bmp 处理
func (CipherCFB8) WithHasKeyLength ¶ added in v1.0.2039
func (this CipherCFB8) WithHasKeyLength(hasKeyLength bool) CipherCFB8
func (CipherCFB8) WithNeedPasswordBmpString ¶ added in v1.0.2039
func (this CipherCFB8) WithNeedPasswordBmpString(needPassBmp bool) CipherCFB8
type CipherECB ¶
type CipherECB struct {
// contains filtered or unexported fields
}
ecb 模式加密
func (CipherECB) HasKeyLength ¶ added in v1.0.2039
是否有 KeyLength
func (CipherECB) NeedPasswordBmpString ¶ added in v1.0.2039
密码是否需要 Bmp 处理
func (CipherECB) WithHasKeyLength ¶ added in v1.0.2039
func (CipherECB) WithNeedPasswordBmpString ¶ added in v1.0.2039
type CipherGCM ¶
type CipherGCM struct {
// contains filtered or unexported fields
}
gcm 模式加密
func (CipherGCM) HasKeyLength ¶ added in v1.0.2039
是否有 KeyLength
func (CipherGCM) NeedPasswordBmpString ¶ added in v1.0.2039
密码是否需要 Bmp 处理
func (CipherGCM) WithHasKeyLength ¶ added in v1.0.2039
func (CipherGCM) WithNeedPasswordBmpString ¶ added in v1.0.2039
type CipherGCMIv ¶ added in v1.0.2029
type CipherGCMIv struct {
// contains filtered or unexported fields
}
gcm 模式加密
func (CipherGCMIv) Decrypt ¶ added in v1.0.2029
func (this CipherGCMIv) Decrypt(key, param, ciphertext []byte) ([]byte, error)
解密
func (CipherGCMIv) HasKeyLength ¶ added in v1.0.2039
func (this CipherGCMIv) HasKeyLength() bool
是否有 KeyLength
func (CipherGCMIv) NeedPasswordBmpString ¶ added in v1.0.2039
func (this CipherGCMIv) NeedPasswordBmpString() bool
密码是否需要 Bmp 处理
func (CipherGCMIv) WithHasKeyLength ¶ added in v1.0.2039
func (this CipherGCMIv) WithHasKeyLength(hasKeyLength bool) CipherGCMIv
func (CipherGCMIv) WithNeedPasswordBmpString ¶ added in v1.0.2039
func (this CipherGCMIv) WithNeedPasswordBmpString(needPassBmp bool) CipherGCMIv
type CipherGostCFB ¶ added in v1.0.2050
type CipherGostCFB struct {
// contains filtered or unexported fields
}
Gost CFB 模式加密
func (CipherGostCFB) Decrypt ¶ added in v1.0.2050
func (this CipherGostCFB) Decrypt(key, params, ciphertext []byte) ([]byte, error)
解密
func (CipherGostCFB) HasKeyLength ¶ added in v1.0.2050
func (this CipherGostCFB) HasKeyLength() bool
是否有 KeyLength
func (CipherGostCFB) NeedPasswordBmpString ¶ added in v1.0.2050
func (this CipherGostCFB) NeedPasswordBmpString() bool
密码是否需要 Bmp 处理
func (CipherGostCFB) OID ¶ added in v1.0.2050
func (this CipherGostCFB) OID() asn1.ObjectIdentifier
oid
func (CipherGostCFB) WithHasKeyLength ¶ added in v1.0.2050
func (this CipherGostCFB) WithHasKeyLength(hasKeyLength bool) CipherGostCFB
func (CipherGostCFB) WithNeedPasswordBmpString ¶ added in v1.0.2050
func (this CipherGostCFB) WithNeedPasswordBmpString(needPassBmp bool) CipherGostCFB
func (CipherGostCFB) WithSbox ¶ added in v1.0.2050
func (this CipherGostCFB) WithSbox(name string) CipherGostCFB
type CipherOFB ¶
type CipherOFB struct {
// contains filtered or unexported fields
}
OFB 模式加密
func (CipherOFB) HasKeyLength ¶ added in v1.0.2039
是否有 KeyLength
func (CipherOFB) NeedPasswordBmpString ¶ added in v1.0.2039
密码是否需要 Bmp 处理
func (CipherOFB) WithHasKeyLength ¶ added in v1.0.2039
func (CipherOFB) WithNeedPasswordBmpString ¶ added in v1.0.2039
type CipherRC2CBC ¶
type CipherRC2CBC struct {
// contains filtered or unexported fields
}
cbc 模式加密
func (CipherRC2CBC) Decrypt ¶
func (this CipherRC2CBC) Decrypt(key, params, ciphertext []byte) ([]byte, error)
解密
func (CipherRC2CBC) HasKeyLength ¶ added in v1.0.2039
func (this CipherRC2CBC) HasKeyLength() bool
是否有 KeyLength
func (CipherRC2CBC) NeedPasswordBmpString ¶ added in v1.0.2039
func (this CipherRC2CBC) NeedPasswordBmpString() bool
密码是否需要 Bmp 处理
func (CipherRC2CBC) WithHasKeyLength ¶ added in v1.0.2039
func (this CipherRC2CBC) WithHasKeyLength(hasKeyLength bool) CipherRC2CBC
func (CipherRC2CBC) WithKeySize ¶
func (this CipherRC2CBC) WithKeySize(keySize int) CipherRC2CBC
设置 keySize
func (CipherRC2CBC) WithNeedPasswordBmpString ¶ added in v1.0.2039
func (this CipherRC2CBC) WithNeedPasswordBmpString(needPassBmp bool) CipherRC2CBC
func (CipherRC2CBC) WithRC2Version ¶
func (this CipherRC2CBC) WithRC2Version(rc2Version int) CipherRC2CBC
设置 RC2Version
type CipherRC5CBC ¶
type CipherRC5CBC struct {
// contains filtered or unexported fields
}
cbc 模式加密
func (CipherRC5CBC) Decrypt ¶
func (this CipherRC5CBC) Decrypt(key, params, ciphertext []byte) ([]byte, error)
解密
func (CipherRC5CBC) HasKeyLength ¶ added in v1.0.2039
func (this CipherRC5CBC) HasKeyLength() bool
是否有 KeyLength
func (CipherRC5CBC) NeedPasswordBmpString ¶ added in v1.0.2039
func (this CipherRC5CBC) NeedPasswordBmpString() bool
密码是否需要 Bmp 处理
func (CipherRC5CBC) WithHasKeyLength ¶ added in v1.0.2039
func (this CipherRC5CBC) WithHasKeyLength(hasKeyLength bool) CipherRC5CBC
func (CipherRC5CBC) WithKeySize ¶
func (this CipherRC5CBC) WithKeySize(keySize int) CipherRC5CBC
设置 keySize
func (CipherRC5CBC) WithNeedPasswordBmpString ¶ added in v1.0.2039
func (this CipherRC5CBC) WithNeedPasswordBmpString(needPassBmp bool) CipherRC5CBC
func (CipherRC5CBC) WithRounds ¶
func (this CipherRC5CBC) WithRounds(rounds uint) CipherRC5CBC
设置 Rounds
func (CipherRC5CBC) WithWordSize ¶
func (this CipherRC5CBC) WithWordSize(wordSize uint) CipherRC5CBC
设置 WordSize
type Ciphers ¶ added in v1.0.2032
type Ciphers struct {
// contains filtered or unexported fields
}
Ciphers
func NewCiphers ¶ added in v1.0.2032
func NewCiphers() *Ciphers
func (*Ciphers) AddCipher ¶ added in v1.0.2032
func (this *Ciphers) AddCipher(oid asn1.ObjectIdentifier, cipher CipherFunc)
添加加密
type GostSbox ¶ added in v1.0.2050
type GostSbox struct { OID asn1.ObjectIdentifier Sbox [][]byte }