diff --git a/internal/encrypt/encrypt.go b/internal/encrypt/encrypt.go index f9b5ad9..6a312ca 100644 --- a/internal/encrypt/encrypt.go +++ b/internal/encrypt/encrypt.go @@ -112,7 +112,7 @@ func (e *Encrypter) Encrypt(reader io.Reader, filename string) error { e.Logger.Print("No parts provided. Only the master-key will be generated.") } - e.Logger.Debug("Generated master-key:", base64.StdEncoding.EncodeToString(masterKey)) + e.Logger.Debug("Generated master-key:", base64.RawURLEncoding.EncodeToString(masterKey)) err = e.encryptAndSaveMessage(masterKey, reader, filename) if err != nil { diff --git a/pkg/file/file.go b/pkg/file/file.go index e0afd79..87f8290 100644 --- a/pkg/file/file.go +++ b/pkg/file/file.go @@ -43,7 +43,7 @@ func WriteChecksum(logger log.Logger, content []byte, filename string) error { } func WriteKey(logger log.Logger, key []byte, filename string) error { - base64EncodedKey := base64.StdEncoding.EncodeToString(key) + base64EncodedKey := base64.RawURLEncoding.EncodeToString(key) return WriteFile(logger, []byte(base64EncodedKey), filename+".key") } @@ -92,7 +92,7 @@ func ReadKey(filename string) ([]byte, error) { return nil, errors.Wrapf(err, "failed reading key file '%s'", filename) } - decodedKey, err := base64.StdEncoding.DecodeString(string(encodedKey)) + decodedKey, err := base64.RawURLEncoding.DecodeString(string(encodedKey)) if err != nil { return nil, errors.Wrapf(err, "failed decoding file '%s' from base64", filename) } diff --git a/pkg/stego/shamir.go b/pkg/stego/shamir.go index 1ac33fa..7f7f209 100644 --- a/pkg/stego/shamir.go +++ b/pkg/stego/shamir.go @@ -49,7 +49,7 @@ func (p Part) Bytes() []byte { } func (p Part) Base64() string { - return base64.StdEncoding.EncodeToString(p.Bytes()) + return base64.RawURLEncoding.EncodeToString(p.Bytes()) } func Split(secret []byte, parts, threshold uint8) ([]Part, error) {