SlideShare a Scribd company logo
Modes of Operation
Topics
 Overview of Modes of Operation
 EBC, CBC, CFB, OFB, CTR
 Notes and Remarks on each modes
Modes of Operation
 Block ciphers encrypt fixed size blocks
 eg. DES encrypts 64-bit blocks, with 56-bit key
 Need way to use in practise, given usually have arbitrary
amount of information to encrypt
 Partition message into separate block for ciphering

 A mode of operation describes the process of encrypting
each of these blocks under a single key
 Some modes may use randomized addition input value
Quick History
 Early modes of operation: ECB, CBC, CFB,
OFB
 DES Modes of operation
http://www.itl.nist.gov/fipspubs/fip81.htm
 Revised and including CTR mode and AES
 Recommendation for Block Cipher Modes of Operation
http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf
 New Mode : XTS-AES
 Recommendation for Block Cipher Modes of Operation: The XTS-AES
Mode for Confidentiality on Storage Devices
http://csrc.nist.gov/publications/nistpubs/800-38E/nist-sp-800-38E.pdf
1981
2001
2010
Modes of operation are nowadays defined by a number of national and internationally
recognized standards bodies such as ISO, IEEE, ANSI and IETF. The most influential
source is the US NIST
Modes of Operation Taxonomy
 Current well-known modes of operation
Moe Technical Notes
 Initialize Vector (IV)
 a block of bits to randomize the encryption and hence to produce
distinct ciphertext
 Nonce : Number (used) Once
 Random of psuedorandom number to ensure that past communications
can not be reused in replay attacks
 Some also refer to initialize vector as nonce
 Padding
 final block may require a padding to fit a block size
 Method
 Add null Bytes
 Add 0x80 and many 0x00
 Add the n bytes with value n
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
Ci = EK (Pi)
 Uses: secure transmission of single values
Topics
 Overview of Modes of Operation
 EBC, CBC, CFB, OFB, CTR
 Notes and Remarks on each modes
ECB Scheme
Remarks on ECB
10
 Strength: it’s simple.
 Weakness:
 Repetitive information contained in the plaintext may show in
the ciphertext, if aligned with blocks.
 If the same message is encrypted (with the same key) and sent
twice, their ciphertext are the same.
 Typical application:
 secure transmission of short pieces of information (e.g. a
temporary encryption key)
Cipher Block Chaining (CBC)
 Solve security deficiencies in ECB
 Repeated same plaintext block result different ciphertext
block
 Each previous cipher blocks is chained to be input with
current plaintext block, hence name
 Use Initial Vector (IV) to start process
Ci = EK (Pi XOR Ci-1)
C0 = IV
 Uses: bulk data encryption, authentication
CBC scheme
Remarks on CBC
13
 The encryption of a block depends on the current and
all blocks before it.
 So, repeated plaintext blocks are encrypted differently.
 Initialization Vector (IV)
 May sent encrypted in ECB mode before the rest of
ciphertext
Cipher FeedBack (CFB)
 Use Initial Vector to start process

 Encrypt previous ciphertext , then combined with the plaintext block
using X-OR to produce the current ciphertext
 Cipher is fed back (hence name) to concatenate with the rest of IV
 Plaintext is treated as a stream of bits
 Any number of bit (1, 8 or 64 or whatever) to be feed back (denoted CFB-1,
CFB-8, CFB-64)
 Relation between plaintext and ciphertext
Ci = Pi XOR SelectLeft(EK (ShiftLeft(Ci-1)))
C0 = IV
 Uses: stream data encryption, authentication
CFB Scheme
15
CFB Encryption/Decryption
CFB as a Stream Cipher
 In CFB mode, encipherment and decipherment use the
encryption function of the underlying block cipher.
Remark on CFB
18
 The block cipher is used as a stream cipher.
• enable to encrypt any number of bits e.g. single bits or single characters
(bytes)
• S=1 : bit stream cipher
• S=8 : character stream cipher)
 A ciphertext segment depends on the current and all preceding
plaintext segments.
 A corrupted ciphertext segment during transmission will affect
the current and next several plaintext segments.
Output FeedBack (OFB)
 Very similar to CFB
 But output of the encryption function output of cipher is fed back
(hence name), instead of ciphertext
 Feedback is independent of message
 Relation between plaintext and ciphertext
Ci = Pi XOR Oi
Oi = EK (Oi-1)
O0 = IV
 Uses: stream encryption over noisy channels
CFB V.S. OFB
Cipher Feedback
Output Feedback
OFB Scheme
OFB Encryption and Decryption
OFB as a Stream Cipher
 In OFB mode, encipherment and decipherment use the encryption
function of the underlying block cipher.
Remarks on OFB
 Each bit in the ciphertext is independent of the previous bit or
bits. This avoids error propagation
 Pre-compute of forward cipher is possible
 Security issue
 when jth
plaintext is known, the jth
output of the forward cipher
function will be known
 Easily cover jth
plaintext block of other message with the same IV
 Require that the IV is a nonce
Counter (CTR)
 Encrypts counter value with the key rather than any feedback
value (no feedback)
 Counter for each plaintext will be different
 can be any function which produces a sequence which is guaranteed not
to repeat for a long time
 Relation
Ci = Pi XOR Oi
Oi = EK (i)
 Uses: high-speed network encryptions
CTR Scheme
CTR Encryption and Decryption
OFB as a Stream Cipher
Remark on CTR
29
 Strengthes:
 Needs only the encryption algorithm
 Random access to encrypted data blocks
 blocks can be processed (encrypted or decrypted) in parallel
 Simple; fast encryption/decryption
 Counter must be
 Must be unknown and unpredictable
 pseudo-randomness in the key stream is a goal
Topics
 Overview of Modes of Operation
 EBC, CBC, CFB, OFB, CTR
 Notes and Remarks on each modes
Remark on each mode
31
 Basically two types:
 block cipher
 stream cipher
 CBC is an excellent block cipher
 CFB, OFB, and CTR are stream ciphers
 CTR is faster because simpler and it allows parallel
processing
Modes and IV
 An IV has different security requirements than a key
 Generally, an IV will not be reused under the same key
 CBC and CFB
 reusing an IV leaks some information about the first block of
plaintext, and about any common prefix shared by the two
messages
 OFB and CTR
 reusing an IV completely destroys security
CBC and CTR comparison
CBC CTR
Padding needed No padding
No parallel processing Parallel processing
Separate encryption and decryption
functions
Encryption function alone is enough
Random IV or a nonce Unique nonce
Nonce reuse leaks some information
about initial plaintext block
Nonce reuse will leak information
about the entire message
33
Comparison of Different Modes
Comparison of Modes
Mode Description Application
ECB 64-bit plaintext block encoded
separately
Secure transmission of
encryption key
CBC 64-bit plaintext blocks are XORed
with preceding 64-bit ciphertext
Commonly used
method. Used for
authentication
CFB s bits are processed at a time and
used similar to CBC
Primary stream cipher.
Used for authentication
35
Comparison of Modes
Mode Description Application
OFB Similar to CFB except that
the output is fed back
Stream cipher well suited
for transmission over
noisy channels
CTR Key calculated using the
nonce and the counter value.
Counter is incremented for
each block
General purpose block
oriented transmission.
Used for high-speed
communications
36
Final Notes
37
 ECB, CBC, OFB, CFB, CTR, and XTS modes only provide confidentiality
 To ensure an encrypted message is not accidentally modified or maliciously
tampered requires a separate Message Authentication Code (MAC)
 Several MAC schemes
 HMAC, CMAC and GMAC
 But.. compositing a confidentiality mode with an authenticity mode could
be difficult and error prone
 New modes combined confidentiality and data integrity into a single
cryptographic primitive
 CCM, GCM, CWC, EAX, IAPM and OCB
Q&A

More Related Content

PPT
CR 06 - Block Cipher Operation.ppt
PPTX
Information and data security block cipher operation
PPT
PDF
Block Ciphers Modes of Operation
PPTX
Block cipher modes of operation
PPTX
Encryption
CR 06 - Block Cipher Operation.ppt
Information and data security block cipher operation
Block Ciphers Modes of Operation
Block cipher modes of operation
Encryption

Similar to modes-of-operation in cryptography. .ppt (20)

PPTX
block ciphermodes of operation.pptx
PDF
Ciphers modes
PPT
NIS block cipher modes network and information security
PDF
4. algorithm modes (1)
PPTX
Cipher Block Operations Presentation Slide.
PDF
paper5.pdf
PDF
doc5.pdf
PDF
doc5.pdf
PDF
lecture4.pdf
PDF
sheet5.pdf
PDF
lecture4.pdf
PDF
Block Cipher Modes of Operation And Cmac For Authentication
PPTX
Cryptography and Network Security-MOD_3.pptx
PDF
Chap06 block cipher operation
PPT
13528 l8
PPTX
Lectrue-09,10ModofOperation in information security.pptx
PPTX
Block Cipher Modes Of Operation | Computer Networking and Security | Simplilearn
PPTX
Block Cipher and Operation Modes
PDF
THE UNIFIED OPERATION STRUCTURE FOR SYMMETRIC-KEY ALGORITHM
PDF
Computer security module 2
block ciphermodes of operation.pptx
Ciphers modes
NIS block cipher modes network and information security
4. algorithm modes (1)
Cipher Block Operations Presentation Slide.
paper5.pdf
doc5.pdf
doc5.pdf
lecture4.pdf
sheet5.pdf
lecture4.pdf
Block Cipher Modes of Operation And Cmac For Authentication
Cryptography and Network Security-MOD_3.pptx
Chap06 block cipher operation
13528 l8
Lectrue-09,10ModofOperation in information security.pptx
Block Cipher Modes Of Operation | Computer Networking and Security | Simplilearn
Block Cipher and Operation Modes
THE UNIFIED OPERATION STRUCTURE FOR SYMMETRIC-KEY ALGORITHM
Computer security module 2
Ad

More from lekhacce (20)

PPTX
CSS Selectors in web design program.pptx
PPT
cascading style sheet in web design .ppt
PPTX
Introduction to Webdesign .pptx
PPTX
Introduction to HTML .pptx
PPTX
Informationa Retrieval Techniques .pptx.pptx
PPTX
Informationa Retrieval Techniques .pptx
PPTX
Information Retrieval slides_chap02.pptx
PPTX
Information Retrieval slides_chap01.pptx
PPT
Extended Markup Basic Introduction .ppt
PPTX
OLAP operations in Data warehousing.pptx
PPTX
Introduction to HTML language Web design.pptx
PPTX
HTML_TABLES,FORMS,FRAME markup lang.pptx
PPTX
javascript client side scripting la.pptx
PPSX
matlab-130408153714-phpapp02_lab123.ppsx
PPTX
webdevelopment_6132030-lva1-app6891.pptx
PPT
1_chapter one Java content materials.ppt
PPTX
Information RetrievalsT_I_materials.pptx
PDF
Information_Retrievals Unit_3_chap09.pdf
PDF
slides_chap02.pdf
PPTX
AES.pptx
CSS Selectors in web design program.pptx
cascading style sheet in web design .ppt
Introduction to Webdesign .pptx
Introduction to HTML .pptx
Informationa Retrieval Techniques .pptx.pptx
Informationa Retrieval Techniques .pptx
Information Retrieval slides_chap02.pptx
Information Retrieval slides_chap01.pptx
Extended Markup Basic Introduction .ppt
OLAP operations in Data warehousing.pptx
Introduction to HTML language Web design.pptx
HTML_TABLES,FORMS,FRAME markup lang.pptx
javascript client side scripting la.pptx
matlab-130408153714-phpapp02_lab123.ppsx
webdevelopment_6132030-lva1-app6891.pptx
1_chapter one Java content materials.ppt
Information RetrievalsT_I_materials.pptx
Information_Retrievals Unit_3_chap09.pdf
slides_chap02.pdf
AES.pptx
Ad

Recently uploaded (20)

PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
Digital Logic Computer Design lecture notes
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
Construction Project Organization Group 2.pptx
PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Well-logging-methods_new................
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
PPT on Performance Review to get promotions
PDF
composite construction of structures.pdf
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
bas. eng. economics group 4 presentation 1.pptx
Digital Logic Computer Design lecture notes
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
CH1 Production IntroductoryConcepts.pptx
Operating System & Kernel Study Guide-1 - converted.pdf
Internet of Things (IOT) - A guide to understanding
Construction Project Organization Group 2.pptx
Structs to JSON How Go Powers REST APIs.pdf
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Well-logging-methods_new................
CYBER-CRIMES AND SECURITY A guide to understanding
PPT on Performance Review to get promotions
composite construction of structures.pdf
Lesson 3_Tessellation.pptx finite Mathematics
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf

modes-of-operation in cryptography. .ppt

  • 2. Topics  Overview of Modes of Operation  EBC, CBC, CFB, OFB, CTR  Notes and Remarks on each modes
  • 3. Modes of Operation  Block ciphers encrypt fixed size blocks  eg. DES encrypts 64-bit blocks, with 56-bit key  Need way to use in practise, given usually have arbitrary amount of information to encrypt  Partition message into separate block for ciphering   A mode of operation describes the process of encrypting each of these blocks under a single key  Some modes may use randomized addition input value
  • 4. Quick History  Early modes of operation: ECB, CBC, CFB, OFB  DES Modes of operation http://www.itl.nist.gov/fipspubs/fip81.htm  Revised and including CTR mode and AES  Recommendation for Block Cipher Modes of Operation http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf  New Mode : XTS-AES  Recommendation for Block Cipher Modes of Operation: The XTS-AES Mode for Confidentiality on Storage Devices http://csrc.nist.gov/publications/nistpubs/800-38E/nist-sp-800-38E.pdf 1981 2001 2010 Modes of operation are nowadays defined by a number of national and internationally recognized standards bodies such as ISO, IEEE, ANSI and IETF. The most influential source is the US NIST
  • 5. Modes of Operation Taxonomy  Current well-known modes of operation
  • 6. Moe Technical Notes  Initialize Vector (IV)  a block of bits to randomize the encryption and hence to produce distinct ciphertext  Nonce : Number (used) Once  Random of psuedorandom number to ensure that past communications can not be reused in replay attacks  Some also refer to initialize vector as nonce  Padding  final block may require a padding to fit a block size  Method  Add null Bytes  Add 0x80 and many 0x00  Add the n bytes with value n
  • 7. 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 Ci = EK (Pi)  Uses: secure transmission of single values
  • 8. Topics  Overview of Modes of Operation  EBC, CBC, CFB, OFB, CTR  Notes and Remarks on each modes
  • 10. Remarks on ECB 10  Strength: it’s simple.  Weakness:  Repetitive information contained in the plaintext may show in the ciphertext, if aligned with blocks.  If the same message is encrypted (with the same key) and sent twice, their ciphertext are the same.  Typical application:  secure transmission of short pieces of information (e.g. a temporary encryption key)
  • 11. Cipher Block Chaining (CBC)  Solve security deficiencies in ECB  Repeated same plaintext block result different ciphertext block  Each previous cipher blocks is chained to be input with current plaintext block, hence name  Use Initial Vector (IV) to start process Ci = EK (Pi XOR Ci-1) C0 = IV  Uses: bulk data encryption, authentication
  • 13. Remarks on CBC 13  The encryption of a block depends on the current and all blocks before it.  So, repeated plaintext blocks are encrypted differently.  Initialization Vector (IV)  May sent encrypted in ECB mode before the rest of ciphertext
  • 14. Cipher FeedBack (CFB)  Use Initial Vector to start process   Encrypt previous ciphertext , then combined with the plaintext block using X-OR to produce the current ciphertext  Cipher is fed back (hence name) to concatenate with the rest of IV  Plaintext is treated as a stream of bits  Any number of bit (1, 8 or 64 or whatever) to be feed back (denoted CFB-1, CFB-8, CFB-64)  Relation between plaintext and ciphertext Ci = Pi XOR SelectLeft(EK (ShiftLeft(Ci-1))) C0 = IV  Uses: stream data encryption, authentication
  • 17. CFB as a Stream Cipher  In CFB mode, encipherment and decipherment use the encryption function of the underlying block cipher.
  • 18. Remark on CFB 18  The block cipher is used as a stream cipher. • enable to encrypt any number of bits e.g. single bits or single characters (bytes) • S=1 : bit stream cipher • S=8 : character stream cipher)  A ciphertext segment depends on the current and all preceding plaintext segments.  A corrupted ciphertext segment during transmission will affect the current and next several plaintext segments.
  • 19. Output FeedBack (OFB)  Very similar to CFB  But output of the encryption function output of cipher is fed back (hence name), instead of ciphertext  Feedback is independent of message  Relation between plaintext and ciphertext Ci = Pi XOR Oi Oi = EK (Oi-1) O0 = IV  Uses: stream encryption over noisy channels
  • 20. CFB V.S. OFB Cipher Feedback Output Feedback
  • 22. OFB Encryption and Decryption
  • 23. OFB as a Stream Cipher  In OFB mode, encipherment and decipherment use the encryption function of the underlying block cipher.
  • 24. Remarks on OFB  Each bit in the ciphertext is independent of the previous bit or bits. This avoids error propagation  Pre-compute of forward cipher is possible  Security issue  when jth plaintext is known, the jth output of the forward cipher function will be known  Easily cover jth plaintext block of other message with the same IV  Require that the IV is a nonce
  • 25. Counter (CTR)  Encrypts counter value with the key rather than any feedback value (no feedback)  Counter for each plaintext will be different  can be any function which produces a sequence which is guaranteed not to repeat for a long time  Relation Ci = Pi XOR Oi Oi = EK (i)  Uses: high-speed network encryptions
  • 27. CTR Encryption and Decryption
  • 28. OFB as a Stream Cipher
  • 29. Remark on CTR 29  Strengthes:  Needs only the encryption algorithm  Random access to encrypted data blocks  blocks can be processed (encrypted or decrypted) in parallel  Simple; fast encryption/decryption  Counter must be  Must be unknown and unpredictable  pseudo-randomness in the key stream is a goal
  • 30. Topics  Overview of Modes of Operation  EBC, CBC, CFB, OFB, CTR  Notes and Remarks on each modes
  • 31. Remark on each mode 31  Basically two types:  block cipher  stream cipher  CBC is an excellent block cipher  CFB, OFB, and CTR are stream ciphers  CTR is faster because simpler and it allows parallel processing
  • 32. Modes and IV  An IV has different security requirements than a key  Generally, an IV will not be reused under the same key  CBC and CFB  reusing an IV leaks some information about the first block of plaintext, and about any common prefix shared by the two messages  OFB and CTR  reusing an IV completely destroys security
  • 33. CBC and CTR comparison CBC CTR Padding needed No padding No parallel processing Parallel processing Separate encryption and decryption functions Encryption function alone is enough Random IV or a nonce Unique nonce Nonce reuse leaks some information about initial plaintext block Nonce reuse will leak information about the entire message 33
  • 35. Comparison of Modes Mode Description Application ECB 64-bit plaintext block encoded separately Secure transmission of encryption key CBC 64-bit plaintext blocks are XORed with preceding 64-bit ciphertext Commonly used method. Used for authentication CFB s bits are processed at a time and used similar to CBC Primary stream cipher. Used for authentication 35
  • 36. Comparison of Modes Mode Description Application OFB Similar to CFB except that the output is fed back Stream cipher well suited for transmission over noisy channels CTR Key calculated using the nonce and the counter value. Counter is incremented for each block General purpose block oriented transmission. Used for high-speed communications 36
  • 37. Final Notes 37  ECB, CBC, OFB, CFB, CTR, and XTS modes only provide confidentiality  To ensure an encrypted message is not accidentally modified or maliciously tampered requires a separate Message Authentication Code (MAC)  Several MAC schemes  HMAC, CMAC and GMAC  But.. compositing a confidentiality mode with an authenticity mode could be difficult and error prone  New modes combined confidentiality and data integrity into a single cryptographic primitive  CCM, GCM, CWC, EAX, IAPM and OCB
  • 38. Q&A

Editor's Notes

  • #3: 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).
  • #9: Stallings Fig 3-11.
  • #11: 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 its available in advance (eg email, FTP, web etc)
  • #12: Stallings Fig 3-12.
  • #14: 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 mode, the most efficient. This is the usual choice for quantities of stream oriented data, and for authentication use.
  • #16: Stallings Fig 3-13.
  • #19: 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).
  • #22: Stallings Fig 3-14.
  • #24: Because the "random" bits are independent of the message, they must never ever be used more than once (otherwise the 2 ciphertexts can be combined, cancelling these bits, and leaving a "book" cipher to solve). Also, as noted, should only ever use a full block feedback ie OFB-64 mode.
  • #27: Stallings Fig 3-15.