Why Platform-Agnostic Security Tokens (PASETO) Are Gaining Traction Over JSON Web Tokens (JWT)

Why Platform-Agnostic Security Tokens (PASETO) Are Gaining Traction Over JSON Web Tokens (JWT)

Tokens are necessary in the realm of web security for secure data exchange and authentication. JSON Web Tokens (JWT) and Platform-Agnostic Security Tokens (PASETO) are popular token types. They each have different characteristics and security postures, even though their functions are comparable. This article explores the differences between JWT and PASETO in an overview and ushers in an argument for selecting PASETO over JWT.

Recently, I decided to explore deeper technical experimentation with JWT and PASETO, and in one of my upcoming videos, I will be showing how best to utilize PASETO using the Go programming language.?

For those wondering what JWT and PASETO are, when you usually log into certain applications from your phone, there are traditionally some generated tokens assigned to you, that enable the sharing of data from the server to your device. It also ensures that no one else can get any information that is peculiar to you.

JSON Web Tokens (JWT)

For the purpose of transferring claims between two parties, JSON Web Tokens (JWT) are a small, secure URL. To enable digital signing, integrity protection with a Message Authentication Code (MAC), and/or encryption, the claims in a JSON Web Token (JWT) are encoded as a JSON object that is used as the payload of a JSON Web Signature (JWS) structure or as the plaintext of a JSON Web Encryption (JWE) structure.

I won't want to dwell much on the three components of a standard JWT, which are headers, payloads, and signatures, but rather on the strengths and supposed weaknesses of JWT.?

Strengths

  1. There is less server requirement because all relevant data is encoded in the token itself, which makes it stateless.
  2. It is widely used and adopted by tonnes of engineers globally.
  3. It can be used to exchange information, handle authentication, etc, which makes it very versatile.?

Weaknesses?

  1. JWT's adaptability may present security risks. Vulnerabilities may be introduced via incorrect setup or implementation, particularly when it comes to algorithm selection.
  2. When a lot of payload data is included, JWTs can get big, which could affect how well some apps work.
  3. A token cannot be simply canceled without the need for extra procedures once it has been issued. Managing the need to invalidate a token before it expires (for example, if a user logs out or a token is compromised) can be challenging and may pose security problems if a compromised token is left active.

Platform-Agnostic Security Tokens (PASETO)

JWTs have a secure substitute in the form of Platform-Agnostic Security Tokens (PASETO). With its default implementation of secure practices, PASETO seeks to offer the same functionality as JWT while steering clear of frequent issues.

Like JWT, PASETO also consists of three parts; the version, the purpose (either local or public, for symmetric encryption and public key signatures, respectively), and the payload, which usually has the data or claims.

Strengths

  1. PASTEO enforces security by design with its unique algorithm choices.
  2. PASTEO minimizes the likelihood of introducing security flaws.
  3. Compared to JWTs, which can vary greatly in size based on the payload, PASETO tokens are more consistently sized.

Weakness

  1. Compared to JWT, PASETO is more recent and less extensively used, which means there are few fallback options for help and community. Finding information, resolving problems, and integrating with other systems that are frequently created with JWT in mind may become more difficult as a result.
  2. PASETO's strict security measures are a plus, but in some use situations where greater flexibility is needed, they can potentially be a drawback.

I will choose to use PASETO in my development because it drastically lowers the possibility of implementation mistakes by imposing safe defaults. Nevertheless, the decision between JWT and PASETO? should be influenced by the particular requirements of your application and the level of technological expertise, knowledge, and resources within your team.

要查看或添加评论,请登录

社区洞察

其他会员也浏览了