Browse by Topic

Popular

Latest

Latest Python Posts

A digital lock with a clock and a warning triangle, representing expired and invalid JWT token handling in Python.
Python

Handling Expired and Invalid Tokens with PyJWT in Python

Learn how to handle expired and invalid JWT tokens with PyJWT: catch ExpiredSignatureError, distinguish invalid tokens, and validate tokens safely in Python.

PyJWTJWT validationtoken expirationerror handling
Illustration of JWT token authentication flow in FastAPI with PyJWT, showing token generation and validation.
Python

Python PyJWT FastAPI Authentication: Secure Token Handling

python pyjwt fastapi authentication: Implement JWT authentication in FastAPI using PyJWT: token creation, validation, dependencies, security, and common pitfalls.

JWTFastAPIPyJWTAuthentication
A stylized illustration of a lock and key representing RSA public and private keys used to sign and verify JWT tokens in Python.
Python

Using PyJWT to Sign and Verify RSA Tokens in Python

How to create and verify RS256-signed JWT tokens with PyJWT in Python, including RSA key generation, error handling, and key security.

PyJWTJWTRSARS256
Illustration of a JWT token with an expiration clock and custom claims fields, representing PyJWT handling in Python.
Python

Python PyJWT Expiration and Custom Claims

Learn how to set and verify expiration and custom claims with PyJWT in Python, including error handling, leeway, and security considerations.

PyJWTJWTToken ExpirationCustom Claims
A visual metaphor of a JWT token being encoded and decoded with a padlock, representing signature verification in Python.
Python

Python PyJWT: Encode, Decode, and Verify JWT Tokens

Learn how to encode, decode, and verify JWT tokens with PyJWT in Python. Covers signature verification, expiration, algorithm selection, and custom claim validation.

PyJWTJWTAuthenticationToken Verification
Illustration of a password being hashed with bcrypt, showing a salt being added and a secure hash output.
Python

How to Use bcrypt for Password Hashing and Authentication in Python

Learn how bcrypt generates and stores salt, hashes passwords in Python, verifies login attempts with checkpw(), and how to choose a cost factor.

bcryptpassword hashingauthenticationsecurity
A padlock and a Python code snippet illustrating bcrypt password hashing and verification.
Python

Python bcrypt Password Hashing and Verification

Learn how to hash and verify passwords with Python bcrypt, including byte encoding, salts, cost factors, and common pitfalls.

bcryptpassword hashingauthenticationPython security
A visual metaphor showing a padlock and a certificate chain, representing Python cryptography for certificates and hashes.
Python

Python Cryptography: Certificates and Hashes

Learn how to hash data with hashlib, load and inspect X.509 certificates, verify certificate chains, and use certificate keys to sign and verify messages in Python.

cryptographycertificateshashingx509
Illustration of a Python code block converting a key object into a PEM file with a lock icon representing encryption.
Python

Python Cryptography PEM Key Serialization

Learn how to load, serialize, and save PEM keys with Python's cryptography library, including password-protected private keys and format choices.

cryptographyPEMkey serializationPython
Illustration of a digital signature verification process in Python, showing a key pair and a signed message.
Python

Python Cryptography: Sign and Verify Digital Signatures

Generate RSA and ECDSA keys, sign messages, and verify signatures in Python with the cryptography library. Includes common signing and verification pitfalls.

cryptographydigital-signaturesrsaecdsa