Decrypt Encrypted Private Keys Offline Using Your Passphrase
Passphrase-protected PEM private keys are standard across PHP (Laravel Passport, Symfony LexikJWT, openssl_pkey_export), Nginx, Apache, Node.js, and cloud API integrations. When debugging authentication errors such as EVP_DecryptFinal_ex:bad decrypt, verifying whether a passphrase matches a key file, or converting a locked private key into an unencrypted PKCS#8 PEM or JWK, you shouldn't have to install OpenSSL CLI or risk uploading your secret key to an untrusted server. Bramhify's Private Key Decryptor unlocks your key 100% locally in your browser using the native Web Crypto API.
Supported Encrypted Private Key Formats
BEGIN ENCRYPTED PRIVATE KEY): Modern RFC 5958 PBES2 containers using PBKDF2 (SHA-1, SHA-256, SHA-384, or SHA-512) with AES-128-CBC, AES-256-CBC, AES-128-GCM, or AES-256-GCM.Proc-Type: 4,ENCRYPTED): Traditional PKCS#1 RSA (BEGIN RSA PRIVATE KEY) and SEC1 EC (BEGIN EC PRIVATE KEY) keys encrypted with AES-128-CBC or AES-256-CBC via EVP_BytesToKey — commonly generated by PHP OpenSSL and older tutorials.BEGIN PUBLIC KEY), computes its SHA-256 fingerprint, and converts the private key to JWK for immediate use in JWT libraries.Encrypt (Re-Lock) Unencrypted Keys with a New Passphrase
Need to protect a plaintext PKCS#8, PKCS#1 RSA, or SEC1 EC private key before storing it in CI/CD secrets or a PHP project? Switch to Encrypt Key (Lock) mode, paste your unencrypted private key, enter a strong passphrase, and export an OpenSSL-compatible BEGIN ENCRYPTED PRIVATE KEY block protected with PBKDF2-SHA256 (100,000 iterations) and AES-256-CBC.
Security Guarantee & Known Limitations
All ASN.1 DER parsing, key derivation, and AES decryption run inside your browser's volatile RAM — zero network calls, zero localStorage, and an instant Wipe Memory button. Limitations: OpenSSH private keys (BEGIN OPENSSH PRIVATE KEY) rely on bcrypt-pbkdf, and obsolete 3DES/DES-CBC keys use deprecated ciphers not exposed by browser Web Crypto; convert those locally with ssh-keygen or openssl pkcs8 first. Need a brand-new key pair? Try our Public & Private Key Pair Generator or inspect tokens in our JWT & SD-JWT Decoder.
Frequently Asked Questions
Why does PHP or OpenSSL throw EVP_DecryptFinal_ex:bad decrypt? That error almost always means the passphrase in your .env file does not match the encrypted PEM key (often caused by trailing spaces, unescaped $ characters, or quoting issues). Paste your PEM key and passphrase here to test decryption instantly offline, and compare the derived SHA-256 public key fingerprint against your certificate or JWKS endpoint.
