Crypto & Hashing

AES Encrypt / Decrypt

Encrypt and decrypt with AES-GCM or AES-CBC using a password or raw key.

  • Nothing savedInput and output stay in memory and are gone when you leave this page.
  • Runs in your browserProcessing happens in this page. No application server receives your input.
More options

Key

Nothing on this page is saved. Closing or reloading the tab discards it permanently.

Plaintext

Ciphertext

What this tool does

AES Encrypt / Decrypt (T24) encrypts and decrypts text in your browser using Web Crypto (crypto.subtle) with AES-GCM (authenticated encryption with a fresh 12-byte IV) or AES-CBC (unauthenticated block chaining with a fresh 16-byte IV). Keys can be derived from a password via PBKDF2-HMAC-SHA256 (600,000 iterations in hash.worker.ts) or entered directly as raw 128-, 192-, or 256-bit hexadecimal.

Nothing on this page is saved. Closing or reloading the tab discards it permanently.

Envelope format and modes

By default, output is a self-describing 5-field URL-safe Base64 envelope so every encryption carries its own fresh random salt and IV (FR-CRY-8):

DevStash-AES-1.<mode>.<base64url salt>.<base64url iv>.<base64url ciphertext>

ModeIVAuthentication
AES-GCM12 bytes (24 hex chars), fresh per operationBuilt in. A modified ciphertext fails to decrypt.
AES-CBC16 bytes (32 hex chars), fresh per operationNone. AES-CBC does not authenticate. A modified ciphertext decrypts without any error, producing plaintext an attacker chose. Use AES-GCM unless something else requires CBC.

Supported formats and options

  • Key source: Password (derives a 32-byte key with a fresh 16-byte random salt using 600,000 iterations of PBKDF2-HMAC-SHA256) or Raw hex (accepts 32, 48, or 64 hex characters for AES-128, AES-192, or AES-256).
  • Output format: Envelope (recommended; bundles mode, salt, IV, and ciphertext) or Raw ciphertext + IV (emits standard Base64 ciphertext and hexadecimal IV separately for interoperating with external tools).

Examples and reference vector

Encrypting hello with password pw under AES-GCM produces:

DevStash-AES-1.gcm.<base64 salt>.<base64 iv>.<base64 ciphertext>

Running the encryption a second time with the same plaintext and password produces a different envelope string because both the 16-byte PBKDF2 salt and the 12-byte GCM IV are drawn fresh from randomBytes.

Limits and non-goals

32 MB. No streaming, so no whole-disk or large-archive encryption. The envelope format is this tool's own and no other software reads it; raw mode exists for that case. No key wrapping, no RSA-OAEP hybrid encryption, no PGP.

  • Error reference:
    • This tool needs the Web Crypto API, which browsers expose only over HTTPS or on localhost. This page is served over plain HTTP, so the operation cannot run here.
    • Decryption failed. The password is wrong, the ciphertext was modified, or it was not produced by this tool.
    • That is not a DevStash AES envelope. Switch to raw mode and supply the IV separately.
    • A raw key must be 32, 48, or 64 hex characters โ€” 128, 192, or 256 bits. This one has 10.
    • The IV must be 24 hex characters for AES-GCM.
    • Input is larger than 32 MB. Web Crypto has no streaming AES, so this tool cannot encrypt a file that size.

Related tools

Scope: this covers the page itself. Your browser, operating system, clipboard, downloads, extensions, and crash recovery may keep copies, and a compromised site origin would not be protected.