AES-GCM decrypt a gogo

This commit is contained in:
Bel LaPointe
2020-07-24 16:19:58 -06:00
parent 887e67bc7d
commit 26c5ec2c77
2 changed files with 42 additions and 95 deletions

View File

@@ -35,6 +35,7 @@ func aesDec(key, payload string) (string, error) {
if err != nil {
return "", err
}
log.Println(gcm.NonceSize())
if len(ciphertext) < gcm.NonceSize() {
return "", errors.New("short ciphertext")
}