# Compare and contrast DES and AES?

DES (Data Encryption Standard) and AES (Advanced Encryption Standard) both are the symmetric block cipher. AES was introduced to overcome the drawback of DES. As DES has a smaller key size which makes it less secure to overcome this triple DES was introduced but it turns out to be slower. Hence, later AES was introduced by the National Institute of Standard and Technology.

The basic difference between DES and AES is that in DES plaintext block is divided into two halves before the main algorithm starts whereas, in AES the entire block is processed to obtain the ciphertext

### Definition of DES (Data Encryption Standard)

Data Encryption Standard (DES) is a symmetric key block cipher that was adopted by National Institute of Standard and Technology in the year 1977. DES is based on the Feistel structure where the plaintext is divided into two halves. DES takes input as 64-bit plain text and 56-bit key to produce 64-bit Ciphertext.

In the figure below you can see the encryption of plaintext using DES. Initially, the 64-bit plaintext undergoes initial permutation which rearranges the bits to get 64-bit permuted input. Now this 64 bit permuted input is divided into two halves i.e. 32-bit left portion and 32-bit right portion. Both this portion undergoes sixteen rounds where each round follows the same functions. After completion of sixteen rounds, final permutation is done, and the 64-bit ciphertext is obtained.Each round contains following functions:

• Expansion Permutation: Here the 32-bit right portion is expanded to form 48-bit right portion.
• Xor: The 48-bit right portion is Xor with 48-bit subkey obtained from the 56-bit key, which results in the 48-bit output.
• S-box: The 48-bit output obtained by Xor step is reduced to 32 bit again.
• P-box: Here the 32-bit result obtained from S-box is again permuted, which result in 32-bit permuted output.

### Definition of AES (Advanced Encryption Standard)

Advanced Encryption Standard (AES) is also a symmetric key block cipher. AES was published in 2001 by the National Institute of Standards and Technology. AES was introduced to replace DES as DES uses very small cipher key and the algorithm was quite slower.

AES algorithm takes 128-bit plaintext and 128-bit secret key which together forms a 128-bit block which is depicted as 4 X 4 square matrix. This 4 X 4 square matrix undergoes an initial transformation. This step is followed by the 10 rounds. Among which 9 round contain following stages:

• Subbytes: It uses S-box by which it performs byte by byte substitution of the entire block (matrix).
• Shift Rows: Rows of the matrix are shifted.
• Mix Columns: Columns are of the matrix are shuffled from right to left.
• Add round keys: Here, the Xor of the current block and the expanded key is performed.

And the last 10th round involves Subbytes, Shift Rows, and Add round keys stages only and provides 16 bytes (128-bit) ciphertext.

## Key Differences Between DES and AES

1. The basic difference between DES and AES is that the block in DES is divided into two halves before further processing whereas, in AES entire block is processed to obtain ciphertext.
2. The DES algorithm works on the Feistel Cipher principle, and the AES algorithm works on substitution and permutation principle.
3. The key size of DES is 56 bit which is comparatively smaller than AES which has 128,192, or 256-bit secret key.
4. The rounds in DES include Expansion Permutation, Xor, S-box, P-box, Xor and Swap. On the other hands, rounds in AES include Subbytes, Shiftrows, Mix columns, Addroundkeys.
5. DES is less secure than AES because of the small key size.
6. AES is comparatively faster than DES.
{"ft_lang_label":"__label__en","ft_lang_prob":0.9147327,"math_prob":0.9030504,"size":4535,"snap":"2022-40-2023-06","text_gpt3_token_len":1041,"char_repetition_ratio":0.11564776,"word_repetition_ratio":0.044058744,"special_character_ratio":0.23020948,"punctuation_ratio":0.1039261,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99390584,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-10-04T03:36:55Z\",\"WARC-Record-ID\":\"<urn:uuid:6c576301-9e9b-4b2c-ba01-7037280b0def>\",\"Content-Length\":\"131418\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:e8c5c8c0-2dc0-4e0a-b600-027812118f88>\",\"WARC-Concurrent-To\":\"<urn:uuid:086cc674-b976-4b46-9796-2f7ceaf1a355>\",\"WARC-IP-Address\":\"104.21.67.130\",\"WARC-Target-URI\":\"https://nerdtutorials.com/compare-and-contrast-des-and-aes/784/\",\"WARC-Payload-Digest\":\"sha1:XIRY3QOVK35S3OLXFXEQ3DPBQDDJVQBY\",\"WARC-Block-Digest\":\"sha1:QA7VN5EMM4WI4TL2PETFL4ICIQ6V3TMQ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-40/CC-MAIN-2022-40_segments_1664030337473.26_warc_CC-MAIN-20221004023206-20221004053206-00794.warc.gz\"}"}