DES (Data Encryption Standard)
Last modified: 2023-11-05
The DES is a symmetric-key algorithm for the encryption of digital data.
At first, we create a text file which contains a simple word "hello".
echo hello > hello.txt
openssl, we can encrypt the file using DES algorithm. We're asked the password so enter the new one.
openssl des -e -in hello.txt -out encrypted.enc
After encryption, we can send the encrypted file to someone else. And someone can decrypt it with the DES algorithm.
In the decryption process, we can also use the almost same command but specify
-d (decrypt) option instead of
-e (encrypt). We'll be asked the password which is set when encryption so enter the same password.
openssl des -d -in encrypted.enc -out decrypted.txt
After decryption, confirm that the content of the
decrypted.txt is the same as that of the original plain
cat decrypted.txt # hello
Triple DES (3DES) applies the DES cipher algorithm three times to each data block.
This encryption/description process with
openssl is almost the same as that of DES so I'll write it briefly here
# Encryption openssl des -e -in hello.txt -out encrypted.enc # Decryption openssl des -d -in encrypted.enc -out decrypted.txt