MCPcopy Create free account
hub / github.com/TideSec/GoBypassAV / PKCS7Padding

Function PKCS7Padding

Encryption/AES_code/main.go:32–39  ·  view source on GitHub ↗

补码

(originByte []byte, blockSize int)

Source from the content-addressed store, hash-verified

30}
31// 补码
32func PKCS7Padding(originByte []byte, blockSize int) []byte {
33 // 计算补码长度
34 padding := blockSize - len(originByte)%blockSize
35 // 生成补码
36 padText := bytes.Repeat([]byte{byte(padding)}, padding)
37 // 追加补码
38 return append(originByte, padText...)
39}
40
41func AesDecryptByECB(data, key string) string {
42 // 判断key长度

Callers 1

AesEncryptByECBFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected