Guide

THE TOOLBOX / CRYPTOGRAPHY & SECURITY

Sign HMACs, encrypt AES-GCM,
and generate PEM keypairs.

Run native W3C Web Crypto API (crypto.subtle) operations entirely in your browser memory without exposing keys, secrets, or plaintexts over the network.

Ready. All cryptographic operations execute locally via window.crypto.subtle.

Webhook Presets
1. Input & Parameterscrypto.subtle
2. Cryptographic OutputHMAC-SHA-256

THE DETAILS

W3C Web Crypto API, RFC 2104 HMACs, and NIST SP 800-38D AES-256-GCM.

1. Step-by-Step Workflow

Choose between HMAC Signer (live Hex and Base64 digests for SHA-256, SHA-384, and SHA-512), AES-256-GCM (authenticated encryption and decryption using PBKDF2-derived keys), and Keypair Generator (exporting SPKI Public PEM and PKCS#8 Private PEM keys).

2. RFC 2104 Keyed-Hash Message Authentication

Unlike a plain SHA-256 digest, an HMAC (RFC 2104) mixes a secret key into two passes of the hash function (H((K' ^ opad) || H((K' ^ ipad) || m))), making it immune to length-extension attacks and ideal for authenticating webhook payloads and API requests.

3. AES-256-GCM Envelope Format

Each encryption call generates a fresh 16-byte random salt and 12-byte (96-bit) IV via crypto.getRandomValues, derives a 256-bit key with 100,000 PBKDF2-SHA256 iterations, and outputs a self-contained JSON envelope ready for round-trip decryption.

4. Zero-Knowledge Privacy & Related Tools

Cryptographic keys and passphrases are never persisted to localStorage or sent over the network. Need unkeyed SHA-256/MD5 checksums, X.509 certificate inspection, or JWT claim decoding? Try the UUID & hash generator, X.509 certificate decoder, and JWT decoder.

Cryptographic Primitive & OpenSSL CLI Matrix

OperationSpecification / StandardOpenSSL CLI Equivalent
HMAC-SHA256IETF RFC 2104 / FIPS 198-1printf "%s" "msg" | openssl dgst -sha256 -hmac "key"
AES-256-GCM + PBKDF2NIST SP 800-38D & RFC 8018openssl enc -aes-256-gcm -pbkdf2 -iter 100000
ECDSA P-256 KeypairFIPS 186-5 / RFC 5208 PKCS#8openssl ecparam -name prime256v1 -genkey -noout
RSA-2048 KeypairRFC 8017 (PKCS#1 v2.2 OAEP)openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048

Common Cryptography Pitfalls & Best Practices

Never Reuse an AES-GCM IV / Nonce

Encrypting two different messages with the same key and 12-byte IV in AES-GCM catastrophically leaks the XOR of the plaintexts and the authentication key GHASH. Always generate a fresh random IV per encryption.

Raw Body Bytes in Webhook HMAC Verification

Webhook providers sign the exact raw UTF-8 request body. Parsing and re-serializing JSON before computing the HMAC changes whitespace and breaks signature verification.

Constant-Time Signature Comparison

In backend code, compare computed HMAC digests using crypto.timingSafeEqual() rather than === to prevent byte-by-byte timing side-channel attacks.

PKCS#8 vs. Traditional PKCS#1 PEM Headers

Web Crypto exports private keys in modern algorithm-agnostic PKCS#8 format (-----BEGIN PRIVATE KEY-----) and public keys in SPKI format (-----BEGIN PUBLIC KEY-----).

Frequently Asked Questions

Are generated private keys or passphrases ever transmitted over the network?

No. All HMAC signing, PBKDF2 key derivation, AES-256-GCM encryption/decryption, and asymmetric ECDSA/RSA keypair generation execute 100% locally via your browser’s hardware-accelerated window.crypto.subtle API.

How does AES-256-GCM authenticated encryption protect against tampering?

Defined in NIST SP 800-38D, AES-GCM (Galois/Counter Mode) is an Authenticated Encryption with Associated Data (AEAD) cipher. It appends a 128-bit authentication tag to the ciphertext; if a single bit of the ciphertext, IV, or passphrase is altered, crypto.subtle.decrypt throws an authentication error instead of returning corrupted plaintext.

Why does PBKDF2 use 100,000 SHA-256 iterations and a random 16-byte salt?

Human passphrases lack the entropy of a random 256-bit key. A fresh 16-byte salt from crypto.getRandomValues prevents rainbow-table attacks, and 100,000 PBKDF2-SHA256 iterations (RFC 8018) slow down brute-force guessing.

How do I verify a webhook HMAC-SHA256 signature?

In the HMAC Signer tab, paste the exact raw HTTP request body into Message, enter your webhook signing secret (such as whsec_...), and select HMAC-SHA256. Compare the resulting Hex or Base64 digest against the X-Hub-Signature-256 or Stripe-Signature header.

Should I choose ECDSA P-256 or RSA-2048 when generating a new keypair?

ECDSA P-256 (prime256v1 / secp256r1) produces much smaller keys and faster signatures with security equivalent to 3072-bit RSA, making it the modern default for JWT ES256 and TLS. Choose RSA-OAEP 2048 when integrating with legacy systems that require RSA public-key encryption.