{"record":{"id":"2905cd5e3a8cf9e9","repo":"getsops/sops","slug":"error-base64-decoding-data-s","errorCode":null,"errorMessage":"Error base64-decoding data: %s","messagePattern":"Error base64-decoding data: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"aes/cipher.go","lineNumber":64,"sourceCode":"}\n\n// NewCipher is the constructor for a new Cipher object\nfunc NewCipher() Cipher {\n\treturn Cipher{\n\t\tstash: make(map[stashKey][]byte),\n\t}\n}\n\nvar encre = regexp.MustCompile(`^ENC\\[AES256_GCM,data:(.+),iv:(.+),tag:(.+),type:(.+)\\]`)\n\nfunc parse(value string) (*encryptedValue, error) {\n\tmatches := encre.FindStringSubmatch(value)\n\tif matches == nil {\n\t\treturn nil, fmt.Errorf(\"Input string %s does not match sops' data format\", value)\n\t}\n\tdata, err := base64.StdEncoding.DecodeString(matches[1])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Error base64-decoding data: %s\", err)\n\t}\n\tiv, err := base64.StdEncoding.DecodeString(matches[2])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Error base64-decoding iv: %s\", err)\n\t}\n\ttag, err := base64.StdEncoding.DecodeString(matches[3])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Error base64-decoding tag: %s\", err)\n\t}\n\tdatatype := string(matches[4])\n\n\treturn &encryptedValue{data, iv, tag, datatype}, nil\n}\n\n// Decrypt takes a sops-format value string and a key and returns the decrypted value and a stash value\nfunc (c Cipher) Decrypt(ciphertext string, key []byte, additionalData string) (plaintext interface{}, err error) {\n\tif isEmpty(ciphertext) {\n\t\treturn \"\", nil","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/getsops/sops/blob/13442bb98183887d7a9ac09ec8ab0564673a59d8/aes/cipher.go#L46-L82","documentation":"Error \"Error base64-decoding data: %s\" thrown in getsops/sops.","triggerScenarios":"Thrown at aes/cipher.go:64 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-08T15:18:49.778Z"}