des3-wrap encrypt & decrypt online
LegacyEncrypt or decrypt text with des3-wrap and a secret. Nothing leaves your browser.
The bytes behind your result
Your code gives a different result? Almost always the key or the IV differ. Here you see exactly which bytes the tool used for the secret and text in the tool above: copy the key and IV in hex into your own code. Shown for the text 0123456789abcdef and the secret my secret until you type above.
- Key · 24 bytes 9 from your secret, 15 zero bytes added
- 6d7920736563726574000000000000000000000000000000
6d7920736563726574000000000000000000000000000000 - Text in UTF-8 16 bytes, no padding needed
- 30313233343536373839616263646566
- Encrypted · 32 bytes
- 846f3de816c800a77853f0256eb67af832f1ff9dcbfa279e276639a871ae73f6
846f3de816c800a77853f0256eb67af832f1ff9dcbfa279e276639a871ae73f6 - As Base64 what the tool shows
hG896BbIAKd4U/AlbrZ6+DLx/53L+ieeJ2Y5qHGuc/Y=
- DES ignores the lowest bit of each key byte (parity bit).
from your inputzero bytesciphertext
What is des3-wrap?
Triple DES runs DES three times (encrypt, decrypt, encrypt) to get a longer key. It is slow and its 8-byte blocks are open to the Sweet32 attack (2016) on large amounts of data. NIST no longer allows it for encryption since 2024. PHP's openssl_encrypt returns nothing for key wrap modes, so the old site showed an empty field; this tool calculates the result like OpenSSL 3. Triple DES Key Wrap uses a 192-bit key (48 rounds) in Triple DES Key Wrap (RFC 3217) mode: Triple DES key wrap for S/MIME, with a random IV.
How your secret becomes the key
Triple DES Key Wrap needs exactly 24 bytes (192 bits) of key. The tool takes your secret as UTF-8 bytes and pads it with zero bytes to 24 bytes, or cuts it after 24 bytes. Bytes 1–8, 9–16 and 17–24 are the three DES keys. With a secret of 8 bytes or less, keys 2 and 3 are both zero and cancel out, so the result equals plain DES.
- Payment cards and terminals (EMV)
- Older VPN, SSH and TLS connections
- Legacy enterprise and banking systems
Is it safe to use?
Triple DES. Not broken in everyday use, but outdated. Use it to match old systems, not for new ones.
The setup of this tool is made for compatibility with PHP's openssl_encrypt, not for protecting secrets: the IV is always zero, the secret is used as the key without a key derivation function, and nothing detects changes to the ciphertext.
For real secrets use an authenticated mode such as AES-256-GCM or ChaCha20-Poly1305 with a fresh random nonce for every message, and derive the key from a password with Argon2id, scrypt or PBKDF2. What is a key derivation function?
How Key wrap mode works
Triple DES key wrap (RFC 3217) protects keys in S/MIME. It appends a SHA-1 check value, encrypts with a random IV, reverses the bytes and encrypts again. The input must be a multiple of 8 bytes.
Because of the random IV, the result changes every time you click Encrypt. All results decrypt to the same text.
Why your des3-wrap result doesn't match
Triple DES key wrap uses a random IV, so each click on Encrypt gives a new result. All of them decrypt to the same text; compare by decrypting, not by the ciphertext.
Many tutorials turn a password into a key with SHA-256 or MD5. This tool doesn't: it uses the bytes of your secret directly and pads them with zero bytes. Copy the key in hex from What the tool did and use it as the raw key.
The tool shows the raw ciphertext bytes as Base64. Many libraries return hex or raw bytes. Convert before comparing, or compare with the hex blocks in What the tool did.
DES ignores the lowest bit of every key byte. Secrets that differ only there, such as a and ` (0x61 and 0x60), give identical results.
With a secret of 8 bytes or less, keys 2 and 3 of Triple DES are both zero bytes. Decrypting and encrypting with the same key cancel out, so the result is exactly that of single DES in the same mode. Use a secret of 17 to 24 bytes to get real three-key Triple DES.
Like the old site, the tool trims spaces and line breaks at the start and end of the text and the secret, and sends line breaks as CRLF (\r\n), as a browser form does. echo "text" | in a shell adds a line break at the end.
Only the first bytes up to the key length count, the rest is cut off. Two secrets that start with the same bytes give the same result. Non-ASCII characters take 2–4 bytes in UTF-8, so they fill the key faster.
Encrypted something here years ago?
Paste the Base64 result and the secret. Your browser tries all 174 ciphers of this site and shows those that give readable text. Useful if you don't remember the cipher, or to check whether your ciphertext really is des3-wrap.
Every DES and Triple DES variant, same input
The text The quick brown fox jumps over the lazy dog (43 bytes) with the secret my secret in all 24 DES and Triple DES ciphers. The last column lists names that give the same result: aliases, and modes that agree for this input. Highlighted: the same start as des3-wrap. Watch how CBC and ECB share the first block, and CFB, OFB and CTR the first 8 bytes. Type a text and a secret in the tool above to use yours.
| Cipher | Result (Base64) | Same as |
|---|---|---|
| des Legacy | 0bA3hT4PqaA6P4grYRvzUBUAGvpdcwiTCXJTZlMO1+yv2OEYGhgYmE4+DlE3oGJL | des-cbc |
| des-cbc Legacy | 0bA3hT4PqaA6P4grYRvzUBUAGvpdcwiTCXJTZlMO1+yv2OEYGhgYmE4+DlE3oGJL | des |
| des-cfb Legacy | 02Hv2U2qFHmk1YsGGuzyjbaEGYxerKIHMbyX+fDkXEjt3j/QeCcjB2AFzQ== | |
| des-cfb1 Legacy | xji1RZATdSX7BBIU+v0mKIdnN4gC0wIQlbrjgnbVDSlQTpWy+HM/U/Af7w== | |
| des-cfb8 Legacy | 0zQRFiLI4IpoX3zhdxKoP1eOiGFjXyMl8M7XrqDRNqK5cDv9nyiZj08bsg== | |
| des-ecb Legacy | 0bA3hT4PqaBGCTN+NK8kz6arEwlsenPMuftXeVy706LosWwgGNS/kAV39nzVgegs | |
| des-ede Legacy | VQAgAnCgtiTPsdxTJ6HFdLP0N7BqwPngn6rvJ26LipRlVJEqW+BoMeqmW6buZpdm | des-ede-ecb |
| des-ede-cbc Legacy | VQAgAnCgtiQzlY21xKZdjPmLpLIRLR+NBtr8noYcRo4YHOZ3JvH+qsX5linqoR6M | |
| des-ede-cfb Legacy | arrxSsoIGF9JBiphmNZbdpVkVcXVmRlYKVHUIEF3A4KNYcxtupVf8IxAJw== | |
| des-ede-ecb Legacy | VQAgAnCgtiTPsdxTJ6HFdLP0N7BqwPngn6rvJ26LipRlVJEqW+BoMeqmW6buZpdm | des-ede |
| des-ede-ofb Legacy | arrxSsoIGF9G9FnyO+6bgMQ9K0BQfn+xQ7bkCGh9igmU4kb3GHGDLTting== | |
| des-ede3 Legacy | WmVOV7KruhMo6OpASvcZz/SJTz4kbwgMaqYmUiKaPjOiOfE8YxysuP5gu0PUGvCY | des-ede3-ecb |
| des-ede3-cbc Legacy | WmVOV7KruhOCm6HCT/9l8EejwpsvM/D2BjGsQB53EUCdyIiabE03/wGUkzjbJBPR | des3 |
| des-ede3-cfb Legacy | Gyevnv0MdXSu2Z7GMEliPovFDV3FR3wbdd16B20q8AiP2jDwxtZL7dbgTw== | |
| des-ede3-cfb1 Legacy | V0b4gFcFbO+mMnZLTEwYAicPGcFdW8l16fjwjKiGmFFXoLpdlXOUJzkHaw== | |
| des-ede3-cfb8 Legacy | G/GpkCVSSBHihawied5fcV1jW05WwgtRZ1xaA0Env5OeC24hAkhCsjT+pQ== | |
| des-ede3-ecb Legacy | WmVOV7KruhMo6OpASvcZz/SJTz4kbwgMaqYmUiKaPjOiOfE8YxysuP5gu0PUGvCY | des-ede3 |
| des-ede3-ofb Legacy | Gyevnv0MdXSuY5+gbTgo54KoOmCaKYqiytdUNhx+FLtZGzTdD66v15Qihg== | |
| des-ofb Legacy | 02Hv2U2qFHmJWYhQyinFdiE6oI9dZjxmC3CZiJqx/NaMtHHrGCSl+WPg2A== | |
| des3 Legacy | WmVOV7KruhOCm6HCT/9l8EejwpsvM/D2BjGsQB53EUCdyIiabE03/wGUkzjbJBPR | des-ede3-cbc |
| des3-wrap Legacy | different every time (random IV) | |
| desx Legacy | nskG7SWseL+R4S+F5ZfWi36BUvVqJn4qFQpzjlrXkQ+e4WMfUL2tvxntpHuJ7Uu/ | desx-cbc |
| desx-cbc Legacy | nskG7SWseL+R4S+F5ZfWi36BUvVqJn4qFQpzjlrXkQ+e4WMfUL2tvxntpHuJ7Uu/ | desx |
| id-smime-alg-cms3deswrap Legacy | different every time (random IV) |
des3-wrap test values
Results for common test strings with the secret my secret (UTF-8, no line break, zero IV), exactly as the tool and PHP's openssl_encrypt give them. Use them to check your own implementation.
| Text | des3-wrap (Base64) |
|---|---|
| empty string | different every time (random IV) |
a | different every time (random IV) |
hello world | different every time (random IV) |
0123456789abcdef | different every time (random IV) |
The quick brown fox jumps over the lazy dog | different every time (random IV) |
Questions about des3-wrap
Can des3-wrap be decrypted without the secret?
No. Without the secret there is no shortcut. A short or common secret can be guessed, though, because the tool uses it directly as the key.
Why does my des3-wrap code give a different result?
Almost always because of the key or the IV: the tool pads your secret with zero bytes instead of hashing it and uses a zero IV. Also check Base64 vs hex, padding, and spaces or line breaks the tool trims.
Is Triple DES secure?
Triple DES is outdated. It is not broken in everyday use, but its 8-byte blocks make it unsafe for large amounts of data (Sweet32) and modern ciphers like AES are better. Use it only for compatibility.
How long should my secret be?
Exactly 24 bytes (192 bits) fills the key; anything after that is ignored. For real security a random key is better than a typed word.