DES & Triple DES (3DES) Encrypt Online | OpenSSL Compatible
Encryption How It Works
What Is DES / 3DES Encryption?
DES (Data Encryption Standard) is a symmetric-key block cipher developed in the 1970s. It uses a 56-bit key and 64-bit block size. 3DES (Triple DES) applies DES three times with either two or three independent keys, providing 112-bit or 168-bit effective key length. Both are now considered insecure for new applications.
This tool provides DES and 3DES encryption and decryption using the crypto-js library. It supports two output formats: Standard (explicit key and IV that you control) and OpenSSL Compatible (passphrase-based with automatic salt and IV generation via EVP_BytesToKey/MD5, producing ciphertext starting with "Salted__"). All cryptographic operations happen locally in your browser — your key, IV, and data never leave your device.
When to Use DES / 3DES
- Legacy system compatibility — Interoperating with older systems that only support DES/3DES
- Migration projects — Decrypting legacy data before migrating to AES-256
- Educational purposes — Understanding the evolution of symmetric encryption
- OpenSSL interoperability — Working with systems using OpenSSL's "Salted__" format
- When NOT to use — For all new encryption needs, use AES-256-GCM or ChaCha20-Poly1305 instead
Algorithm Selection
| Algorithm | Key Size | Block Size | Security | Status |
|---|---|---|---|---|
| DES | 56-bit | 64-bit | Broken | Deprecated (NIST 2005) |
| 3DES | 168-bit effective | 64-bit | Marginal | Deprecated (NIST 2023) |
Cipher Modes
| Mode | IV Required | Padding | Recommendation |
|---|---|---|---|
| CBC | Yes (8 bytes) | PKCS7 | Recommended for block data |
| CFB | Yes (8 bytes) | No (streaming) | Good for streaming data |
| OFB | Yes (8 bytes) | No (streaming) | Similar to CFB, error propagation differs |
| ECB | No | PKCS7 | Not recommended — reveals patterns |
Standards Compliance
- FIPS 46-3 — Data Encryption Standard (DES) specification (1977, withdrawn 2005)
- SP 800-67 — Recommendation for the Triple Data Encryption Algorithm (TDEA) (2001, deprecated 2023)
- NIST SP 800-131A — Transitioning the Use of Cryptographic Algorithms and Key Lengths
- OpenSSL — Compatible with OpenSSL enc/dec commands using "Salted__" format
Last updated:
Code Examples
Encrypt with 3DES using well-audited libraries:
JavaScript — crypto-js (Browser)
import CryptoJS from 'crypto-js';
const key = CryptoJS.lib.WordArray.random(24); // 192-bit key
const iv = CryptoJS.lib.WordArray.random(8); // 64-bit IV
const plaintext = 'secret message';
const ciphertext = CryptoJS.TripleDES.encrypt(
plaintext,
key,
{
iv: iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
}
);
console.log('Ciphertext (Base64):', ciphertext.toString()); Python — PyCryptodome
from Crypto.Cipher import DES3
import os
# Generate random key and IV
key = DES3.adjust_key_parity(os.urandom(24))
iv = os.urandom(8)
# Encrypt with 3DES-CBC
cipher = DES3.new(key, DES3.MODE_CBC, iv)
plaintext = b'secret message!!' # Must be multiple of 8 bytes
ciphertext = cipher.encrypt(plaintext)
print(f'Key: {key.hex()}')
print(f'IV: {iv.hex()}')
print(f'Ciphertext: {ciphertext.hex()}') Go — crypto/des
package main
import (
"crypto/cipher"
"crypto/des"
"crypto/rand"
"fmt"
)
func main() {
// Generate 24-byte key for 3DES
key := make([]byte, 24)
rand.Read(key)
// Generate 8-byte IV
iv := make([]byte, 8)
rand.Read(iv)
// Create 3DES cipher
block, _ := des.NewTripleDESCipher(key)
mode := cipher.NewCBCEncrypter(block, iv)
plaintext := []byte("secret message!!") // Must be multiple of 8 bytes
ciphertext := make([]byte, len(plaintext))
mode.CryptBlocks(ciphertext, plaintext)
fmt.Printf("Ciphertext: %x\n", ciphertext)
} Rust — des crate
use des::{Des, TdesEde3};
use des::cipher::{KeyInit, BlockEncrypt};
use des::cipher::block_padding::Pkcs7;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let key = [0u8; 24]; // 192-bit key for 3DES
let iv = [0u8; 8]; // 64-bit IV
let cipher = TdesEde3::new_from_slices(&key, &iv)?;
let plaintext = b"secret message";
let mut buffer = [0u8; 16]; // Padded to block size
buffer[..plaintext.len()].copy_from_slice(plaintext);
cipher.encrypt_block(&mut buffer.into());
println!("Ciphertext: {:?}", buffer);
Ok(())
} Node.js — crypto module
const crypto = require('crypto');
// Generate random key and IV
const key = crypto.randomBytes(24); // 192-bit key for 3DES
const iv = crypto.randomBytes(8); // 64-bit IV
// Encrypt with 3DES-CBC
const cipher = crypto.createCipheriv('des-ede3-cbc', key, iv);
const plaintext = 'secret message!!'; // Must be multiple of 8 bytes
let ciphertext = cipher.update(plaintext, 'utf8', 'hex');
ciphertext += cipher.final('hex');
console.log('Key:', key.toString('hex'));
console.log('IV:', iv.toString('hex'));
console.log('Ciphertext:', ciphertext); Common Pitfalls & Attack Vectors
Security Notes
Disclaimer
Disclaimer: This page is for educational and legacy system compatibility purposes only. It does not constitute professional security advice. DES and 3DES are deprecated algorithms. For production encryption, use AES-256-GCM or ChaCha20-Poly1305 and consult official standards (NIST, IETF).
Further Reading & Standards
- FIPS 46-3 — Data Encryption Standard (DES) (Withdrawn 2005)
- SP 800-67 Rev. 2 — Recommendation for the Triple Data Encryption Algorithm (TDEA) (Deprecated 2023)
- NIST SP 800-131A Rev. 2 — Transitioning the Use of Cryptographic Algorithms and Key Lengths
- OpenSSL enc Command — OpenSSL Encryption/Decryption Commands
Related Concepts
- AES Encryption — The modern replacement for DES/3DES, recommended for all new projects
- Symmetric vs Asymmetric Encryption — Understanding the difference between shared-key and public-key cryptography
- Key Management — Best practices for generating and protecting encryption keys
- AES Encrypt/Decrypt Tool — Secure alternative to DES/3DES for all encryption needs
Related Tools
Need modern, secure encryption? Use AES Encrypt/Decrypt instead. For a stream cipher alternative, try ChaCha20 Encrypt/Decrypt. For generating strong encryption keys, the Password Generator creates cryptographically secure random strings.
Frequently Asked Questions
What cipher modes are supported?
Four modes: CBC (Cipher Block Chaining, recommended), ECB (Electronic Codebook, not recommended), CFB (Cipher Feedback), and OFB (Output Feedback). CBC, CFB, and OFB require an 8-byte IV. ECB encrypts each block independently and can reveal patterns.
What key length do I need?
DES requires an 8-byte (64-bit) key. 3DES requires a 24-byte (192-bit) key. The tool validates key length automatically. Use the Random button to generate a cryptographically secure random key.
When should I use Standard vs OpenSSL Compatible format?
Use Standard format when you control both encryption and decryption — you specify the exact key and IV. Use OpenSSL Compatible format when you need to exchange data with other tools that use the OpenSSL "Salted__" format (passphrase-based, automatic salt and IV generation).
Can I decrypt ciphertext from other tools?
Yes. If the ciphertext starts with "U2FsdGVkX1" (Base64 for "Salted__"), it is OpenSSL format. Select "OpenSSL Compatible" encryption format, enter the passphrase, and the tool will automatically detect and decrypt it. For non-OpenSSL ciphertext, select "Standard" format and enter the exact key and IV used for encryption.
Should I use DES or 3DES?
Neither is recommended for new projects — use AES instead. If you must choose between them for legacy compatibility, 3DES is significantly more secure than single DES (168-bit vs 56-bit effective key length). DES can be brute-forced in hours; 3DES remains computationally expensive but is still deprecated by NIST since 2023.
Privacy: This tool runs entirely in your browser — nothing is uploaded or stored. · Disclaimer: For educational purposes only. Not professional security advice.
More in Encryption
AES Encrypt/Decrypt
Encrypt and decrypt with AES-128/192/256 online. GCM, CTR, and OpenSSL-compatible CBC modes. Passphrase or raw key, custom IV.
ChaCha20 / Salsa20 Encrypt/Decrypt
Encrypt and decrypt with ChaCha20, XChaCha20, ChaCha20-Poly1305 (AEAD), or Salsa20 online. Passphrase mode with PBKDF2 key derivation.
RSA Encrypt / Decrypt
Encrypt and decrypt with RSA-OAEP online via Web Crypto API. Built-in key generator, PKCS#8/PKCS#1 conversion, SHA-256/384/512.
XOR Encrypt/Decrypt
Encrypt and decrypt with XOR cipher online. Text/Hex/Base64 formats, visual XOR table, brute-force key breaking, auto-solve.
JWE Encrypt / Decrypt
Encrypt and decrypt JWE (JSON Web Encryption) tokens online. RSA-OAEP, AES key wrap, PBES2 password-based key management, A128GCM/A256GCM.
Blowfish Encrypt/Decrypt
Encrypt and decrypt with Blowfish online. 5 cipher modes, 5 paddings, GBK/UTF-16 support, OpenSSL passphrase compatible.
PGP Encrypt / Decrypt
Encrypt, decrypt, sign, and verify with OpenPGP online. Public key and password modes, built-in key generator, GnuPG compatible.