{"record":{"id":"59af9336b2149508","repo":"getsops/sops","slug":"could-not-decrypt-with-aes-gcm-s","errorCode":null,"errorMessage":"Could not decrypt with AES_GCM: %s","messagePattern":"Could not decrypt with AES_GCM: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"aes/cipher.go","lineNumber":100,"sourceCode":"\t\treturn \"\", nil\n\t}\n\tencryptedValue, err := parse(ciphertext)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\taescipher, err := cryptoaes.NewCipher(key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tgcm, err := cipher.NewGCMWithNonceSize(aescipher, len(encryptedValue.iv))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdata := append(encryptedValue.data, encryptedValue.tag...)\n\tdecryptedBytes, err := gcm.Open(nil, encryptedValue.iv, data, []byte(additionalData))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Could not decrypt with AES_GCM: %s\", err)\n\t}\n\tdecryptedValue := string(decryptedBytes)\n\tswitch encryptedValue.datatype {\n\tcase \"str\":\n\t\tplaintext = decryptedValue\n\tcase \"int\":\n\t\tplaintext, err = strconv.Atoi(decryptedValue)\n\tcase \"float\":\n\t\tplaintext, err = strconv.ParseFloat(decryptedValue, 64)\n\tcase \"bytes\":\n\t\tplaintext = decryptedBytes\n\tcase \"bool\":\n\t\tplaintext, err = strconv.ParseBool(decryptedValue)\n\tcase \"time\":\n\t\tvar value time.Time\n\t\terr = value.UnmarshalText(decryptedBytes)\n\t\tplaintext = value\n\tcase \"comment\":","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/getsops/sops/blob/13442bb98183887d7a9ac09ec8ab0564673a59d8/aes/cipher.go#L82-L118","documentation":"Error \"Could not decrypt with AES_GCM: %s\" thrown in getsops/sops.","triggerScenarios":"Thrown at aes/cipher.go:100 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"13442bb98183887d7a9ac09ec8ab0564673a59d8","analyzedAt":"2026-09-01T03:53:00.447Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}