Skip to content

Commit

Permalink
Be canonical with Base64url
Browse files Browse the repository at this point in the history
  • Loading branch information
paragonie-security committed Jun 10, 2022
1 parent 3e80a12 commit 08be722
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/01-Protocol-Versions/Common.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ without `=` padding.
This is implemented in our [constant-time RFC 4648 library](https://github.com/paragonie/constant_time_encoding)
as `Base64UrlSafe::encodeUnpadded()`.

### Base64 Decoding

When decoding a base64url-encoded segment of a PASETO token, implementations
**MUST** be strict about the padding:

* Padding with `=` characters is *forbidden*.
* If there are trailing bits (2 or 4) due to the length of the segment, all trailing
**MUST** be cleared, or the message is rejected.

## Authentication Padding

Multi-part messages (e.g. header, content, footer) are encoded
Expand Down

0 comments on commit 08be722

Please sign in to comment.