SlideShare a Scribd company logo
Network Security  Lec # 3
 
Data Encryption Standard (DES) most widely used block cipher in world  adopted in 1977 by NBS (now NIST) as FIPS PUB 46 encrypts 64-bit data using 56-bit key has widespread use has been considerable controversy over its security
DES Encryption Overview
 
DES Round Structure uses two 32-bit L & R halves as for any Feistel cipher can describe as: L i   =  R i –1 R i   =  L i –1     F( R i –1 ,  K i ) F takes 32-bit R half and 48-bit subkey: expands R to 48-bits using perm E adds to subkey using XOR passes through 8 S-boxes to get 32-bit result finally permutes using 32-bit perm P
 
 
Substitution Boxes (S-box) have eight S-boxes which map 6 to 4 bits  each S-box is actually 6 x 4 bit boxes  outer bits 1 & 6 ( row  bits) select one row of 4  inner bits 2-5 ( col  bits) are substituted  result is 8 lots of 4 bits, or 32 bits row selection depends on both data & key feature known as autoclaving (autokeying) example: S(18 09 12 3d 11 17 38 39) = 5fd25e03
DES S-boxes
 
 
DES Key Schedule forms subkeys used in each round initial permutation of the key (PC1) which selects 56-bits in two 28-bit halves  16 stages consisting of:  rotating  each half  separately either 1 or 2 places depending on the  key rotation schedule  K selecting 28-bits from each half & compression permuting them (56 to 48) by PC2 for use in round function F  note practical use issues in h/w vs s/w
 
 
 
 
DES Decryption decrypt must unwind steps of data computation  with Feistel design, do encryption steps again  using subkeys in reverse order (SK16 … SK1) IP undoes final FP step of encryption  1st round with SK16 undoes 16th encrypt round … . 16th round with SK1 undoes 1st encrypt round  then final FP undoes initial encryption IP  thus recovering original data value
Strength of DES – Key Size 56-bit keys have 2 56  = 7.2 x 10 16  values brute force search looks hard recent advances have shown is possible in 1997 on Internet in a few months  in 1998 on dedicated h/w (EFF) in a few days  in 1999 above combined in 22hrs! still must be able to recognize plaintext must now consider alternatives to DES
DES Design Criteria as reported by Coppersmith in [COPP94] S-boxes provide for  non-linearity resistance to differential cryptanalysis good confusion criteria for permutation P provide for  increased diffusion
Block Cipher Design basic principles still like Feistel’s in 1970’s number of rounds more is better, exhaustive search best attack function f: provides “confusion”, is nonlinear, avalanche have issues of how S-boxes are selected key schedule complex subkey creation, key avalanche
Strength of DES – Analytic Attacks now have several analytic attacks on DES these  utilise some deep structure of the cipher  by gathering information about encryptions  can eventually recover some/all of the sub-key bits  if necessary then exhaustively search for the rest  generally these are statistical attacks include differential cryptanalysis  linear cryptanalysis
Avalanche Effect  key desirable property of encryption alg where a change of  one  input or key bit results in changing approx  half  output bits making attempts to “home-in” by guessing keys impossible DES exhibits strong avalanche
Strength of DES – Timing Attacks attacks actual implementation of cipher use knowledge of consequences of implementation to derive information about  some/all subkey bits specifically use fact that calculations can take varying times depending on the value of the inputs to it
 
 
Origins clear a replacement for DES was needed have theoretical attacks that can break it have demonstrated exhaustive key search attacks can use Triple-DES – but slow, has small blocks US NIST issued call for ciphers in 1997 15 candidates accepted in Jun 98  5 were shortlisted in Aug-99  Rijndael was selected as the AES in Oct-2000 issued as FIPS PUB 197 standard in Nov-2001
AES Requirements private key symmetric block cipher  128-bit data, 128/192/256-bit keys  stronger & faster than Triple-DES  active life of 20-30 years (+ archival use)  provide full specification & design details  both C & Java implementations NIST have released all submissions & unclassified analyses
AES Evaluation Criteria initial criteria: security – effort for practical cryptanalysis cost – in terms of computational efficiency algorithm & implementation characteristics final criteria general security ease of software & hardware implementation implementation attacks flexibility (in en/decrypt, keying, other factors)
AES Shortlist after testing and evaluation, shortlist in Aug-99:  MARS (IBM) - complex, fast, high security margin  RC6 (USA) - v. simple, v. fast, low security margin  Rijndael (Belgium) - clean, fast, good security margin  Serpent (Euro) - slow, clean, v. high security margin  Twofish (USA) - complex, v. fast, high security margin  then subject to further analysis & comment saw contrast between algorithms with  few complex rounds verses many simple rounds  which refined existing ciphers verses new proposals
The AES Cipher - Rijndael  designed by Rijmen-Daemen in Belgium  has 128/192/256 bit keys, 128 bit data  an  iterative  rather than  feistel  cipher processes  data as block of 4 columns of 4 bytes operates on entire data block in every round designed to be: resistant against known attacks speed and code compactness on many CPUs design simplicity
Rijndael data block of  4 columns of 4 bytes is state key is expanded to array of words has 10/12/14 rounds in which state undergoes:  byte substitution (1 S-box used on every byte)  shift rows (permute bytes between groups/columns)  mix columns (subs using matrix multipy of groups)  add round key (XOR state with key material) view as alternating XOR key & scramble data bytes initial XOR key material & incomplete last round with fast XOR & table lookup implementation
AES Bytes and Words Blocks represented as  arrays  of smaller groups of bits Byte : 8 bits Word : 32 bits  (4 bytes in word)
AES States Each word (each 4 bytes) corresponds to  column  in state Used to simplify mathematics
AES Structure
AES Round Structure SubBytes : Each byte transformed by an  S-Box ShiftRows : Permutation to swap  bytes  around MixColumns : Matrix multiplication to permute  bits  within bytes AddRoundKey : XOR result with current round key Notes:  Extra AddRoundKey before first round No MixColumns in last round
Rijndael
Byte Substitution 128-bit input    16 bytes a simple substitution of each byte uses one table of 16x16 bytes containing a permutation of all 256 8-bit values each byte of state is replaced by byte indexed by row (left 4-bits) & column (right 4-bits) eg. byte {95} is replaced by byte in row 9 column 5 which has value {2A} S-box constructed using defined transformation of values in GF(2 8 ) designed to be resistant to all known attacks
Byte Substitution
AES S-Box
S-Box Basis Inverse  of each byte computed in GF(2 8 ) using x 8  + x 4  + x 3  + x+1 Additional  confusion  created by array multiplication and addition Multiplication/addition in  mod 2 Resulting byte with bits  b 0  – b 7   multiplied by 8 x 8 matrix  X Each output bit  c j   is effectively  xor  of different  b i ’s Resulting byte with bits  c 0  – c 7   added to 8 x 1 matrix  d  Has effect of  inverting  bits  0, 1, 5,  and  6
Inverse S-Box Subtract matrix  d Multiply by inverse of matrix  X Invert in GF(2 8 )
Shift Rows Stage Goal: Swap  bytes   around within a state State = bytes arranged in  columns Shift  rows  around within this 2 dimensional structure to add diffusion
ShiftRows Stage Left Circular shift  used on each row Each row shifted by  different  number of bytes Inverse just  reverses  shift (right)
Shift Rows
ShiftRows Example Input:  63F2C9FA C9F2C963FE637D823026D4D4 Output:  63F27DD4C963D4FAFE26C96330F2C982 Shift 0 Shift 1 Shift 2 Shift 3
 
 
Modes of Operation block ciphers encrypt fixed size blocks eg. DES encrypts 64-bit blocks with 56-bit key  need some way to en/decrypt arbitrary amounts of data in practise ANSI X3.106-1983 Modes of Use  (now FIPS 81)   defines 4 possible modes subsequently 5 defined for AES & DES have  block  and  stream  modes
Electronic Codebook Book (ECB) message is broken into independent blocks which are encrypted  each block is a value which is substituted, like a codebook, hence name  each block is encoded independently of the other blocks  C i  = DES K1 (P i ) uses: secure transmission of single values
Electronic Codebook (ECB)
Advantages & Limitations of ECB message repetitions may show in ciphertext  if aligned with message block  particularly with data such graphics  or with messages that change very little, which become a code-book analysis problem  weakness is due to the encrypted message blocks being independent  Error propagation (no), parallel processing (yes), random access of data filed/ database fields (yes) main use is sending a few blocks of data
Cipher Block Chaining (CBC)  message is broken into blocks  linked together in encryption operation  each previous cipher blocks is chained with current plaintext block, hence name  use Initial Vector (IV) to start process  C i  = DES K1 (P i  XOR C i-1 ) C -1  = IV   uses: bulk data encryption, authentication
Cipher Block Chaining (CBC)
Message Padding at end of message must handle a possible last short block  which is not as large as blocksize of cipher pad either with known non-data value (eg nulls) or pad last block along with count of pad size   eg. [ b1 b2 b3 0 0 0 0 5]  means have 3 data bytes, then 5 bytes pad+count this may require an extra entire block over those in message there are other, more esoteric modes, which avoid the need for an extra block
Advantages & Limitations of CBC a ciphertext block depends on  all  blocks before it any change to a block affects all following ciphertext blocks Error propagate(yes), Parallel process (no), Random access (no) need  Initialization Vector  (IV)  which must be known to sender & receiver  if sent in clear, attacker can change bits of first block, and change IV to compensate  hence IV must either be a fixed value or must be sent encrypted in ECB mode before rest of message
Cipher FeedBack (CFB) message is treated as a stream of bits  added to the output of the block cipher  result is feed back for next stage (hence name)  standard allows any number of bits (1,8, 64 or 128 etc) to be fed back  denoted CFB-1, CFB-8, CFB-64, CFB-128 etc  most efficient to use all bits in block (64 or 128) C i  = P i  XOR DES K1 (C i-1 ) C -1  = IV   uses: stream data encryption, authentication
Cipher FeedBack (CFB)
Advantages & Limitations of CFB appropriate when data arrives in bits/bytes  most common stream mode  limitation is need to stall while do block encryption after every n-bits  note that the block cipher is used in  encryption  mode at  both  ends  errors propagate for several blocks after the error
Output FeedBack (OFB) message is treated as a stream of bits  output of cipher is added to message  output is then fed back (hence name)  feedback is independent of message  can be computed in advance C i  = P i  XOR O i   O i  = DES K1 (O i-1 ) O -1  = IV uses: stream encryption on noisy channels
Output FeedBack (OFB)
Advantages & Limitations of OFB bit errors do not propagate  more vulnerable to message stream modification a variation of a Vernam cipher  hence must  never  reuse the same sequence (key+IV)  sender & receiver must remain in sync originally specified with m-bit feedback subsequent research has shown that only  full block feedback  (ie CFB-64 or CFB-128) should ever be used
Counter (CTR) a “new” mode, though proposed early on Same plaintext block NOT same cipertext block similar to OFB but encrypts counter value rather than any feedback value must have a different key & counter value for every plaintext block (never reused) C i  = P i  XOR O i   O i  = DES K1 (i) No Error propagation uses: high-speed network encryptions
Counter (CTR)
Advantages and Limitations of CTR efficiency can do parallel encryptions in h/w or s/w can preprocess in advance of need good for bursty high speed links random access to encrypted data blocks provable security (good as other modes) but must ensure never reuse key/counter values, otherwise could break (cf OFB)
 
Stream Ciphers process message bit by bit (as a stream)  have a pseudo random  keystream combined (XOR) with plaintext bit by bit  randomness of  stream key  completely destroys statistically properties in message   C i  = M i  XOR StreamKey i   but must never reuse stream key otherwise can recover messages (cf book cipher)
Stream Cipher Structure

More Related Content

What's hot (20)

PPTX
Information and data security advanced encryption standard (aes)
Mazin Alwaaly
 
PPT
DES (Data Encryption Standard) pressentation
sarhadisoftengg
 
PPTX
Modes of Operation
Showkot Usman
 
PPT
Class3
ankitasinghbsc
 
PPT
block ciphers
Asad Ali
 
PDF
Block Cipher Modes of Operation And Cmac For Authentication
Vittorio Giovara
 
PDF
Block Ciphers and the Data Encryption Standard
Dr.Florence Dayana
 
PPTX
Block cipher modes of operation
harshit chavda
 
PPTX
Advanced encryption standard (aes)
farazvirk554
 
PPTX
Trible data encryption standard (3DES)
Ahmed Mohamed Mahmoud
 
PPTX
Unit 2
KRAMANJANEYULU1
 
PPT
Block Ciphers Modes of Operation
Shafaan Khaliq Bhatti
 
PPTX
ASIC Implementation of Triple Data Encryption Algorithm (3DES)
Kevin Xiao Xiao
 
PPTX
Cryptographic Algorithms: DES and RSA
aritraranjan
 
PPTX
Symmetric encryption
DR RICHMOND ADEBIAYE
 
PPTX
Network Security - Block cipher
Ashish Duggal
 
PDF
Block Ciphers Modes of Operation
Roman Oliynykov
 
PPT
Block Cipher and its Design Principles
SHUBHA CHATURVEDI
 
PPT
Design and Simulation Triple-DES
chatsiri
 
PDF
Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...
JAINAM KAPADIYA
 
Information and data security advanced encryption standard (aes)
Mazin Alwaaly
 
DES (Data Encryption Standard) pressentation
sarhadisoftengg
 
Modes of Operation
Showkot Usman
 
block ciphers
Asad Ali
 
Block Cipher Modes of Operation And Cmac For Authentication
Vittorio Giovara
 
Block Ciphers and the Data Encryption Standard
Dr.Florence Dayana
 
Block cipher modes of operation
harshit chavda
 
Advanced encryption standard (aes)
farazvirk554
 
Trible data encryption standard (3DES)
Ahmed Mohamed Mahmoud
 
Block Ciphers Modes of Operation
Shafaan Khaliq Bhatti
 
ASIC Implementation of Triple Data Encryption Algorithm (3DES)
Kevin Xiao Xiao
 
Cryptographic Algorithms: DES and RSA
aritraranjan
 
Symmetric encryption
DR RICHMOND ADEBIAYE
 
Network Security - Block cipher
Ashish Duggal
 
Block Ciphers Modes of Operation
Roman Oliynykov
 
Block Cipher and its Design Principles
SHUBHA CHATURVEDI
 
Design and Simulation Triple-DES
chatsiri
 
Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...
JAINAM KAPADIYA
 

Similar to Network Security Lec4 (20)

PDF
Computer security module 2
Deepak John
 
PPTX
Module 1-Block Ciphers and the Data Encryption Standard.pptx
SridharCS7
 
PPT
Cryptography and Network Security William Stallings Lawrie Brown
Information Security Awareness Group
 
PPT
cryptography and network security chap 3
Debanjan Bhattacharya
 
PPT
DES.ppt
RizwanBasha12
 
PDF
chap3.pdf
NickySanthosh1
 
PPT
Advanced Encryption System - Network and Security.ppt
VimalAadhithan
 
PPT
ch03 network security in computer sys.ppt
ubaidullah75790
 
PPT
Advanced Encryption Standard presentation slide
ssr978534
 
PDF
sheet7.pdf
aminasouyah
 
PDF
paper7.pdf
aminasouyah
 
PDF
lecture6.pdf
aminasouyah
 
PDF
doc7.pdf
aminasouyah
 
PPT
unit 2.ppt
DHANABALSUBRAMANIAN
 
PPTX
Stream Ciphers and Block Ciphers in Security.pptx
Vivekananda Gn
 
PPT
Jaimin chp-8 - network security-new -use this - 2011 batch
Jaimin Jani
 
PPT
AES Cryptosystem
هيثم فرج
 
Computer security module 2
Deepak John
 
Module 1-Block Ciphers and the Data Encryption Standard.pptx
SridharCS7
 
Cryptography and Network Security William Stallings Lawrie Brown
Information Security Awareness Group
 
cryptography and network security chap 3
Debanjan Bhattacharya
 
DES.ppt
RizwanBasha12
 
chap3.pdf
NickySanthosh1
 
Advanced Encryption System - Network and Security.ppt
VimalAadhithan
 
ch03 network security in computer sys.ppt
ubaidullah75790
 
Advanced Encryption Standard presentation slide
ssr978534
 
sheet7.pdf
aminasouyah
 
paper7.pdf
aminasouyah
 
lecture6.pdf
aminasouyah
 
doc7.pdf
aminasouyah
 
Stream Ciphers and Block Ciphers in Security.pptx
Vivekananda Gn
 
Jaimin chp-8 - network security-new -use this - 2011 batch
Jaimin Jani
 
AES Cryptosystem
هيثم فرج
 
Ad

More from Federal Urdu University (20)

PDF
Ntc internship report
Federal Urdu University
 
PDF
Network security at_osi_layers
Federal Urdu University
 
PPT
Network Security Lec5
Federal Urdu University
 
PPT
Network Security
Federal Urdu University
 
DOCX
Os Linux Documentation
Federal Urdu University
 
PPSX
Maria Managment Spectrum
Federal Urdu University
 
PPSX
Zohaib Dfd
Federal Urdu University
 
PPSX
Zeeshan Estimation
Federal Urdu University
 
PPSX
Sohrab Waterfall Vs Rad
Federal Urdu University
 
PPSX
Sidra Agile Software Process
Federal Urdu University
 
PPSX
Muzammil Prescriptive Vs Agile Process Models
Federal Urdu University
 
DOC
Muzammil Agile Vs Prescriptive
Federal Urdu University
 
PPSX
Khurram Spiral
Federal Urdu University
 
PPSX
Faisal Incremental Model
Federal Urdu University
 
Ntc internship report
Federal Urdu University
 
Network security at_osi_layers
Federal Urdu University
 
Network Security Lec5
Federal Urdu University
 
Network Security
Federal Urdu University
 
Os Linux Documentation
Federal Urdu University
 
Maria Managment Spectrum
Federal Urdu University
 
Zeeshan Estimation
Federal Urdu University
 
Sohrab Waterfall Vs Rad
Federal Urdu University
 
Sidra Agile Software Process
Federal Urdu University
 
Muzammil Prescriptive Vs Agile Process Models
Federal Urdu University
 
Muzammil Agile Vs Prescriptive
Federal Urdu University
 
Khurram Spiral
Federal Urdu University
 
Faisal Incremental Model
Federal Urdu University
 
Ad

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PPTX
AVL ( audio, visuals or led ), technology.
Rajeshwri Panchal
 
PPTX
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PPTX
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
AVL ( audio, visuals or led ), technology.
Rajeshwri Panchal
 
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 

Network Security Lec4

  • 2.  
  • 3. Data Encryption Standard (DES) most widely used block cipher in world adopted in 1977 by NBS (now NIST) as FIPS PUB 46 encrypts 64-bit data using 56-bit key has widespread use has been considerable controversy over its security
  • 5.  
  • 6. DES Round Structure uses two 32-bit L & R halves as for any Feistel cipher can describe as: L i = R i –1 R i = L i –1  F( R i –1 , K i ) F takes 32-bit R half and 48-bit subkey: expands R to 48-bits using perm E adds to subkey using XOR passes through 8 S-boxes to get 32-bit result finally permutes using 32-bit perm P
  • 7.  
  • 8.  
  • 9. Substitution Boxes (S-box) have eight S-boxes which map 6 to 4 bits each S-box is actually 6 x 4 bit boxes outer bits 1 & 6 ( row bits) select one row of 4 inner bits 2-5 ( col bits) are substituted result is 8 lots of 4 bits, or 32 bits row selection depends on both data & key feature known as autoclaving (autokeying) example: S(18 09 12 3d 11 17 38 39) = 5fd25e03
  • 11.  
  • 12.  
  • 13. DES Key Schedule forms subkeys used in each round initial permutation of the key (PC1) which selects 56-bits in two 28-bit halves 16 stages consisting of: rotating each half separately either 1 or 2 places depending on the key rotation schedule K selecting 28-bits from each half & compression permuting them (56 to 48) by PC2 for use in round function F note practical use issues in h/w vs s/w
  • 14.  
  • 15.  
  • 16.  
  • 17.  
  • 18. DES Decryption decrypt must unwind steps of data computation with Feistel design, do encryption steps again using subkeys in reverse order (SK16 … SK1) IP undoes final FP step of encryption 1st round with SK16 undoes 16th encrypt round … . 16th round with SK1 undoes 1st encrypt round then final FP undoes initial encryption IP thus recovering original data value
  • 19. Strength of DES – Key Size 56-bit keys have 2 56 = 7.2 x 10 16 values brute force search looks hard recent advances have shown is possible in 1997 on Internet in a few months in 1998 on dedicated h/w (EFF) in a few days in 1999 above combined in 22hrs! still must be able to recognize plaintext must now consider alternatives to DES
  • 20. DES Design Criteria as reported by Coppersmith in [COPP94] S-boxes provide for non-linearity resistance to differential cryptanalysis good confusion criteria for permutation P provide for increased diffusion
  • 21. Block Cipher Design basic principles still like Feistel’s in 1970’s number of rounds more is better, exhaustive search best attack function f: provides “confusion”, is nonlinear, avalanche have issues of how S-boxes are selected key schedule complex subkey creation, key avalanche
  • 22. Strength of DES – Analytic Attacks now have several analytic attacks on DES these utilise some deep structure of the cipher by gathering information about encryptions can eventually recover some/all of the sub-key bits if necessary then exhaustively search for the rest generally these are statistical attacks include differential cryptanalysis linear cryptanalysis
  • 23. Avalanche Effect key desirable property of encryption alg where a change of one input or key bit results in changing approx half output bits making attempts to “home-in” by guessing keys impossible DES exhibits strong avalanche
  • 24. Strength of DES – Timing Attacks attacks actual implementation of cipher use knowledge of consequences of implementation to derive information about some/all subkey bits specifically use fact that calculations can take varying times depending on the value of the inputs to it
  • 25.  
  • 26.  
  • 27. Origins clear a replacement for DES was needed have theoretical attacks that can break it have demonstrated exhaustive key search attacks can use Triple-DES – but slow, has small blocks US NIST issued call for ciphers in 1997 15 candidates accepted in Jun 98 5 were shortlisted in Aug-99 Rijndael was selected as the AES in Oct-2000 issued as FIPS PUB 197 standard in Nov-2001
  • 28. AES Requirements private key symmetric block cipher 128-bit data, 128/192/256-bit keys stronger & faster than Triple-DES active life of 20-30 years (+ archival use) provide full specification & design details both C & Java implementations NIST have released all submissions & unclassified analyses
  • 29. AES Evaluation Criteria initial criteria: security – effort for practical cryptanalysis cost – in terms of computational efficiency algorithm & implementation characteristics final criteria general security ease of software & hardware implementation implementation attacks flexibility (in en/decrypt, keying, other factors)
  • 30. AES Shortlist after testing and evaluation, shortlist in Aug-99: MARS (IBM) - complex, fast, high security margin RC6 (USA) - v. simple, v. fast, low security margin Rijndael (Belgium) - clean, fast, good security margin Serpent (Euro) - slow, clean, v. high security margin Twofish (USA) - complex, v. fast, high security margin then subject to further analysis & comment saw contrast between algorithms with few complex rounds verses many simple rounds which refined existing ciphers verses new proposals
  • 31. The AES Cipher - Rijndael designed by Rijmen-Daemen in Belgium has 128/192/256 bit keys, 128 bit data an iterative rather than feistel cipher processes data as block of 4 columns of 4 bytes operates on entire data block in every round designed to be: resistant against known attacks speed and code compactness on many CPUs design simplicity
  • 32. Rijndael data block of 4 columns of 4 bytes is state key is expanded to array of words has 10/12/14 rounds in which state undergoes: byte substitution (1 S-box used on every byte) shift rows (permute bytes between groups/columns) mix columns (subs using matrix multipy of groups) add round key (XOR state with key material) view as alternating XOR key & scramble data bytes initial XOR key material & incomplete last round with fast XOR & table lookup implementation
  • 33. AES Bytes and Words Blocks represented as arrays of smaller groups of bits Byte : 8 bits Word : 32 bits (4 bytes in word)
  • 34. AES States Each word (each 4 bytes) corresponds to column in state Used to simplify mathematics
  • 36. AES Round Structure SubBytes : Each byte transformed by an S-Box ShiftRows : Permutation to swap bytes around MixColumns : Matrix multiplication to permute bits within bytes AddRoundKey : XOR result with current round key Notes: Extra AddRoundKey before first round No MixColumns in last round
  • 38. Byte Substitution 128-bit input  16 bytes a simple substitution of each byte uses one table of 16x16 bytes containing a permutation of all 256 8-bit values each byte of state is replaced by byte indexed by row (left 4-bits) & column (right 4-bits) eg. byte {95} is replaced by byte in row 9 column 5 which has value {2A} S-box constructed using defined transformation of values in GF(2 8 ) designed to be resistant to all known attacks
  • 41. S-Box Basis Inverse of each byte computed in GF(2 8 ) using x 8 + x 4 + x 3 + x+1 Additional confusion created by array multiplication and addition Multiplication/addition in mod 2 Resulting byte with bits b 0 – b 7 multiplied by 8 x 8 matrix X Each output bit c j is effectively xor of different b i ’s Resulting byte with bits c 0 – c 7 added to 8 x 1 matrix d Has effect of inverting bits 0, 1, 5, and 6
  • 42. Inverse S-Box Subtract matrix d Multiply by inverse of matrix X Invert in GF(2 8 )
  • 43. Shift Rows Stage Goal: Swap bytes around within a state State = bytes arranged in columns Shift rows around within this 2 dimensional structure to add diffusion
  • 44. ShiftRows Stage Left Circular shift used on each row Each row shifted by different number of bytes Inverse just reverses shift (right)
  • 46. ShiftRows Example Input: 63F2C9FA C9F2C963FE637D823026D4D4 Output: 63F27DD4C963D4FAFE26C96330F2C982 Shift 0 Shift 1 Shift 2 Shift 3
  • 47.  
  • 48.  
  • 49. Modes of Operation block ciphers encrypt fixed size blocks eg. DES encrypts 64-bit blocks with 56-bit key need some way to en/decrypt arbitrary amounts of data in practise ANSI X3.106-1983 Modes of Use (now FIPS 81) defines 4 possible modes subsequently 5 defined for AES & DES have block and stream modes
  • 50. Electronic Codebook Book (ECB) message is broken into independent blocks which are encrypted each block is a value which is substituted, like a codebook, hence name each block is encoded independently of the other blocks C i = DES K1 (P i ) uses: secure transmission of single values
  • 52. Advantages & Limitations of ECB message repetitions may show in ciphertext if aligned with message block particularly with data such graphics or with messages that change very little, which become a code-book analysis problem weakness is due to the encrypted message blocks being independent Error propagation (no), parallel processing (yes), random access of data filed/ database fields (yes) main use is sending a few blocks of data
  • 53. Cipher Block Chaining (CBC) message is broken into blocks linked together in encryption operation each previous cipher blocks is chained with current plaintext block, hence name use Initial Vector (IV) to start process C i = DES K1 (P i XOR C i-1 ) C -1 = IV uses: bulk data encryption, authentication
  • 55. Message Padding at end of message must handle a possible last short block which is not as large as blocksize of cipher pad either with known non-data value (eg nulls) or pad last block along with count of pad size eg. [ b1 b2 b3 0 0 0 0 5] means have 3 data bytes, then 5 bytes pad+count this may require an extra entire block over those in message there are other, more esoteric modes, which avoid the need for an extra block
  • 56. Advantages & Limitations of CBC a ciphertext block depends on all blocks before it any change to a block affects all following ciphertext blocks Error propagate(yes), Parallel process (no), Random access (no) need Initialization Vector (IV) which must be known to sender & receiver if sent in clear, attacker can change bits of first block, and change IV to compensate hence IV must either be a fixed value or must be sent encrypted in ECB mode before rest of message
  • 57. Cipher FeedBack (CFB) message is treated as a stream of bits added to the output of the block cipher result is feed back for next stage (hence name) standard allows any number of bits (1,8, 64 or 128 etc) to be fed back denoted CFB-1, CFB-8, CFB-64, CFB-128 etc most efficient to use all bits in block (64 or 128) C i = P i XOR DES K1 (C i-1 ) C -1 = IV uses: stream data encryption, authentication
  • 59. Advantages & Limitations of CFB appropriate when data arrives in bits/bytes most common stream mode limitation is need to stall while do block encryption after every n-bits note that the block cipher is used in encryption mode at both ends errors propagate for several blocks after the error
  • 60. Output FeedBack (OFB) message is treated as a stream of bits output of cipher is added to message output is then fed back (hence name) feedback is independent of message can be computed in advance C i = P i XOR O i O i = DES K1 (O i-1 ) O -1 = IV uses: stream encryption on noisy channels
  • 62. Advantages & Limitations of OFB bit errors do not propagate more vulnerable to message stream modification a variation of a Vernam cipher hence must never reuse the same sequence (key+IV) sender & receiver must remain in sync originally specified with m-bit feedback subsequent research has shown that only full block feedback (ie CFB-64 or CFB-128) should ever be used
  • 63. Counter (CTR) a “new” mode, though proposed early on Same plaintext block NOT same cipertext block similar to OFB but encrypts counter value rather than any feedback value must have a different key & counter value for every plaintext block (never reused) C i = P i XOR O i O i = DES K1 (i) No Error propagation uses: high-speed network encryptions
  • 65. Advantages and Limitations of CTR efficiency can do parallel encryptions in h/w or s/w can preprocess in advance of need good for bursty high speed links random access to encrypted data blocks provable security (good as other modes) but must ensure never reuse key/counter values, otherwise could break (cf OFB)
  • 66.  
  • 67. Stream Ciphers process message bit by bit (as a stream) have a pseudo random keystream combined (XOR) with plaintext bit by bit randomness of stream key completely destroys statistically properties in message C i = M i XOR StreamKey i but must never reuse stream key otherwise can recover messages (cf book cipher)

Editor's Notes

  • #4: The most widely used private key block cipher, is the Data Encryption Standard (DES). It was adopted in 1977 by the National Bureau of Standards as Federal Information Processing Standard 46 (FIPS PUB 46). DES encrypts data in 64-bit blocks using a 56-bit key. The DES enjoys widespread use. It has also been the subject of much controversy its security.
  • #5: The overall scheme for DES encryption is illustrated in Stallings Figure3.4, which takes as input 64-bits of data and of key. The left side shows the basic process for enciphering a 64-bit data block which consists of: - an initial permutation (IP) which shuffles the 64-bit input block - 16 rounds of a complex key dependent round function involving substitutions & permutations - a final permutation, being the inverse of IP The right side shows the handling of the 56-bit key and consists of: - an initial permutation of the key (PC1) which selects 56-bits out of the 64-bits input, in two 28-bit halves - 16 stages to generate the 48-bit subkeys using a left circular shift and a permutation of the two 28-bit halves
  • #7: Detail here the internal structure of the DES round function F, which takes R half & subkey, and processes them through E, add subkey, S & P. This follows the classic structure for a feistel cipher. Note that the s-boxes provide the “confusion” of data and key values, whilst the permutation P then spreads this as widely as possible, so each S-box output affects as many S-box inputs in the next round as possible, giving “diffusion”.
  • #10: The substitution consists of a set of eight S-boxes, each of which accepts 6 bits as input and produces 4 bits as output. These transformations are defined in Stallings Table 3.3, which is interpreted as follows: The first and last bits of the input to box S i form a 2-bit binary number to select one of four substitutions defined by the four rows in the table for S i . The middle four bits select one of the sixteen columns. The decimal value in the cell selected by the row and column is then converted to its 4-bit representation to produce the output. For example, in S1, for input 011001, the row is 01 (row 1) and the column is 1100 (column 12). The value in row 1, column 12 is 9, so the output is 1001. The example lists 8 6-bit values (ie 18 in hex is 011000 in binary, 09 hex is 001001 binary, 12 hex is 010010 binary, 3d hex is 111101 binary etc), each of which is replaced following the process detailed above using the appropriate S-box. ie S1(011000) lookup row 00 col 1100 in S1 to get 5 S2(001001) lookup row 01 col 0100 in S2 to get 15 = f in hex S3(010010) lookup row 00 col 1001 in S3 to get 13 = d in hex S4(111101) lookup row 11 col 1110 in S4 to get 2 etc
  • #11: Stallings Figure 3.6 illustrates the internal structure of the DES round function F. The R input is first expanded to 48 bits by using expansion table E that defines a permutation plus an expansion that involves duplication of 16 of the R bits (Stallings Table 3.2c). The resulting 48 bits are XORed with Ki. This 48-bit result passes through a substitution function comprising 8 S-boxes which each map 6 input bits to 4 output bits, producing a 32-bit output, which is then permuted by permutation P as defined by Stallings Table 3.2d.
  • #14: The DES Key Schedule generates the subkeys needed for each data encryption round. The 64-bit key input is first processed by Permuted Choice One (Stallings Table 3.4b). The resulting 56-bit key is then treated as two 28-bit quantities C & D. In each round, these are separately processed throgh a circular left shift (rotation) of 1 or 2bits as shown in Stallings Table 3.4d. These shifted values serve as input to the next round of the key schedule. They also serve as input to Permuted Choice Two (Stallings Table 3.4c), which produces a 48-bit output that serves as input to the round function F. The 56 bit key size comes from security considerations as we know now. It was big enough so that an exhaustive key search was about as hard as the best direct attack (a form of differential cryptanalysis called a T-attack, known by the IBM & NSA researchers), but no bigger. The extra 8 bits were then used as parity (error detecting) bits, which makes sense given the original design use for hardware communications links. However we hit an incompatibility with simple s/w implementations since the top bit in each byte is 0 (since ASCII only uses 7 bits), but the DES key schedule throws away the bottom bit! A good implementation needs to be cleverer!
  • #19: As with any Feistel cipher, DES decryption uses the same algorithm as encryption except that the subkeys are used in reverse order SK16 .. SK1. If you trace through the DES overview diagram can see how each decryption step top to bottom with reversed subkeys, undoes the equivalent encryption step moving from bottom to top.
  • #20: Since its adoption as a federal standard, there have been lingering concerns about the level of security provided by DES in two areas: key size and the nature of the algorithm. With a key length of 56 bits, there are 2^56 possible keys, which is approximately 7.2*10^16 keys. Thus a brute-force attack appeared impractical. However DES was finally and definitively proved insecure in July 1998, when the Electronic Frontier Foundation (EFF) announced that it had broken a DES encryption using a special-purpose "DES cracker" machine that was built for less than $250,000. The attack took less than three days. The EFF has published a detailed description of the machine, enabling others to build their own cracker [EFF98]. There have been other demonstrated breaks of the DES using both large networks of computers & dedicated h/w, including: - 1997 on a large network of computers in a few months - 1998 on dedicated h/w (EFF) in a few days - 1999 above combined in 22hrs! It is important to note that there is more to a key-search attack than simply running through all possible keys. Unless known plaintext is provided, the analyst must be able to recognize plaintext as plaintext. Clearly must now consider alternatives to DES , the most important of which are AES and triple DES.
  • #21: Although much progress has been made in designing block ciphers that are cryptographically strong, the basic principles have not changed all that much since the work of Feistel and the DES design team in the early 1970s. Some of the criteria used in the design of DES were reported in [COPP94], and focused on the design of the S-boxes and on the P function that distributes the output of the S boxes, as summarized above. See text for further details.
  • #22: The cryptographic strength of a Feistel cipher derives from three aspects of the design: the number of rounds, the function F, and the key schedule algorithm. Briefly discuss these. The greater the number of rounds, the more difficult it is to perform cryptanalysis, even for a relatively weak F. In general, the criterion should be that the number of rounds is chosen so that known cryptanalytic efforts require greater effort than a simple brute-force key search attack. This criterion is attractive because it makes it easy to judge the strength of an algorithm and to compare different algorithms. The function F provides the element of confusion in a Feistel cipher, want it to be difficult to “unscramble” the substitution performed by F. One obvious criterion is that F be nonlinear. The more nonlinear F, the more difficult any type of cryptanalysis will be. We would like it to have good avalanche properties, or even the strict avalanche criterion (SAC). Another criterion is the bit independence criterion (BIC). One of the most intense areas of research in the field of symmetric block ciphers is that of S-box design. Would like any change to the input vector to an S-box to result in random-looking changes to the output. The relationship should be nonlinear and difficult to approximate with linear functions. A final area of block cipher design, and one that has received less attention than S-box design, is the key schedule algorithm. With any Feistel block cipher, the key schedule is used to generate a subkey for each round. Would like to select subkeys to maximize the difficulty of deducing individual subkeys and the difficulty of working back to the main key. The key schedule should guarantee key/ciphertext Strict Avalanche Criterion and Bit Independence Criterion.
  • #23: Another concern is the possibility that cryptanalysis is possible by exploiting the characteristics of the DES algorithm. The focus of concern has been on the eight substitution tables, or S-boxes, that are used in each iteration. These techniques utilise some deep structure of the cipher by gathering information about encryptions so that eventually you can recover some/all of the sub-key bits, and then exhaustively search for the rest if necessary. Generally these are statistical attacks which depend on the amount of information gathered for their likelihood of success. Attacks of this form include differential cryptanalysis. linear cryptanalysis, and related key attacks.
  • #24: A desirable property of any encryption algorithm is that a small change in either the plaintext or the key should produce a significant change in the ciphertext. In particular, a change in one bit of the plaintext or one bit of the key should produce a change in many bits of the ciphertext. If the change were small, this might provide a way to reduce the size of the plaintext or key space to be searched. DES exhibits a strong avalanche effect, as may be seen in Stallings Table 3.5.
  • #25: We will discuss timing attacks in more detail later, as they relate to public-key algorithms. However,the issue may also be relevant for symmetric ciphers. A timing attack is one in which information about the key or the plaintext is obtained by observing how long it takes a given implementation to perform decryptions on various ciphertexts. A timing attack exploits the fact that an encryption or decryption algorithm often takes slightly different amounts of time on different inputs. The AES analysis process has highlighted this attack approach, and showed that it is a concern particularly with smartcard implementations, though DES appears to be fairly resistant to a successful timing attack.
  • #28: The Advanced Encryption Standard (AES) was published by NIST (National Institute of Standards and Technology) in 2001. AES is a symmetric block cipher that is intended to replace DES as the approved standard for a wide range of applications. The AES cipher (& other candidates) form the latest generation of block ciphers, and now we see a significant increase in the block size - from the old standard of 64-bits up to 128-bits; and keys from 128 to 256-bits. In part this has been driven by the public demonstrations of exhaustive key searches of DES. Whilst triple-DES is regarded as secure and well understood, it is slow, especially in s/w. In a first round of evaluation, 15 proposed algorithms were accepted. A second round narrowed the field to 5 algorithms. NIST completed its evaluation process and published a final standard (FIPS PUB 197) in November of 2001. NIST selected Rijndael as the proposed AES algorithm. The two researchers who developed and submitted Rijndael for the AES are both cryptographers from Belgium: Dr. Joan Daemen and Dr.Vincent Rijmen.
  • #29: Listed above are NIST’s requirements for the AES candidate submissions. These criteria span the range of concerns for the practical application of modern symmetric block ciphers.
  • #30: In fact, two set of criteria evolved. When NIST issued its original request for candidate algorithm nominations in 1997, the request stated that candidate algorithms would be compared based on the factors shown in Stallings Table5.1, which were used to evaluate field of 15 candidates to select shortlist of 5. These had categories of security, cost, and algorithm & implementation characteristics. The final criteria evolved during the evaluation process, and were used to select Rijndael from that short-list, and more details are given in Stallings Table 5.2, with categories of: general security, ease of software & hardware implementation, implementation attacks, & flexibility (in en/decrypt, keying, other factors).
  • #31: The AES shortlist of 5 ciphers was as shown. Note mix of commercial (MARS, RC6, Twofish) verses academic (Rijndael, Serpent) proposals, sourced from various countries. All were thought to be good – it came down to the best balance of attributes to meet criteria, in particular the balance between speed, security & flexibility.
  • #32: The Rijndael proposal for AES defined a cipher in which the block length and the key length can be independently specified to be 128,192,or 256 bits. The AES specification uses the same three key size alternatives but limits the block length to 128 bits. Rijndael is an academic submission, based on the earlier Square cipher, from Belgium academics Dr Joan Daemen and Dr Vincent Rijmen. It is an iterative cipher (operates on entire data block in every round) rather than feistel (operate on halves at a time), and was designed to have characteristics of: Resistance against all known attacks, Speed and code compactness on a wide range of platforms, & Design simplicity.
  • #33: The input to the AES encryption and decryption algorithms is a single 128-bit block, depicted in FIPS PUB 197, as a square matrix of bytes .This block is copied into the State array, which is modified at each stage of encryption or decryption. After the final stage, State is copied to an output. The key is expanded into 44/52/60 lots of 32-bit words (see later), with 4 used in each round. The data computation then consists of an “add round key” step, then 9/11/13 rounds with all 4 steps, and a final 10 th /12 th /14 th step of byte subs + mix cols + add round key. This can be viewed as alternating XOR key & scramble data bytes operations. All of the steps are easily reversed, and can be efficiently implemented using XOR’s & table lookups.
  • #38: Stallings Figure 5.1 s hows the overall structure of AES, as detailed on the previous slide.
  • #39: Now discuss each of the four stages used in AES. The Substitute bytes stage uses an S-box to perform a byte-by-byte substitution of the block. There is a single 8-bit wide S-box used on every byte. This S-box is a permutation of all 256 8-bit values, constructed using a transformation which treats the values as polynomials in GF(2 8 ) – however it is fixed, so really only need to know the table when implementing. Decryption requires the inverse of the table. These tables are given in Stallings Table 4.5. The table was designed to be resistant to known cryptanalytic attacks. Specifically, the Rijndael developers sought a design that has a low correlation between input bits and output bits, with the property that the output cannot be described as a simple mathematical function of the input, with no fixed points and no “opposite fixed points”.
  • #40: As this diagram from Stallings Fig 5.4a shows, the Byte Substitution operates on each byte of state independently, with the input byte used to index a row/col in the table to retrieve the substituted value.
  • #46: Stalling Figure 5.5a illustrates the Shift Rows permutation.
  • #50: DES (or any block cipher) forms a basic building block, which en/decrypts a fixed sized block of data. However to use these in practise, we usually need to handle arbitrary amounts of data, which may be available in advance (in which case a block mode is appropriate), and may only be available a bit/byte at a time (in which case a stream mode is used). To apply a block cipher in a variety of applications, four “modes of operation” have been defined by NIST (FIPS 81). The four modes are intended to cover virtually all the possible applications of encryption for which a block cipher could be used. As new applications and requirements have appeared, NIST has expanded the list of recommended modes to five in Special Publication 800-38A. These modes are intended for use with any symmetric block cipher, including triple DES and AES.
  • #51: The simplest mode is the electronic codebook (ECB) mode, in which plaintext is handled one block at a time and each block of plaintext is encrypted using the same key. ECB is the simplest of the modes, and is used when only a single block of info needs to be sent (eg. a session key encrypted using a master key) .
  • #52: Stallings Figure 6.3 illustrates the Electronic Codebook (ECB) Mode.
  • #53: ECB is not appropriate for any quantity of data, since repetitions can be seen, esp. with graphics, and because the blocks can be shuffled/inserted without affecting the en/decryption of each block. Its main use is to send one or a very few blocks, eg a session encryption key.
  • #54: To overcome the problems of repetitions and order independence in ECB, want some way of making the ciphertext dependent on all blocks before it. This is what CBC gives us, by combining the previous ciphertext block with the current message block before encrypting. To start the process, use an Initial Value (IV), which is usually well known (often all 0's), or otherwise is sent, ECB encrypted, just before starting CBC use. CBC mode is applicable whenever large amounts of data need to be sent securely, provided that all data is available in advance (eg email, FTP, web etc).
  • #55: Stallings Figure 6.4 illustrates the Cipher Block Chaining (CBC) Mode.
  • #56: One issue that arises with block modes is how to handle the last block, which may well not be complete. In general have to pad this block (typically with 0's), and then must recognise padding at other end - may be obvious (eg in text the 0 value should usually not occur), or otherwise must explicitly have the last byte as a count of how much padding was used (including the count). Note that if this is done, if the last block IS an even multiple of 8 bytes or has exactly the same form as pad+count, then will have to add an extra block, all padding so as to have a count in the last byte. There are other, more esoteric, “ciphertext stealing” modes, which avoid the need for an extra block.
  • #57: CBC is the block mode generally used. The chaining provides an avalanche effect, which means the encrypted message cannot be changed or rearranged without totally destroying the subsequent data. However there is the issue of ensuring that the IV is either fixed or sent encrypted in ECB mode to stop attacks on 1st block.
  • #58: If the data is only available a bit/byte at a time (eg. terminal session, sensor value etc), then must use some other approach to encrypting it, so as not to delay the info. Idea here is to use the block cipher essentially as a pseudo-random number generator (see stream cipher lecture later) and to combine these "random" bits with the message. Note as mentioned before, XOR is an easily inverted operator (just XOR with same thing again to undo). Again start with an IV to get things going, then use the ciphertext as the next input. As originally defined, idea was to "consume" as much of the "random" output as needed for each message unit (bit/byte) before "bumping" bits out of the buffer and re-encrypting. This is wasteful though, and slows the encryption down as more encryptions are needed. An alternate way to think of it is to generate a block of "random" bits, consume them as message bits/bytes arrive, and when they're used up, only then feed a full block of ciphertext back. This is CFB-64 or CFB-128 mode (depending on the block size of the cipher used eg DES or AES respectively). CFB is the usual choice for quantities of stream oriented data, and for authentication use.
  • #59: Stallings Figure 6.5 illustrates the Cipher FeedBack (CFB) Mode.
  • #60: CFB is the usual stream mode. As long as can keep up with the input, doing encryptions every 8 bytes. A possible problem is that if its used over a "noisy" link, then any corrupted bit will destroy values in the current and next blocks (since the current block feeds as input to create the random bits for the next). So either must use over a reliable network transport layer (pretty usual) or use OFB.
  • #61: The alternative to CFB is OFB. Here the generation of the "random" bits is independent of the message being encrypted. The advantage is that firstly, they can be computed in advance, good for bursty traffic, and secondly, any bit error only affects a single bit. Thus this is good for noisy links (eg satellite TV transmissions etc).
  • #62: Stallings Figure 6.6 illustrates the Output FeedBack (OFB) Mode.
  • #63: One advantage of the OFB method is that bit errors in transmission do not propagate. The disadvantage of OFB is that it is more vulnerable to a message stream modification attack than is CFB. Since OFB is a Vernam cipher variant, the stream should never be used more than once (otherwise the 2 ciphertexts can be combined, cancelling these bits, and leaving a "book" cipher to solve). And sender & receiver need to remain in sync, or all data is lost. Also, research has shown that you should only ever use a full block feedback ie OFB-64/128 mode.
  • #64: The Counter (CTR) mode is a variant of OFB, but which encrypts a counter value (hence name). Although it was proposed many years before, it has only recently been standardized for use with AES along with the other existing 4 modes. It is being used with applications in ATM (asynchronous transfer mode) network security and IPSec (IP security). A counter, equal to the plaintext block size is used. The only requirement stated in SP 800-38A is that the counter value must be different for each plaintext block that is encrypted. Typically the counter is initialized to some value and then incremented by 1 for each subsequent block.
  • #65: Stallings Figure 6.7 illustrates the Counter (CTR) Mode.
  • #66: CTR mode has a number of advantages in parallel h/w & s/w efficiency, can preprocess the output values in advance of needing to encrypt, can get random access to encrypted data blocks, and is simple. But like OFB have issue of not reusing the same key+counter value.
  • #68: A typical stream cipher encrypts plaintext one byte (or bit) at a time, usually by XOR’ing with a pseudo-random keystream. The stream cipher is similar to the one-time pad discussed in Chapter 2. The difference is that a one-time pad uses a genuine random number stream, whereas a stream cipher uses a pseudorandom number stream. But rely on the randomness of stream key completely destroys statistically properties in message . However, you must never reuse a stream key since otherwise you can recover messages (as with a book cipher).
  • #69: Stallings Figure 6.8 illustrates the general structure of a stream cipher, where a key is input to a pseudorandom bit generator that produces an apparently random keystream of bits, and which are XOR’d with message to encrypt it, and XOR’d again to decrypt it by the receiver.