MCPcopy Create free account
hub / github.com/Peithon/scLoader / DesDecrypt

Function DesDecrypt

loader/loader.go:46–58  ·  view source on GitHub ↗
(crypted, key []byte)

Source from the content-addressed store, hash-verified

44}
45
46func DesDecrypt(crypted, key []byte) ([]byte, error) {
47 block, err := des.NewCipher(key)
48 if err != nil {
49 return nil, err
50 }
51 blockMode := cipher.NewCBCDecrypter(block, key)
52 origData := make([]byte, len(crypted))
53 // origData := crypted
54 blockMode.CryptBlocks(origData, crypted)
55 origData = PKCS5UnPadding(origData)
56 // origData = ZeroUnPadding(origData)
57 return origData, nil
58}
59
60// 3DES解密
61func TripleDesDecrypt(crypted, key, iv []byte) ([]byte, error) {

Callers 1

mainFunction · 0.70

Calls 1

PKCS5UnPaddingFunction · 0.70

Tested by

no test coverage detected