瀏覽代碼

:edit 解密时直接输出保温

fly 3 月之前
父節點
當前提交
8a549291d7
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      algorithm/encryption/AesCBCWithPadding.go

+ 1 - 1
algorithm/encryption/AesCBCWithPadding.go

@@ -72,5 +72,5 @@ func (a *AesCBCWithPadding) Decrypt(ciphertext []byte) ([]byte, error) {
 	mode.CryptBlocks(decrypted, ciphertext)
 
 	plaintext := zeroUnPad(decrypted)
-	return plaintext, nil
+	return plaintext[aes.BlockSize:], nil
 }