TL;DR: DES (Data Encryption Standard) is a symmetric-key block cipher that encrypts data in 64-bit blocks using a 56-bit key and 16 rounds of a Feistel structure. Learning the DES algorithm is still the best way to understand how modern block ciphers work.

Encryption turns readable data into scrambled ciphertext that only someone with the right key can turn back. For more than two decades, DES did that work for banks, governments, and businesses worldwide. It shaped how data encryption was designed, tested, and standardized, and its ideas still appear in ciphers used today.

This guide answers what is DES, explains how the DES algorithm works step by step, and walks through a real example with actual values. You'll also see Python code, the attacks that broke DES, and how it compares with 3DES and AES.

What Is DES (Data Encryption Standard)?

DES, short for Data Encryption Standard, is a symmetric-key encryption algorithm that works on 64-bit blocks of data. It takes a 64-bit key, but only 56 bits are used for encryption; the other 8 are parity bits. The algorithm converts each 64-bit plaintext block into a 64-bit ciphertext block through 16 rounds of processing.

What Is DES in Simple Terms?

Think of DES as a lock where the same key both locks and unlocks the data. That makes it symmetric encryption: sender and receiver share one secret key. Asymmetric algorithms such as RSA work differently, using a public-private key pair instead.

So what is DES in cryptography, and what type of encryption is it? It's a symmetric block cipher. It encrypts fixed-size blocks rather than a continuous stream of bits, and its internal design follows the Feistel structure. Its speed and simplicity made it the default choice in early cryptographic systems. The standard calls the algorithm itself the Data Encryption Algorithm (DEA), but almost everyone just says DES.

Level up with the Cybersecurity Expert Masters Program. Learn core cybersecurity and AI concepts through real-world case studies inspired by globally recognized brands.

DES Parameters: Block Size, Key Size, Rounds, and Structure

Here are the core parameters of the data encryption standard algorithm:

Parameter

Value

What it means

Block size

64 bits

Data is processed in fixed 64-bit (8-byte) chunks

Input key size

64 bits

The key you supply is 8 bytes long

Effective key size

56 bits

Every 8th bit is a parity bit and is ignored

Subkey size

48 bits

Each round uses its own 48-bit subkey

Number of rounds

16

The data passes through the round function 16 times

Structure

Feistel network

Encryption and decryption use the same steps

Why Does DES Use a 56-Bit Key?

DES accepts a 64-bit key, but bits 8, 16, 24, 32, 40, 48, 56, and 64 are parity bits that were meant for error checking, so the algorithm drops them. Changing a parity bit doesn't change the ciphertext at all. The remaining 56 bits give 2^56 possible keys, about 72 quadrillion. That seemed impossible to search in 1977, but it's well within reach of modern hardware.

Weak Keys in DES

A few DES keys are unsafe because of how the key schedule works. DES has 4 weak keys, such as 0101010101010101, which produce the same subkey in every round. With a weak key, encrypting the data twice gives back the original plaintext. There are also 6 pairs of semi-weak keys, where one key decrypts what the other encrypts. Good DES implementations reject these keys.

DES Algorithm Architecture and Block Diagram

The DES algorithm architecture has two parallel parts: the data path, which scrambles the plaintext, and the key schedule, which creates a new subkey for each round.

      64-bit plaintext                      64-bit key
               |                                |
     Initial Permutation (IP)          Permuted Choice 1 (PC-1)
               |                         drops 8 parity bits
       split into L0 | R0                       |
       (32 bits each)                  56 bits split into C0 | D0
               |                                |
   +-----------------------+         left shift by 1 or 2 bits
   |  Round 1 to Round 16  | <-- K1..K16  Permuted Choice 2 (PC-2)
   |  L(i) = R(i-1)        |         selects 48 bits per round
   |  R(i) = L(i-1) XOR    |
   |         f(R(i-1), Ki) |
   +-----------------------+
               |
     final swap undone: R16 | L16
               |
    Final Permutation (IP inverse)
               |
       64-bit ciphertext

The round function f is where the real mixing happens. It expands the right half from 32 to 48 bits, XORs it with the subkey, runs the result through 8 S-boxes, and permutes the output with a P-box.

How the DES Algorithm Works: Step by Step

DES encryption runs in three phases: an initial permutation, 16 Feistel rounds, and a final permutation. A separate key schedule generates the 16 subkeys in parallel.

Step 1: Initial Permutation (IP)

First, DES rearranges the 64-bit plaintext block using a fixed table. No key is involved yet, so this isn't encryption on its own. The table lists, for each output position, which input bit moves there: the first entry is 58, so input bit 58 becomes output bit 1, and input bit 50 becomes output bit 2. Going the other way, input bit 1 ends up at position 40.

The permuted block is then split into two 32-bit halves, the left half (L0) and the right half (R0).

Step 2: The 16 Rounds (Feistel Network)

Each of the 16 rounds transforms the right half and mixes it into the left half. Inside the round function:

  1. Expansion (E-box): The 32-bit right half is expanded to 48 bits. The expansion table repeats 16 bits so the result matches the subkey size.
  2. Key mixing: The 48-bit result is XORed with the 48-bit subkey for that round.
  3. Substitution (S-boxes): The 48 bits are split into eight 6-bit chunks, and each chunk goes through its own S-box, which returns 4 bits. This brings the data back to 32 bits.
  4. Permutation (P-box): The 32 bits are shuffled again to spread the effect of each S-box across the whole block.
  5. XOR and swap: The output is XORed with the left half. The old right half becomes the new left half, and the XOR result becomes the new right half.

Feistel Structure

The Feistel structure is what makes DES elegant. Because each round only XORs the left half with a function of the right half, you can reverse the round by running the same steps with the same subkey, even though the function f itself can't be inverted. After the 16th round, the halves are not swapped, which is what lets decryption reuse the same process.

DES S-Box Explained

The S-boxes (substitution boxes) are the only non-linear part of DES, and they provide most of its security. Without them, DES would be a set of linear operations that simple algebra could solve.

Each of the 8 S-boxes is a table with 4 rows and 16 columns. For each 6-bit input:

  • The first and last bits together pick the row (0 to 3).
  • The middle 4 bits pick the column (0 to 15).
  • The number in that cell is the 4-bit output.

For example, if the input to S-box 1 is 011011, the outer bits 0 and 1 give row 1, and the middle bits 1101 give column 13. The value at row 1, column 13 of S-box 1 is 5, so the S-box outputs 0101.

Step 3: Final Permutation (FP)

After 16 rounds, the two halves are joined as R16 followed by L16. The final permutation, which is the exact inverse of the initial permutation, moves the bits into their final positions to produce the 64-bit ciphertext.

The DES Key Schedule

The key schedule turns the 64-bit key into sixteen 48-bit subkeys:

  1. Permuted Choice 1 (PC-1) drops the 8 parity bits and reorders the remaining 56 bits.
  2. The 56 bits are split into two 28-bit halves, called C0 and D0.
  3. Left shifts: in each round, both halves rotate left by 1 bit (in rounds 1, 2, 9, and 16) or by 2 bits (in all other rounds). The shifts add up to 28, so the halves return to their starting position after round 16.
  4. Permuted Choice 2 (PC-2) picks 48 of the 56 shifted bits to form that round's subkey.

Every round therefore uses a slightly different selection of the original key bits.

DES Decryption Process

DES decryption follows the same process as encryption, with one change: it applies the subkeys in reverse order, from K16 down to K1. The ciphertext goes through the initial permutation, 16 rounds, and the final permutation, and the original plaintext comes out. Using the same algorithm for both directions was a big advantage when DES was implemented in hardware.

Learn 30+ in-demand cybersecurity skills and tools, including Ethical Hacking, System Penetration Testing, AI-Powered Threat Detection, Network Packet Analysis, and Network Security, with our Cybersecurity Expert Masters Program.

DES Algorithm With Example

Let's walk through a real DES encryption using the standard test values found in many textbooks. We checked every value below with a step-by-step DES implementation, and it matches the output of a production cryptography library.

  • Plaintext: 0123456789ABCDEF (64 bits, in hex)
  • Key: 133457799BBCDFF1 (64 bits, in hex)

Stage

Value (hex)

After initial permutation

CC00CCFFF0AAF0AA

L0 and R0

CC00CCFF and F0AAF0AA

Subkey K1 (48 bits)

1B02EFFC7072

After round 1: L1 and R1

F0AAF0AA and EF4A6544

After round 16: L16 and R16

43423234 and 0A4CD995

Ciphertext (after final permutation on R16 then L16)

85E813540F0AB405

Notice that L1 equals R0. That's the Feistel structure at work: the right half moves to the left unchanged, and only the new right half is transformed. Running the ciphertext 85E813540F0AB405 back through DES with the same key and the subkeys in reverse order gives 0123456789ABCDEF again.

Real messages are rarely exactly 8 bytes. A word like "Secure" is only 48 bits, so it's padded to 64 bits before encryption; longer messages are split into 64-bit blocks and processed with a mode of operation.

Data Encryption Standard Diagram

DES Encryption and Decryption in Python

You can try DES yourself with the PyCryptodome library (pip install pycryptodome). This example encrypts the same test block as above, then encrypts a longer message using CBC mode and padding.

from Crypto.Cipher import DES
from Crypto.Util.Padding import pad, unpad
from Crypto.Random import get_random_bytes

# 1. Encrypt one 64-bit block with the classic DES test vector
key = bytes.fromhex("133457799BBCDFF1")
block = bytes.fromhex("0123456789ABCDEF")

cipher = DES.new(key, DES.MODE_ECB)
ciphertext = cipher.encrypt(block)
print("Ciphertext:", ciphertext.hex().upper())
print("Decrypted: ", cipher.decrypt(ciphertext).hex().upper())

# 2. Encrypt a message of any length using CBC mode and padding
message = b"Meet me at the server room at 9"
iv = get_random_bytes(8)  # DES uses an 8-byte (64-bit) IV

encrypted = DES.new(key, DES.MODE_CBC, iv).encrypt(pad(message, 8))
decrypted = unpad(DES.new(key, DES.MODE_CBC, iv).decrypt(encrypted), 8)

print("Message bytes:", len(message), "| Encrypted bytes:", len(encrypted))
print("Decrypted message:", decrypted.decode())

Output:

Ciphertext: 85E813540F0AB405
Decrypted:  0123456789ABCDEF
Message bytes: 31 | Encrypted bytes: 32
Decrypted message: Meet me at the server room at 9

The CBC ciphertext changes every time you run the code because the IV is random, but the decrypted message always matches. Use DES like this only for learning or for working with legacy data, never to protect new data.

DES Modes of Operation

DES on its own encrypts only one 64-bit block. To handle longer data, it's combined with a mode of operation that defines how blocks are linked. The original DES standard defined four modes (ECB, CBC, CFB, and OFB); Counter mode (CTR) was later added as a general block cipher mode.

  • Electronic Codebook (ECB): Encrypts each 64-bit block independently with the same key.
  • Cipher Block Chaining (CBC): Each plaintext block is XORed with the previous ciphertext block before encryption, starting with an initialization vector (IV).
  • Cipher Feedback (CFB): The previous ciphertext block is encrypted and XORed with the plaintext, turning DES into a self-synchronizing stream cipher.
  • Output Feedback (OFB): Like CFB, except the algorithm feeds back its own previous output rather than the ciphertext.
  • Counter (CTR): Each plaintext block is XORed with an encrypted counter value so that blocks can be processed in parallel.

Mode

Best use case

Avoid when

ECB

Encrypting single random values, such as a key

The data has any structure or repeated blocks

CBC

General file and database encryption

You need parallel encryption

CFB

Byte-by-byte streams, such as terminal traffic

An error in one block must not affect the next

OFB

Noisy channels, since bit errors don't spread

The same IV might ever be reused

CTR

High-speed and multi-core processing

You can't guarantee a unique counter for every block

None of these modes detect tampering, so attackers can alter ciphertext without being noticed. Modern systems use authenticated modes such as AES-GCM instead.

ECB's weakness is easy to see in code. Identical plaintext blocks produce identical ciphertext blocks, which leaks patterns in the data:

from Crypto.Cipher import DES

key = bytes.fromhex("133457799BBCDFF1")
plaintext = b"ATTACK!!" * 3   # three identical 8-byte blocks

ecb = DES.new(key, DES.MODE_ECB).encrypt(plaintext)
cbc = DES.new(key, DES.MODE_CBC, iv=bytes(8)).encrypt(plaintext)

print("ECB blocks:", [ecb[i:i+8].hex() for i in range(0, 24, 8)])
print("CBC blocks:", [cbc[i:i+8].hex() for i in range(0, 24, 8)])

Output:

ECB blocks: ['ce529e61192f25fa', 'ce529e61192f25fa', 'ce529e61192f25fa']

CBC blocks: ['ce529e61192f25fa', '8a4948fcad9eaca2', '9110d20cc5755bb5']

Why DES Is No Longer Secure

DES didn't fail because of a design flaw. It failed mainly because its 56-bit key is too short for modern computers. Here's how it was broken:

  • In 1997, a volunteer computing project called DESCHALL cracked a DES message publicly for the first time. In 1998, the Electronic Frontier Foundation built a machine called Deep Crack for about $250,000, and it found a DES key in 56 hours. In January 1999, Deep Crack and the distributed.net network together broke a key in 22 hours and 15 minutes. Dedicated hardware has since made the search far cheaper.
  • Eli Biham and Adi Shamir published differential cryptanalysis around 1990. Against full 16-round DES, it needs 2^47 chosen plaintexts, which is impractical in real life but proved the cipher could be broken faster than brute force.
  • Mitsuru Matsui's linear cryptanalysis, published in 1993, needs 2^43 known plaintext-ciphertext pairs, and he demonstrated it in practice in 1994.
  • DES has a complementation property: if you flip every bit of the key and the plaintext, the ciphertext comes out with every bit flipped. This halves the effective work of a brute-force search.
  • Because the block is only 64 bits, repeated ciphertext blocks become likely after about 2^32 blocks (around 32 GB) encrypted with one key. The 2016 Sweet32 attack used this weakness against 3DES in HTTPS and VPN connections.

For these reasons, never use DES to protect new data.

DES vs 3DES vs AES

As DES became easier to break, Triple DES (3DES or TDEA) was introduced as a stopgap. It runs DES three times on each block in an encrypt, decrypt, encrypt (EDE) pattern with up to three different keys. If all three keys are the same, 3DES behaves exactly like single DES, which kept it compatible with older systems.

AES (Advanced Encryption Standard) is the true replacement. It uses a substitution-permutation network rather than a Feistel structure, larger blocks, and much longer keys.

Feature

DES

3DES

AES

Structure

Feistel network

Three DES passes (EDE)

Substitution-permutation network

Key size

56 bits

112 or 168 bits

128, 192, or 256 bits

Effective security

56 bits

About 80 bits (2 keys) or 112 bits (3 keys)

128, 192, or 256 bits

Block size

64 bits

64 bits

128 bits

Rounds

16

48 (16 × 3)

10, 12, or 14

Speed

Fast in hardware, slow in software

About three times slower than DES

Very fast, with hardware support in most CPUs

Status

Withdrawn by NIST in 2005

Disallowed for encryption after 2023; decryption of old data only

Current standard

The difference between DES and 3DES comes down to key strength: 3DES triples the work, but a meet-in-the-middle attack means three keys give about 112 bits of security, not 168. Its 64-bit block also leaves it exposed to Sweet32. The difference between DES and AES is more fundamental: AES was designed from scratch for modern hardware and has no practical attacks.

Real-World Applications of the DES Algorithm

DES is no longer used to protect new data, but it still matters in a few places:

  • Older ATMs and point-of-sale terminals were built with chips that only supported DES or 3DES. The payments industry has spent years migrating these systems to AES because upgrades often require replacing physical machines.
  • Some long-lived industrial and embedded systems still use older cipher suites to talk to each other.
  • Older pseudorandom number generators, such as the one in the ANSI X9.17 standard, used DES as a mixing function.
  • Organizations may still need DES or 3DES to read data that was encrypted years ago.
  • DES remains the standard example for teaching block ciphers, Feistel networks, and cryptanalysis.

Advantages and Disadvantages of DES

Advantages of DES

  • Its operations, such as permutations, XORs, and table lookups, are simple and were designed to run efficiently in hardware.
  • It was standardized and studied more than almost any other cipher, so its behavior is very well understood.
  • The Feistel structure lets encryption and decryption share the same hardware or code.
  • Its S-boxes proved remarkably resistant to differential cryptanalysis, years before that attack was public.

Disadvantages of DES

  • Its 56-bit key can be broken by brute force in hours with dedicated hardware.
  • Its 64-bit block size makes collisions likely when you encrypt large amounts of data with one key.
  • It has weak and semi-weak keys, plus the complementation property, which further reduces its security.
  • It's slow in software compared with modern ciphers like AES.

Best Practices

  • Don't use DES or 3DES to encrypt anything new.
  • Never use DES for passwords. Passwords should be hashed with a slow, salted algorithm such as Argon2 or bcrypt, not encrypted.
  • Don't use DES to protect payment card data or other regulated information.
  • Migrate to AES, ideally AES-256 in an authenticated mode such as GCM.
  • If you must keep a legacy 3DES system running, use it only to decrypt existing data while you plan the move to AES.

Conclusion

DES was the first encryption standard that the whole world could study, and it set the pattern for how ciphers are designed, tested, and eventually retired. Its 56-bit key ended its usefulness, but its ideas, including Feistel rounds, S-boxes, and key schedules, still underpin how cryptography is taught and how newer algorithms are judged.

Knowing what is DES and how the data encryption standard algorithm works is a solid first step toward a career in security. Unlock your potential with our AI-Integrated Cyber Security Expert Master's Program and gain practical knowledge in security operations, ethical hacking, risk management, and network defense.

Key Takeaways

  • DES is a symmetric block cipher that encrypts 64-bit blocks with a 56-bit key, and it was the US encryption standard from 1977 to 2005.
  • Its architecture is a 16-round Feistel network, with S-boxes providing non-linearity and a key schedule generating a new 48-bit subkey for each round.
  • Decryption uses the same steps as encryption, but applies the subkeys in reverse order.
  • DES is no longer secure because its 56-bit key can be brute-forced in hours and its 64-bit block is too small for modern data volumes.
  • 3DES was a temporary fix and is now disallowed for encryption, while AES is the current standard for symmetric encryption.

FAQs

  1. Is DES the same as DEA?

Yes, essentially. The Data Encryption Standard is the name of the standard, while the Data Encryption Algorithm (DEA) is the name the standard uses for the algorithm itself. In everyday use, both terms refer to the same cipher, and Triple DES is likewise sometimes called TDEA.

  1. Is DES a block cipher or a stream cipher?

DES is a block cipher because it always encrypts fixed 64-bit blocks. However, when DES is used in CFB, OFB, or CTR mode, it generates a keystream that is XORed with the data, so the overall system behaves like a stream cipher.

  1. Why does DES use 16 rounds?

Each round adds more mixing, and 16 rounds were enough to resist the attacks its designers knew about while keeping hardware fast. Versions of DES with fewer rounds are much easier to break with differential and linear cryptanalysis, which shows the 16 rounds did real work.

  1. What is the difference between DES and RSA?

DES is a symmetric algorithm that uses one shared secret key to encrypt and decrypt data quickly. RSA is an asymmetric algorithm that uses a public key to encrypt and a private key to decrypt, and it's much slower. In practice, people often combined the two: RSA was used to exchange a key, and a symmetric cipher encrypted the actual data.

  1. How many bytes is a DES key?

A DES key is 8 bytes (64 bits) long. Only 7 bytes (56 bits) affect the encryption because the lowest bit of each byte is a parity bit that the algorithm ignores.

Our Cyber Security Program Duration and Fees

Cyber Security programs typically range from a few weeks to several months, with fees varying based on program and institution.

Program NameDurationFees
Professional Certificate Program in AI-Powered Cybersecurity

Cohort Starts: 10 Nov, 2026

18 weeks$3,490
AI-Integrated Cyber Security Expert Master's Program4 months$2,599