

The encryption technique aims at making data unreadable and hard to decode. However, the purpose of encryption is different from the encoding's one.

For this reason, sometimes, people use the terms encryption and encoding interchangeably. It transforms data from one representation to another. In a way, encryption is a form of encoding. In fact, the question is not far-fetched. Wait! Isn't this transformation the same as encoding after all? 🤔 So, basically, encryption is a mechanism that transforms data into a different representation so that prying eyes cannot understand it. You can transform a piece of data from one representation to another and then go back to the original representation without information loss.Įncryption is a technique that makes your data unreadable and hard to decode for an unauthorized user. On the contrary, it is public in order to facilitate interoperability between systems.įinally, encoding is a reversible process. The conversion algorithm is not kept secret. Anyone who knows the conversion algorithm can encode and decode data. It allows systems that use different data representations to share information.Įncoding has no security purpose.
#Purpose of base64 encoding download
If you want to learn more about JWTs, you can download the JWT Handbook.Įncoding ensures interoperability between systems. This encoding mechanism allows the token to be easily passed in HTML and HTTP environments without fear of clashes with reserved or unrepresentable characters. You can see the decoded version of this JWT using the jwt.io debugger. bql -jxlG9B_bielkqOnjTY9Di9FillFb6IMQINXoYsw eyJpc3MiOiJodHRwOi8vbXktZG9tYWluLmF1dGgwLmNvbSIsInN1YiI6ImF1dGgwfDEyMzQ1NiIsImF1ZCI6IjEyMzRhYmNkZWYiLCJleHAiOjEzMTEyODE5NzAsImlhdCI6MTMxMTI4MDk3MCwibmFtZSI6IkphbmUgRG9lIiwiZ2l2ZW5fbmFtZSI6IkphbmUiLCJmYW1pbHlfbmFtZSI6IkRvZSJ9. The following is an example of encoded JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.

The three parts that compose a token are encoded using Base64-URL, a variant of Base64 encoding combined with URL encoding.

