From b142e0fd0111f803fab16a9f514e5ae95aae26de Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Thu, 26 Dec 2019 15:37:35 +0100 Subject: [PATCH] internal/format: switch to 64 columns of standard Base64 Now that we don't use Base64 in keys, let's just go back to the standard alphabet. Still in the spirit of reducing weirdness, use the PEM column count, so we can also reuse the lineWriter for the PEM armor. See https://groups.google.com/d/msg/age-dev/UAjkvLoCr9I/l4Q1h3OPAgAJ. --- internal/format/format.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/format/format.go b/internal/format/format.go index f8ac3e9..101a366 100644 --- a/internal/format/format.go +++ b/internal/format/format.go @@ -29,7 +29,7 @@ type Recipient struct { Body []byte } -var b64 = base64.RawURLEncoding.Strict() +var b64 = base64.RawStdEncoding.Strict() func DecodeString(s string) ([]byte, error) { // CR and LF are ignored by DecodeString, but we don't want any malleability. @@ -41,7 +41,7 @@ func DecodeString(s string) ([]byte, error) { var EncodeToString = b64.EncodeToString -const columnsPerLine = 56 +const columnsPerLine = 64 const bytesPerLine = columnsPerLine / 4 * 3 const intro = "This is a file encrypted with age-tool.com, version 1\n"