Professional Documents
Culture Documents
CS Lab4 ProcopiiMaria
CS Lab4 ProcopiiMaria
Raport
for laboratory work No. 4
at the
"Cryptographic methods of information protection" course
Did by:
Procopii Maria,
gr. FAF-212
Checked by:
Catalin MITU
Chișinău – 2023
Theme: Block ciphers. The DES algorithm
Task:
To develop a program in one of the programming languages preferred for implementing an element of the
DES algorithm. She is pregnant will choose according to the order number n of the student from the group
list, according to the formula: nr_task = n mode 11. For each task let the tables used and all intermediate steps
be displayed on the screen. Input data be user-enterable or randomly generated.
The Data Encryption Standard (DES) is a symmetric-key block cipher encryption algorithm that was widely
used for secure data transmission and storage in the past. It was adopted as a federal standard in the United
States in 1977 and served as the primary encryption standard for many years until it was eventually replaced
by more advanced algorithms like the Advanced Encryption Standard (AES). Despite its age and
vulnerabilities to modern attacks, DES is still a valuable algorithm for educational purposes and understanding
the fundamentals of encryption.
DES algorithm:
The Data Encryption Standard (DES) is a symmetric-key block cipher encryption algorithm that was widely
used for secure data transmission and storage in the past. It was adopted as a federal standard in the United
States in 1977 and served as the primary encryption standard for many years until it was eventually replaced
by more advanced algorithms like the Advanced Encryption Standard (AES). Despite its age and
vulnerabilities to modern attacks, DES is still a valuable algorithm for educational purposes and understanding
the fundamentals of encryption.
1. Key Generation:
- DES uses a 56-bit key, which is divided into 16 48-bit subkeys (one for each round).
- The key is typically derived from a user-provided passphrase or some other method.
3. Feistel Network:
- DES is based on a Feistel network structure, which repeatedly performs a series of operations on the data.
It consists of 16 rounds.
4. Round Function:
- Each round of the Feistel network uses a different 48-bit subkey derived from the original 56-bit key.
7. Substitution (S-boxes):
- The result of the XOR operation is then divided into 8 groups of 6 bits each.
- Each group is substituted with a 4-bit output using a predefined S-box (substitution box).
- S-boxes provide the non-linear component of DES and are a key part of its security.
8. Permutation (P):
- The 32-bit output from the S-boxes is permuted according to a fixed table.
To decrypt the ciphertext, the same algorithm is applied with the same 56-bit key, but the subkeys are used in
reverse order.
It's important to note that DES is no longer considered secure for most applications because its 56-bit key size
is vulnerable to brute-force attacks. Consequently, it's recommended to use more modern encryption
algorithms like AES, which offer significantly stronger security. DES has largely been replaced by AES in
most security-critical contexts.
Solution:
Further will be described the implementation of 2.1, 2.2 and 2.3 conditios.
The permutation tables used in the Data Encryption Standard (DES) algorithm, which were used in my code:
These permutation tables are crucial for transforming the key data and generating the subkeys used in the DES
algorithm. They define the order in which the bits are selected and rearranged.
Code implementation for each of the tasks:
Image 1: Code for fiding the K+ from the given String key
Image 2: Code for fiding the C and D from the given K+ key
Example:
Image 4: Fiding the K+ from the 8 string key (with intermediate byte value of the key)
Image 6: Fiding the specific round key from provided K+ (with intermediate result of D and C)
Conclusion:
The Data Encryption Standard (DES) was a pioneering symmetric-key block cipher encryption algorithm
that significantly contributed to the field of cryptography. Although it played a crucial role in securing data
for many years, it is now considered outdated due to advances in computing power and cryptographic
techniques.
DES was a pivotal cryptographic milestone in the history of encryption but has become outdated and
insecure for modern security requirements. It paved the way for more robust and secure encryption
standards like AES, which are widely adopted today. Understanding DES's architecture and its limitations is
crucial for appreciating the evolution of cryptography and the importance of strong encryption standards in
the digital age.
GitHub:
https://github.com/MariaProcopii/cryptography/tree/main/src/main/java/LAB4