Free online tools to generate, calculate, convert, format, transform, and de/en-code.
 

Fernet Encryption

Symmetric encryption with authentication using the Fernet specification. Compatible with Python's cryptography library for secure data encryption.


Generate Fernet Key

Generate a 32-byte (256-bit) URL-safe base64-encoded key for Fernet encryption.

Operation

Encrypt Data


About Fernet

Fernet is a symmetric encryption specification that provides both confidentiality and authenticity guarantees. It uses AES-128-CBC for encryption and HMAC-SHA256 for authentication, with built-in timestamp support.

Features

  • Authenticated: HMAC prevents tampering
  • Timestamped: Optional token expiration (TTL)
  • Symmetric: Same key for encrypt/decrypt
  • URL-Safe: Base64url encoding

Use Cases

  • API Tokens: Time-limited authentication tokens
  • Session Data: Secure session storage
  • File Encryption: Encrypt files and documents
  • Database Fields: Encrypt sensitive DB columns
Token Format: Fernet tokens consist of Version (1 byte) | Timestamp (8 bytes) | IV (16 bytes) | Ciphertext (variable) | HMAC (32 bytes), all base64url-encoded.
Python Compatibility: This implementation is compatible with Python's cryptography.fernet module. You can encrypt here and decrypt in Python, or vice versa.

Feedback

Help us improve this page by providing feedback:


Share with