Cryptography and Tokens
"Three may keep a secret, if two of them are dead."– Benjamin Franklin, Poor Richard's Almanack
In this short chapter, we are going to give you a brief overview of the cryptographic services offered by the Python standard library. We are also going to touch upon JSON Web Tokens, an interesting standard for representing claims securely between two parties.
In particular, we are going to explore the following:
- Hashlib
- HMAC
- Secrets
- JSON Web Tokens with PyJWT, which seems to be the most popular Python library for dealing with JWTs
Let's start by taking a moment to talk about cryptography and why it is so important.