des3-wrap encrypt & decrypt online

Legacy

Encrypt or decrypt text with des3-wrap and a secret. Nothing leaves your browser.

Padded with zero bytes or cut to 24 bytes.
Runs in your browser

PHP's openssl_encrypt gives no result for key wrap modes, so the old site showed an empty field. This tool calculates the result like OpenSSL 3 does.

What the tool did

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
846f3de816c800a77853f0256eb67af8
32f1ff9dcbfa279e276639a871ae73f6
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

In short

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.

LegacyTriple DES (3DES, TDEA): Not broken in everyday use, but outdated. Use it to match old systems, not for new ones.

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.

Where you meet Triple DES
  • Payment cards and terminals (EMV)
  • Older VPN, SSH and TLS connections
  • Legacy enterprise and banking systems
Honest answer

Is it safe to use?

The cipher: legacy

Triple DES. Not broken in everyday use, but outdated. Use it to match old systems, not for new ones.

This setup: for compatibility

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?

Triple DES Key Wrap (RFC 3217)

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.

Common mistakes

Why your des3-wrap result doesn't match

A different result every time

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.

You hashed the secret first

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.

Hex instead of Base64

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.

Two secrets, same result

DES ignores the lowest bit of every key byte. Secrets that differ only there, such as a and ` (0x61 and 0x60), give identical results.

Same result as single DES

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.

Spaces and line breaks

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.

Your secret is longer than the key

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.

Which cipher was it?

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.

Nothing is sent anywhere. Wrong secrets give no readable text.
Compare

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.

CipherResult (Base64)Same as
des Legacy0bA3hT4PqaA6P4grYRvzUBUAGvpdcwiTCXJTZlMO1+yv2OEYGhgYmE4+DlE3oGJLdes-cbc
des-cbc Legacy0bA3hT4PqaA6P4grYRvzUBUAGvpdcwiTCXJTZlMO1+yv2OEYGhgYmE4+DlE3oGJLdes
des-cfb Legacy02Hv2U2qFHmk1YsGGuzyjbaEGYxerKIHMbyX+fDkXEjt3j/QeCcjB2AFzQ==
des-cfb1 Legacyxji1RZATdSX7BBIU+v0mKIdnN4gC0wIQlbrjgnbVDSlQTpWy+HM/U/Af7w==
des-cfb8 Legacy0zQRFiLI4IpoX3zhdxKoP1eOiGFjXyMl8M7XrqDRNqK5cDv9nyiZj08bsg==
des-ecb Legacy0bA3hT4PqaBGCTN+NK8kz6arEwlsenPMuftXeVy706LosWwgGNS/kAV39nzVgegs
des-ede LegacyVQAgAnCgtiTPsdxTJ6HFdLP0N7BqwPngn6rvJ26LipRlVJEqW+BoMeqmW6buZpdmdes-ede-ecb
des-ede-cbc LegacyVQAgAnCgtiQzlY21xKZdjPmLpLIRLR+NBtr8noYcRo4YHOZ3JvH+qsX5linqoR6M
des-ede-cfb LegacyarrxSsoIGF9JBiphmNZbdpVkVcXVmRlYKVHUIEF3A4KNYcxtupVf8IxAJw==
des-ede-ecb LegacyVQAgAnCgtiTPsdxTJ6HFdLP0N7BqwPngn6rvJ26LipRlVJEqW+BoMeqmW6buZpdmdes-ede
des-ede-ofb LegacyarrxSsoIGF9G9FnyO+6bgMQ9K0BQfn+xQ7bkCGh9igmU4kb3GHGDLTting==
des-ede3 LegacyWmVOV7KruhMo6OpASvcZz/SJTz4kbwgMaqYmUiKaPjOiOfE8YxysuP5gu0PUGvCYdes-ede3-ecb
des-ede3-cbc LegacyWmVOV7KruhOCm6HCT/9l8EejwpsvM/D2BjGsQB53EUCdyIiabE03/wGUkzjbJBPRdes3
des-ede3-cfb LegacyGyevnv0MdXSu2Z7GMEliPovFDV3FR3wbdd16B20q8AiP2jDwxtZL7dbgTw==
des-ede3-cfb1 LegacyV0b4gFcFbO+mMnZLTEwYAicPGcFdW8l16fjwjKiGmFFXoLpdlXOUJzkHaw==
des-ede3-cfb8 LegacyG/GpkCVSSBHihawied5fcV1jW05WwgtRZ1xaA0Env5OeC24hAkhCsjT+pQ==
des-ede3-ecb LegacyWmVOV7KruhMo6OpASvcZz/SJTz4kbwgMaqYmUiKaPjOiOfE8YxysuP5gu0PUGvCYdes-ede3
des-ede3-ofb LegacyGyevnv0MdXSuY5+gbTgo54KoOmCaKYqiytdUNhx+FLtZGzTdD66v15Qihg==
des-ofb Legacy02Hv2U2qFHmJWYhQyinFdiE6oI9dZjxmC3CZiJqx/NaMtHHrGCSl+WPg2A==
des3 LegacyWmVOV7KruhOCm6HCT/9l8EejwpsvM/D2BjGsQB53EUCdyIiabE03/wGUkzjbJBPRdes-ede3-cbc
des3-wrap Legacydifferent every time (random IV)
desx LegacynskG7SWseL+R4S+F5ZfWi36BUvVqJn4qFQpzjlrXkQ+e4WMfUL2tvxntpHuJ7Uu/desx-cbc
desx-cbc LegacynskG7SWseL+R4S+F5ZfWi36BUvVqJn4qFQpzjlrXkQ+e4WMfUL2tvxntpHuJ7Uu/desx
id-smime-alg-cms3deswrap Legacydifferent every time (random IV)
Test values

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.

Textdes3-wrap (Base64)
empty stringdifferent every time (random IV)
adifferent every time (random IV)
hello worlddifferent every time (random IV)
0123456789abcdefdifferent every time (random IV)
The quick brown fox jumps over the lazy dogdifferent every time (random IV)
FAQ

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.

Good to know

Before you rely on it

Searches the list of pages on this site. What you type stays in your browser.