SlideShare a Scribd company logo
Cryptography
An Introduction
Continued…
Shon Harris
CISSP, 5th
Edition
3.7 Symmetric Algorithms
Block and Stream Ciphers
The two main types of symmetric
algorithms are block ciphers, which work
on blocks of bits, and stream ciphers,
which work on one bit at a time.
3.7.1 Block Ciphers
• When a block cipher is used for encryption
and decryption purposes, the message is
divided into blocks of bits
• These blocks are then put through
mathematical functions, one block at a time
Suppose you need to encrypt a message you are
sending to your friend and you are using a block
cipher that uses 64 bits. Your message of 640 bits is
chopped up into 10 individual blocks of 64 bits.
Each block is put through a succession of
mathematical formulas, and what you end up
with is 10 blocks of encrypted text
You send this encrypted message to your
friend. He has to have the same block cipher
and key, and those 10 ciphertext blocks go
back through the algorithm in the reverse
sequence and end up in your plaintext
message.
Block Cipher Diagram
A strong cipher contains the right level of
two main attributes: confusion and
diffusion.
Confusion is commonly carried out
through substitution, while diffusion is
carried out by using transposition.
The randomness of the key values and the
complexity of the mathematical functions
dictate the level of confusion and diffusion
involved.
For a cipher to be considered strong, it must
contain both of these attributes, to ensure
that reverse-engineering is basically
impossible.
Confusion and Diffusion Example
Suppose I have 500 wooden blocks with individual
letters written on them. I line them all up to spell out
a paragraph (plaintext). Then I substitute 300 of
them with another set of 300 blocks (confusion
through substitution). Then I scramble all of these
blocks up (diffusion through transposition) and
leave them in a pile. For you to figure out my original
message, you would have to substitute the correct
blocks and then put them back in the right order.
Confusion
• Confusion pertains to making the relationship
between the key and resulting ciphertext as
complex as possible so the key cannot be
uncovered from the ciphertext
• Each ciphertext value should depend upon
several parts of the key, but this mapping
between the key values and the ciphertext
values should seem completely random to the
observer.
Diffusion
• Diffusion (transposition) means that a single
plaintext bit has influence over several of the
ciphertext bits
• Changing a plaintext value should change
many ciphertext values, not just one
In fact, in a strong block cipher, if one plaintext bit is
changed, it will change every ciphertext bit with the
probability of 50 percent. This means that if one
plaintext bit changes, then about half of the ciphertext
bits will change.
Example Of A Block Cipher
• Block ciphers use diffusion and confusion in their
methods. The Figure shows a conceptual example of
a simplistic block cipher.
• It has four block inputs, and each block is made up of
four bits
•The block algorithm has two layers of four-bit
substitution boxes called S-boxes.
•Each S-box contains a lookup table used by the
algorithm as instructions on how the bits should be
encrypted
A message is divided into blocks of bits, and substitution and
transposition functions are performed on those blocks
S-Boxes
• The Figure shows that the key dictates what S-
boxes are to be used when scrambling the
original message from readable plaintext to
encrypted non-readable cipher text
• Each S-box contains the different substitution
methods that can be performed on each
block.
This example is simplistic—most block ciphers work
with blocks of 32, 64, or 128 bits in size, and many
more S-boxes are usually involved
3.7.2 Stream Ciphers
• As stated earlier, a block cipher performs
mathematical functions on blocks of bits.
• A stream cipher, on the other hand, does
not divide a message into blocks
• Instead, a stream cipher treats the
message as a stream of bits and
performs mathematical functions on
each bit individually.
• When using a stream cipher, a plaintext bit will
be transformed into a different ciphertext bit
each time it is encrypted
• Stream ciphers use keystream generators,
which produce a stream of bits that is XORed
with the plaintext bits to produce ciphertext,
as shown in the Figure
With stream ciphers, the bits generated by the keystream
generator are XORed with the bits of the plaintext message.
Stream Cipher Diagram
Similarity With One-time Pad
This process is very similar to the one-time
pad explained earlier. The individual bits in the
one-time pad are used to encrypt the
individual bits of the message through the
XOR function, and in a stream algorithm the
individual bits created by the keystream
generator are used to encrypt the
bits of the message through XOR also.
Function Of Key In Stream Ciphers
If the cryptosystem were only dependent
upon the symmetric stream algorithm, an
attacker could get a copy of the plaintext
and the resulting ciphertext, XOR them
together, and find the keystream to use in
decrypting other messages. So the smart
people decided to stick a key into the mix.
In block ciphers, it is the key that determines what
functions are applied to the plaintext and in what
order. The key provides the randomness of the
encryption process.
As stated earlier, most encryption algorithms are
public, so people know how they work. The secret
ingredient is the key.
In stream ciphers, the key also provides
randomness, so that the stream of bits that is
XORed to the plaintext is as random as possible.
Both the sending and receiving ends must have the same
key to generate the same keystream for proper
encryption and decryption purposes.
Function Of Key In Stream Ciphers
Initialization Vectors
• Initialization vectors (IVs) are random values
that are used with algorithms to ensure
patterns are not created during the encryption
process.
• They are used with keys and do not need to be
encrypted when being sent to the destination.
Initialization Vectors
If IVs are not used, then two identical plaintext values
that are encrypted with the same key will create the
same ciphertext.
Providing attackers with these types of patterns can
make their job easier in breaking the encryption
method and uncovering the key.
“IV” Example
For example, if we have the plaintext value of “See
Spot run” two times within our message, we need to
make sure that even though there is a pattern in the
plaintext message, a pattern in the resulting
ciphertext will not be created
So the IV and key are both used by the algorithm to
provide more randomness to the encryption process
Characteristics
Of Strong Stream Ciphers
• Long periods of no repeating patterns within keystream
values
– Bits generated by the keystream must be random
• Statistically unpredictable keystream
– The bits generated from the keystream generator cannot be
predicted
• A keystream not linearly related to the key
– If someone figures out the keystream values, that does not mean she
now knows the key value
• Statistically unbiased keystream (as many 0’s as 1’s)
– There should be no dominance in the number of 0’s or 1’s in the
keystream
Stream & Block Cipher Implementation
• Stream ciphers require a lot of randomness and
encrypt individual bits at a time
• This requires more processing power than block
ciphers require, which is why stream ciphers are
better suited to be implemented at the
hardware level
• Because block ciphers do not require as much
processing power, they can be easily
implemented at the software level
Stream Ciphers Vs. One-time Pads
Stream ciphers were developed to provide the
same type of protection one-time pads do, which is
why they work in such a similar manner. In reality,
stream ciphers cannot provide the level of
protection one-time pads do, but because stream
ciphers are implemented through software and
automated means, they are much
more practical.
3.7.3 Hybrid Encryption Systems
Up to this point, we have figured out that
symmetric algorithms are fast but have some
drawbacks (lack of scalability, difficult key
management, and they provide only
confidentiality).
Asymmetric algorithms do not have these
drawbacks but are very slow. We just can’t seem
to win. So we turn to a hybrid system that uses
symmetric and asymmetric encryption methods
together.
PANKO 28
Public Key Keying for Symmetric Session Keys
Party B
1.
Creates
Symmetric
Session Key
3. Sends the Symmetric
Session Key Encrypted
for Confidentiality
5. Subsequent Encryption with
Symmetric Session Key
2. Encrypts
Session Key with
Party B's Public Key
4. Decrypts
Session Key with
Party B's Private Key
Party A
Public key cryptography uses two keys (public
and private) generated by an asymmetric
algorithm for protecting encryption keys and
key distribution, and a secret key is generated
by a symmetric algorithm and used for bulk
encryption.
Then there is a hybrid use of the two different
algorithms: asymmetric and symmetric. Each
algorithm has its pros and cons, so using them
together can be the best of both worlds.

More Related Content

PPTX
CISSP - Chapter 3 - Cryptography
PPTX
Networking Advance Concepts with handson experience
PPTX
Introduction to modern_symmetric-key_ciphers
PDF
3 Basics of Cryptography Basics of Cryptography
PPT
Block Ciphers Modes of Operation
PPTX
Stream Cipher.pptx
PPT
Iss lecture 2
PPTX
Network Security and Cryptography
CISSP - Chapter 3 - Cryptography
Networking Advance Concepts with handson experience
Introduction to modern_symmetric-key_ciphers
3 Basics of Cryptography Basics of Cryptography
Block Ciphers Modes of Operation
Stream Cipher.pptx
Iss lecture 2
Network Security and Cryptography

Similar to Cryptography - 4.pptx 1st compli. B (20)

PPTX
1st compliment 2nd compliment with fivee
PPT
CISSP EXAM PREPARATION FOR A PASSED SCORE
PPTX
Unit -1 cryptography contiues with algorithm.pptx
PPTX
1. Cryptography Symmetric Cryptography.pptx
PPT
ICSE6104 Lecture bbbbbbbbbbbbbbbbbbbb 2.ppt
PDF
Data Protection Techniques and Cryptography
PPTX
Modern Cryptography.pptx
PPT
Cryptography cse,ru
PPTX
Encryption techniqudgfhgvj,hbkes (2).pptx
PPTX
Modern Block Cipher- Modern Symmetric-Key Cipher
PPTX
Cryptography and network security Nit701
PDF
CISSP Prep: Ch 4. Security Engineering (Part 2)
PPTX
Cryptography & Steganography
PPT
Stallings Kurose and Ross
PDF
CNIT 125 Ch 4. Security Engineering (Part 2)
PDF
Computer network (3)
PPT
1 Cryptography Introduction_shared.ppt
PDF
encrption.PDF
PDF
encrption.PDF
PDF
encrption.PDF
1st compliment 2nd compliment with fivee
CISSP EXAM PREPARATION FOR A PASSED SCORE
Unit -1 cryptography contiues with algorithm.pptx
1. Cryptography Symmetric Cryptography.pptx
ICSE6104 Lecture bbbbbbbbbbbbbbbbbbbb 2.ppt
Data Protection Techniques and Cryptography
Modern Cryptography.pptx
Cryptography cse,ru
Encryption techniqudgfhgvj,hbkes (2).pptx
Modern Block Cipher- Modern Symmetric-Key Cipher
Cryptography and network security Nit701
CISSP Prep: Ch 4. Security Engineering (Part 2)
Cryptography & Steganography
Stallings Kurose and Ross
CNIT 125 Ch 4. Security Engineering (Part 2)
Computer network (3)
1 Cryptography Introduction_shared.ppt
encrption.PDF
encrption.PDF
encrption.PDF
Ad

Recently uploaded (20)

PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
advance database management system book.pdf
PPTX
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
Empowerment Technology for Senior High School Guide
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
Computing-Curriculum for Schools in Ghana
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PPTX
Introduction to Building Materials
PDF
Indian roads congress 037 - 2012 Flexible pavement
PDF
1_English_Language_Set_2.pdf probationary
PPTX
Computer Architecture Input Output Memory.pptx
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PDF
Trump Administration's workforce development strategy
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PPTX
History, Philosophy and sociology of education (1).pptx
PPTX
TNA_Presentation-1-Final(SAVE)) (1).pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Weekly quiz Compilation Jan -July 25.pdf
advance database management system book.pdf
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
Share_Module_2_Power_conflict_and_negotiation.pptx
Paper A Mock Exam 9_ Attempt review.pdf.
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Empowerment Technology for Senior High School Guide
What if we spent less time fighting change, and more time building what’s rig...
Computing-Curriculum for Schools in Ghana
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
Introduction to Building Materials
Indian roads congress 037 - 2012 Flexible pavement
1_English_Language_Set_2.pdf probationary
Computer Architecture Input Output Memory.pptx
AI-driven educational solutions for real-life interventions in the Philippine...
Trump Administration's workforce development strategy
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
History, Philosophy and sociology of education (1).pptx
TNA_Presentation-1-Final(SAVE)) (1).pptx
Ad

Cryptography - 4.pptx 1st compli. B

  • 2. 3.7 Symmetric Algorithms Block and Stream Ciphers The two main types of symmetric algorithms are block ciphers, which work on blocks of bits, and stream ciphers, which work on one bit at a time.
  • 3. 3.7.1 Block Ciphers • When a block cipher is used for encryption and decryption purposes, the message is divided into blocks of bits • These blocks are then put through mathematical functions, one block at a time Suppose you need to encrypt a message you are sending to your friend and you are using a block cipher that uses 64 bits. Your message of 640 bits is chopped up into 10 individual blocks of 64 bits.
  • 4. Each block is put through a succession of mathematical formulas, and what you end up with is 10 blocks of encrypted text You send this encrypted message to your friend. He has to have the same block cipher and key, and those 10 ciphertext blocks go back through the algorithm in the reverse sequence and end up in your plaintext message.
  • 6. A strong cipher contains the right level of two main attributes: confusion and diffusion. Confusion is commonly carried out through substitution, while diffusion is carried out by using transposition.
  • 7. The randomness of the key values and the complexity of the mathematical functions dictate the level of confusion and diffusion involved. For a cipher to be considered strong, it must contain both of these attributes, to ensure that reverse-engineering is basically impossible.
  • 8. Confusion and Diffusion Example Suppose I have 500 wooden blocks with individual letters written on them. I line them all up to spell out a paragraph (plaintext). Then I substitute 300 of them with another set of 300 blocks (confusion through substitution). Then I scramble all of these blocks up (diffusion through transposition) and leave them in a pile. For you to figure out my original message, you would have to substitute the correct blocks and then put them back in the right order.
  • 9. Confusion • Confusion pertains to making the relationship between the key and resulting ciphertext as complex as possible so the key cannot be uncovered from the ciphertext • Each ciphertext value should depend upon several parts of the key, but this mapping between the key values and the ciphertext values should seem completely random to the observer.
  • 10. Diffusion • Diffusion (transposition) means that a single plaintext bit has influence over several of the ciphertext bits • Changing a plaintext value should change many ciphertext values, not just one In fact, in a strong block cipher, if one plaintext bit is changed, it will change every ciphertext bit with the probability of 50 percent. This means that if one plaintext bit changes, then about half of the ciphertext bits will change.
  • 11. Example Of A Block Cipher • Block ciphers use diffusion and confusion in their methods. The Figure shows a conceptual example of a simplistic block cipher. • It has four block inputs, and each block is made up of four bits •The block algorithm has two layers of four-bit substitution boxes called S-boxes. •Each S-box contains a lookup table used by the algorithm as instructions on how the bits should be encrypted
  • 12. A message is divided into blocks of bits, and substitution and transposition functions are performed on those blocks
  • 13. S-Boxes • The Figure shows that the key dictates what S- boxes are to be used when scrambling the original message from readable plaintext to encrypted non-readable cipher text • Each S-box contains the different substitution methods that can be performed on each block. This example is simplistic—most block ciphers work with blocks of 32, 64, or 128 bits in size, and many more S-boxes are usually involved
  • 14. 3.7.2 Stream Ciphers • As stated earlier, a block cipher performs mathematical functions on blocks of bits. • A stream cipher, on the other hand, does not divide a message into blocks • Instead, a stream cipher treats the message as a stream of bits and performs mathematical functions on each bit individually.
  • 15. • When using a stream cipher, a plaintext bit will be transformed into a different ciphertext bit each time it is encrypted • Stream ciphers use keystream generators, which produce a stream of bits that is XORed with the plaintext bits to produce ciphertext, as shown in the Figure
  • 16. With stream ciphers, the bits generated by the keystream generator are XORed with the bits of the plaintext message. Stream Cipher Diagram
  • 17. Similarity With One-time Pad This process is very similar to the one-time pad explained earlier. The individual bits in the one-time pad are used to encrypt the individual bits of the message through the XOR function, and in a stream algorithm the individual bits created by the keystream generator are used to encrypt the bits of the message through XOR also.
  • 18. Function Of Key In Stream Ciphers If the cryptosystem were only dependent upon the symmetric stream algorithm, an attacker could get a copy of the plaintext and the resulting ciphertext, XOR them together, and find the keystream to use in decrypting other messages. So the smart people decided to stick a key into the mix.
  • 19. In block ciphers, it is the key that determines what functions are applied to the plaintext and in what order. The key provides the randomness of the encryption process. As stated earlier, most encryption algorithms are public, so people know how they work. The secret ingredient is the key. In stream ciphers, the key also provides randomness, so that the stream of bits that is XORed to the plaintext is as random as possible.
  • 20. Both the sending and receiving ends must have the same key to generate the same keystream for proper encryption and decryption purposes. Function Of Key In Stream Ciphers
  • 21. Initialization Vectors • Initialization vectors (IVs) are random values that are used with algorithms to ensure patterns are not created during the encryption process. • They are used with keys and do not need to be encrypted when being sent to the destination.
  • 22. Initialization Vectors If IVs are not used, then two identical plaintext values that are encrypted with the same key will create the same ciphertext. Providing attackers with these types of patterns can make their job easier in breaking the encryption method and uncovering the key.
  • 23. “IV” Example For example, if we have the plaintext value of “See Spot run” two times within our message, we need to make sure that even though there is a pattern in the plaintext message, a pattern in the resulting ciphertext will not be created So the IV and key are both used by the algorithm to provide more randomness to the encryption process
  • 24. Characteristics Of Strong Stream Ciphers • Long periods of no repeating patterns within keystream values – Bits generated by the keystream must be random • Statistically unpredictable keystream – The bits generated from the keystream generator cannot be predicted • A keystream not linearly related to the key – If someone figures out the keystream values, that does not mean she now knows the key value • Statistically unbiased keystream (as many 0’s as 1’s) – There should be no dominance in the number of 0’s or 1’s in the keystream
  • 25. Stream & Block Cipher Implementation • Stream ciphers require a lot of randomness and encrypt individual bits at a time • This requires more processing power than block ciphers require, which is why stream ciphers are better suited to be implemented at the hardware level • Because block ciphers do not require as much processing power, they can be easily implemented at the software level
  • 26. Stream Ciphers Vs. One-time Pads Stream ciphers were developed to provide the same type of protection one-time pads do, which is why they work in such a similar manner. In reality, stream ciphers cannot provide the level of protection one-time pads do, but because stream ciphers are implemented through software and automated means, they are much more practical.
  • 27. 3.7.3 Hybrid Encryption Systems Up to this point, we have figured out that symmetric algorithms are fast but have some drawbacks (lack of scalability, difficult key management, and they provide only confidentiality). Asymmetric algorithms do not have these drawbacks but are very slow. We just can’t seem to win. So we turn to a hybrid system that uses symmetric and asymmetric encryption methods together.
  • 28. PANKO 28 Public Key Keying for Symmetric Session Keys Party B 1. Creates Symmetric Session Key 3. Sends the Symmetric Session Key Encrypted for Confidentiality 5. Subsequent Encryption with Symmetric Session Key 2. Encrypts Session Key with Party B's Public Key 4. Decrypts Session Key with Party B's Private Key Party A
  • 29. Public key cryptography uses two keys (public and private) generated by an asymmetric algorithm for protecting encryption keys and key distribution, and a secret key is generated by a symmetric algorithm and used for bulk encryption. Then there is a hybrid use of the two different algorithms: asymmetric and symmetric. Each algorithm has its pros and cons, so using them together can be the best of both worlds.