Docsity

Block Ciphers: DES and Modern Encryption Algorithms, Study notes of Design and Analysis of Algorithms

Partial preview of the text

Download Block Ciphers: DES and Modern Encryption Algorithms and more Study notes Design and Analysis of Algorithms in PDF only on Docsity!

Cryptography andCryptography and

Network Security Network Security

Modern Block CiphersModern Block Ciphers

 now look at modern block ciphersnow look at modern block ciphers  one of the most widely used types ofone of the most widely used types of cryptographic algorithms cryptographic algorithms  provide secrecy /authentication servicesprovide secrecy /authentication services  focus on DES (Data Encryption Standard)focus on DES (Data Encryption Standard)  to illustrate block cipher design principlesto illustrate block cipher design principles

Block Cipher PrinciplesBlock Cipher Principles

 most symmetric block ciphers are based on amost symmetric block ciphers are based on a Feistel Cipher Structure Feistel Cipher Structure  needed since must be able toneeded since must be able to decryptdecrypt ciphertextciphertext to recover messages efficiently to recover messages efficiently  block ciphers look like an extremely largeblock ciphers look like an extremely large substitution substitution  (^) would need table of 2would need table of 2^6464 entries for a 64-bit blockentries for a 64-bit block  instead create from smaller building blocksinstead create from smaller building blocks  using idea of a product cipherusing idea of a product cipher

Ideal Block CipherIdeal Block Cipher

Confusion and DiffusionConfusion and Diffusion

 cipher needs to completely obscurecipher needs to completely obscure statistical properties of original message statistical properties of original message  a one-time pad does thisa one-time pad does this  more practically Shannon suggestedmore practically Shannon suggested combining S & P elements to obtain: combining S & P elements to obtain:  diffusiondiffusion – dissipates statistical structure– dissipates statistical structure of plaintext over bulk of ciphertext of plaintext over bulk of ciphertext  confusionconfusion – makes relationship between– makes relationship between ciphertext and key as complex as possible ciphertext and key as complex as possible

Feistel Cipher StructureFeistel Cipher Structure

 Horst Feistel devised theHorst Feistel devised the feistel cipherfeistel cipher  based on concept of invertible product cipherbased on concept of invertible product cipher  partitions input block into two halvespartitions input block into two halves  process through multiple rounds whichprocess through multiple rounds which  perform a substitution on left data halfperform a substitution on left data half  based on round function of right half & subkeybased on round function of right half & subkey  then have permutation swapping halvesthen have permutation swapping halves  implements Shannon’s S-P net conceptimplements Shannon’s S-P net concept

Feistel Cipher Design ElementsFeistel Cipher Design Elements

 block sizeblock size  key sizekey size  number of roundsnumber of rounds  subkey generation algorithmsubkey generation algorithm  round functionround function  fast software en/decryptionfast software en/decryption  ease of analysisease of analysis

Feistel Cipher DecryptionFeistel Cipher Decryption

DES HistoryDES History

 IBM developed Lucifer cipherIBM developed Lucifer cipher  by team led by Feistel in late 60’sby team led by Feistel in late 60’s  used 64-bit data blocks with 128-bit keyused 64-bit data blocks with 128-bit key  then redeveloped as a commercial cipherthen redeveloped as a commercial cipher with input from NSA and others with input from NSA and others  in 1973 NBS issued request for proposalsin 1973 NBS issued request for proposals for a national cipher standard for a national cipher standard  IBM submitted their revised Lucifer whichIBM submitted their revised Lucifer which was eventually accepted as the DES was eventually accepted as the DES

DES Design ControversyDES Design Controversy

 although DES standard is publicalthough DES standard is public  was considerable controversy over designwas considerable controversy over design  in choice of 56-bit key (vs Lucifer 128-bit)in choice of 56-bit key (vs Lucifer 128-bit)  and because design criteria were classifiedand because design criteria were classified  subsequent events and public analysissubsequent events and public analysis show in fact design was appropriate show in fact design was appropriate  use of DES has flourisheduse of DES has flourished  especially in financial applicationsespecially in financial applications  still standardised for legacy application usestill standardised for legacy application use

Initial Permutation IPInitial Permutation IP

 first step of the data computationfirst step of the data computation  IP reorders the input data bitsIP reorders the input data bits  even bits to LH half, odd bits to RH halfeven bits to LH half, odd bits to RH half  quite regular in structure (easy in h/w)quite regular in structure (easy in h/w)  example:example: IP(675a6967 IP(675a6967 5e5a6b5a) = (ffb2194d5e5a6b5a) = (ffb2194d 004df6fb) 004df6fb)

DES Round StructureDES Round Structure

 uses two 32-bit L & R halvesuses two 32-bit L & R halves  as for any Feistel cipher can describe as:as for any Feistel cipher can describe as: L Lii == RRii –1– R Rii == LLii –1–1  F(F( RRii –1–1,, KKii ))  F takes 32-bit R half and 48-bit subkey:F takes 32-bit R half and 48-bit subkey:  expands R to 48-bits using perm Eexpands R to 48-bits using perm E  adds to subkey using XORadds to subkey using XOR  passes through 8 S-boxes to get 32-bit resultpasses through 8 S-boxes to get 32-bit result  finally permutes using 32-bit perm Pfinally permutes using 32-bit perm P

Substitution Boxes SSubstitution Boxes S

 have eight S-boxes which map 6 to 4 bitshave eight S-boxes which map 6 to 4 bits  each S-box is actually 4 little 4 bit boxeseach S-box is actually 4 little 4 bit boxes  outer bits 1 & 6 (outer bits 1 & 6 ( rowrow bits) select one row of 4bits) select one row of 4  inner bits 2-5 (inner bits 2-5 ( colcol bits) are substitutedbits) are substituted  result is 8 lots of 4 bits, or 32 bitsresult is 8 lots of 4 bits, or 32 bits  row selection depends on both data & keyrow selection depends on both data & key  feature known as autoclaving (autokeying)feature known as autoclaving (autokeying)  example:example:  S(18S(18 09 1209 12 3d 11 17 38 39) = 5fd25e033d 11 17 38 39) = 5fd25e

DES Key ScheduleDES Key Schedule

 forms subkeys used in each roundforms subkeys used in each round  initial permutation of the key (PC1) whichinitial permutation of the key (PC1) which selects 56-bits in two 28-bit halves selects 56-bits in two 28-bit halves  16 stages consisting of:16 stages consisting of:

  • (^) rotatingrotating each halfeach half separately either 1 or 2 placesseparately either 1 or 2 places depending on the depending on the key rotation schedulekey rotation schedule KK
  • (^) selecting 24-bits from each half & permuting themselecting 24-bits from each half & permuting them by PC2 for use in round function F by PC2 for use in round function F  note practical use issues in h/w vs s/wnote practical use issues in h/w vs s/w