Recommend this page to a friend! |
Classes of Scott Arciszewski | PHP PASeTo | docs/README.md | Download |
|
DownloadImplementation DetailsPaseto Message Format:Without the Optional Footer
With the Optional Footer
The The
Any optional data can be appended to the end. This information is NOT encrypted, but it is used in calculating the authentication tag for the payload. It's always base64url-encoded. * For local tokens, it's included in the associated data alongside the nonce. * For public tokens, it's appended to the message during the actual authentication/signing step, in accordance to our standard format. Thus, if you want unencrypted, but authenticated, tokens, you can simply set your payload to an empty string and your footer to the message you want to authenticate. Conversely, if you want to support key rotation, you can use the unencrypted footer to store the Key-ID. Versions and their Respective PurposesSee Protocol Versions for specifics. How to use the Reference ImplementationSee the PHP library documentation. What are Paseto's design goals?1. Resistance to Implementation Error / MisuseWhile it will be possible for motivated developers to discover novel ways to make any tool insecure, Paseto attempts to make it easier to develop secure implementations than to develop insecure implementations of the standard. To accomplish this goal, we cast aside runtime protocol negotiation and so-called "algorithm agility" in favor of pre-negotiated protocols with version identifiers. For 2. UsabilityDevelopers who are already familiar with JSON Web Tokens (JWT) should be able to, intuitively, use Paseto in their software with minimal friction. Additionally, developers who are not already familiar with JWT should be able to pick up Paseto and use it successfully without introducing security flaws into their application. Was "Stateless Session Tokens" one of Paseto's Design Goals?No, neither Paseto nor JWT were designed for stateless session management, which is largely an anti-pattern. There is no built-in mechanism to defeat replay attacks within the validity window, should a token become compromised, without server-side persistent data storage. Therefore, neither PASETO nor JWT should be used in any attempt to obviate the need for server-side persistent data storage. What Should We Use PASETO For?Some example use-cases:
|