des-ede-ofb encrypt & decrypt online
LegacyEncrypt or decrypt text with des-ede-ofb and a secret. Same result as PHP's openssl_encrypt, and 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 hello world and the secret my secret until you type above.
- Key · 16 bytes 9 from your secret, 7 zero bytes added
- 6d792073656372657400000000000000
6d792073656372657400000000000000 - IV · 8 bytes none given, so zero bytes
- 0000000000000000
0000000000000000 - Text in UTF-8 11 bytes, no padding needed
- 68656c6c6f20776f726c64
- Encrypted · 11 bytes
- 56b7f806d45d06535fb85f
56b7f806d45d06535fb85f - As Base64 what the tool shows
Vrf4BtRdBlNfuF8=
- DES ignores the lowest bit of each key byte (parity bit).
from your inputzero bytesciphertext
What is des-ede-ofb?
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. DES-EDE-OFB uses a 128-bit key (48 rounds) in Output Feedback mode: the block cipher makes a keystream from the IV that is XORed with the text.
How your secret becomes the key
DES-EDE-OFB needs exactly 16 bytes (128 bits) of key. The tool takes your secret as UTF-8 bytes and pads it with zero bytes to 16 bytes, or cuts it after 16 bytes. DES-EDE uses the first 8 bytes as key 1 and the next 8 as key 2, then key 1 again (2-key Triple 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 OFB mode works
OFB encrypts the IV, then encrypts that result again, and so on. These 8-byte blocks form a keystream that is XORed with the text. Encrypting and decrypting are the same operation.
No padding: output length = input length. The keystream depends only on key and IV, never on the text. Reusing key and IV, as this tool does, gives the same keystream every time: XOR two ciphertexts and you get the XOR of the two texts.
The same result in your code
Every snippet prints Vrf4BtRdBlNfuF8= for the text hello world and the secret my secret, the same as the tool. The key and IV are written out in hex, so you can see what the tool does with the secret. Your own key and IV are in What the tool did. All snippets are run against PHP before each release.
$key = hex2bin("6d792073656372657400000000000000"); // "my secret" padded with zero bytes to 16 bytes $iv = hex2bin("0000000000000000"); // no IV given: 8 zero bytes echo openssl_encrypt("hello world", "des-ede-ofb", $key, 0, $iv);
Shortest form, same result: openssl_encrypt("hello world", "des-ede-ofb", "my secret"). PHP pads the secret itself but warns about the empty IV.
# pip install cryptography import base64 from cryptography.hazmat.primitives.ciphers import Cipher, modes from cryptography.hazmat.decrepit.ciphers import algorithms key = bytes.fromhex("6d792073656372657400000000000000") # "my secret" padded with zero bytes to 16 bytes iv = bytes(8) # no IV given: 8 zero bytes data = "hello world".encode() enc = Cipher(algorithms.TripleDES(key), modes.OFB(iv)).encryptor() print(base64.b64encode(enc.update(data) + enc.finalize()).decode())
Python has no Triple DES in the standard library; the cryptography package keeps it in its "decrepit" module for old data.
import { createCipheriv } from 'node:crypto'; const key = Buffer.from("6d792073656372657400000000000000", 'hex'); // "my secret" padded with zero bytes to 16 bytes const iv = Buffer.alloc(8); // no IV given: 8 zero bytes const c = createCipheriv("des-ede-ofb", key, iv); console.log(Buffer.concat([c.update("hello world", 'utf8'), c.final()]).toString('base64'));
import javax.crypto.Cipher; import javax.crypto.spec.*; import java.util.Base64; import java.util.HexFormat; public class Encrypt { public static void main(String[] args) throws Exception { byte[] key = HexFormat.of().parseHex("6d7920736563726574000000000000006d79207365637265"); // 2-key Triple DES: key 1, key 2, key 1 byte[] iv = new byte[8]; // no IV given: 8 zero bytes Cipher c = Cipher.getInstance("DESede/OFB/NoPadding"); c.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, "DESede"), new IvParameterSpec(iv)); System.out.println(Base64.getEncoder().encodeToString(c.doFinal("hello world".getBytes("UTF-8")))); } }
Java 17 or newer (HexFormat). Java's PKCS5Padding is the same as PKCS#7.
package main import ( "crypto/cipher" "crypto/des" "encoding/base64" "encoding/hex" "fmt" ) func main() { key, _ := hex.DecodeString("6d7920736563726574000000000000006d79207365637265") // 2-key Triple DES: key 1, key 2, key 1 block, _ := des.NewTripleDESCipher(key) iv := make([]byte, block.BlockSize()) // no IV given: zero bytes data := []byte("hello world") out := make([]byte, len(data)) cipher.NewOFB(block, iv).XORKeyStream(out, data) fmt.Println(base64.StdEncoding.EncodeToString(out)) }
printf '%s' 'hello world' | openssl enc -des-ede-ofb -K 6d792073656372657400000000000000 -iv 0000000000000000 -a -A
printf instead of echo: echo adds a line break, which changes the result. -K and -iv take hex; with -k or -pass, openssl derives a different key from a password.
Why your des-ede-ofb result doesn't match
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.
With a random IV the result changes every time. The tool uses no IV, which in PHP means zero bytes. Use a zero IV of the right length to get the same result, and keep the random IV for real data.
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.
With a zero IV, CFB, OFB and CTR all begin by encrypting the IV, so the first block of output is identical in all three. They only differ from the second block on.
This mode needs no padding: 11 bytes in, 11 bytes out. If your library adds PKCS#7 padding or expects whole blocks, it is configured for CBC or ECB.
Without a nonce, every text encrypted with the same secret uses the same keystream. XOR two ciphertexts and the keystream cancels out, leaving the XOR of the two texts. That's how WEP was broken.
DES ignores the lowest bit of every key byte. Secrets that differ only there, such as a and ` (0x61 and 0x60), give identical results.
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.
Given a password, the openssl command line derives key and IV from it with a random salt (EVP_BytesToKey or PBKDF2), and the output starts with U2FsdGVkX1 ("Salted__"). That is a different format. Pass the key and IV in hex with -K and -iv instead, as in the code example.
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 des-ede-ofb.
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 des-ede-ofb. 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) |
des-ede-ofb 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 | des-ede-ofb (Base64) |
|---|---|
| empty string | |
a | Xw== |
hello world | Vrf4BtRdBlNfuF8= |
0123456789abcdef | DuOmWY9IRwsV7VriN/2Qxg== |
The quick brown fox jumps over the lazy dog | arrxSsoIGF9G9FnyO+6bgMQ9K0BQfn+xQ7bkCGh9igmU4kb3GHGDLTting== |
Questions about des-ede-ofb
Can des-ede-ofb 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 des-ede-ofb 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.
Why is the des-ede-ofb output shorter than with CBC?
OFB mode needs no padding: the ciphertext has exactly as many bytes as the text, while CBC rounds up to whole blocks.
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 16 bytes (128 bits) fills the key; anything after that is ignored. For real security a random key is better than a typed word.