DES & Triple DES (3DES) Encrypt Online | OpenSSL Compatible

Encryption
100% client-side. Processed locally in your browser using the Web Crypto API. Nothing is sent to any server.
⚠️ Critical Security: DES is broken and can be brute-forced in hours. 3DES is deprecated by NIST (2023). Use AES-256 for all new projects. This tool is for legacy system compatibility and educational purposes only.

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

AlgorithmKey SizeBlock SizeSecurityStatus
DES56-bit64-bitBrokenDeprecated (NIST 2005)
3DES168-bit effective64-bitMarginalDeprecated (NIST 2023)

Cipher Modes

ModeIV RequiredPaddingRecommendation
CBCYes (8 bytes)PKCS7Recommended for block data
CFBYes (8 bytes)No (streaming)Good for streaming data
OFBYes (8 bytes)No (streaming)Similar to CFB, error propagation differs
ECBNoPKCS7Not 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

⚠️ Using DES for New Projects — DES has a 56-bit key that can be brute-forced in hours with modern hardware. Never use DES for any new encryption needs.
⚠️ Using 3DES for New Projects — NIST deprecated 3DES in 2023. Use AES-256-GCM or ChaCha20-Poly1305 instead for all new applications.
⚠️ Using ECB Mode — ECB encrypts identical plaintext blocks to identical ciphertext, revealing patterns in the data. Always use CBC, CFB, or OFB mode instead.
⚠️ Weak Key Generation — DES/3DES keys must be randomly generated using cryptographically secure methods. Never use passwords or predictable values as keys.
⚠️ OpenSSL Compatible Uses MD5 — The OpenSSL "Salted__" format uses MD5 for key derivation, which is cryptographically weak. Acceptable for interoperability but not recommended for new projects.

Security Notes

🔒 DES is broken — 56-bit key can be brute-forced in hours; never use for real security.
🔒 3DES is deprecated — NIST withdrew 3DES in 2023; migrate to AES-256 for all new projects.
🔒 Never use ECB mode — identical plaintext blocks produce identical ciphertext, revealing data patterns.
🔒 OpenSSL Compatible uses MD5 — acceptable for interoperability but not recommended for new projects.

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

Related Concepts

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

Learn More