2. Symmetric encryption
• Symmetric encryption, also referred to as
conventional encryption, secret-key, or single-
key encryption.
• Block encryption algorithms:
– DES
– Triple DES
– AES.
5. Symmetric encryption
• Cryptanalysis
– The process of attempting to discover the plaintext or
key is known as cryptanalysis
– the opponent does know the algorithm used for
encryption.
• Cryptanalytic attacks : -
– ciphertext only - possible is brute-force attack
– Known plaintext
– Chosen plaintext -
– Chosen ciphertext
– Chosen text
6. Symmetric encryption
• known-plaintext attack
• In a known-plaintext attack, the attacker has access to both the
data’s encrypted form (ciphertext) and its corresponding plaintext
copy of the data’s original (unencrypted form).
• The attacker attempts to determine the encryption key or algorithm
by examining the relationship between the plaintext and ciphertext.
• For instance, if “CRYPTO” is encoded as “XUZZA,” knowing this pair
could enable the attacker to decode other parts of the message
that are also encrypted with the same substitution key.
• This demonstrates how, with some encryption algorithms, even a
tiny amount of knowledge can result in broader decryption.
7. Symmetric encryption
• known-plaintext attack,
– The attack involves the following steps:
• Collecting known pairs
• Analyzing patterns
• Deriving a key or algorithm
• Decrypting other data
8. Symmetric encryption
• Chosen plaintext :
– we aren’t certain of the encryption algorithm
being used.
– However, we can still choose a set of plaintexts
and compare them with the resulting ciphertexts
in order to learn something about the encryption
algorithm and its associated key.
9.
10. Symmetric encryption
• An encryption scheme is computationally
secure if the ciphertext generated by the
scheme meets one or both of the following
criteria:
– The cost of breaking the cipher exceeds the value
of the encrypted information.
– The time required to break the cipher exceeds the
useful lifetime of the information.
11. Symmetric Block Encryption Algorithms
• The most commonly used symmetric
encryption algorithms are block ciphers.
• A block cipher processes the plaintext input in
fixed-sized blocks and produces a block of
ciphertext of equal size for each plaintext
block.
12. Block Cipher
● A block cipher uses a symmetric key and algorithm
to encrypt and decrypt a block of data.
● A block cipher encrypts bits, the smallest unit of
computational information, in blocks.
● Block ciphers are frequently used to encrypt large
amounts of data into data blocks.
● The advantage of block cipher is that you can
resuse keys.
13. Block cipher
● The speed of encryption depends on several
factors, such as the algorithm design, the key
size, the mode of operation, the hardware
implementation, and the data size.
● They have the disadvantage of slower
encryption speed since the entire block must
be captured for encryption/decryption.
● Block ciphers also breed errors since a mistake
in just one symbol could alter the whole block.
14. Block cipher
A block cipher, takes two inputs, a k bit key, K and an
n-bit “plaintext” M, to return an n-bit “ciphertext” C =
E(K,M).
The key-length k and the block-length n are
parameters associated to the block cipher.
Both the cipher E and its inverse E−1 should be easily
computable, meaning given K,M we can readily
compute E(K,M), and given K, C we can readily
compute E−1(K, C).
15. Block Cipher
● In typical usage, a random key K is chosen and kept secret
between a pair of users.
● The function E, K is then used by the two parties to process
data in some way before they send it to each other.
● Typically, the adversary will be able to see, C = E(K,M).
● But, ordinarily, the adversary will not be shown the key K.
● Security relies on the secrecy of the key.
16. Block cipher
● The basic scheme of a block cipher is depicted as follows −
● A block cipher takes a block of plaintext bits and generates a
block of ciphertext bits, generally of same size.
● The size of block is fixed in the given scheme. The choice of
block size does not directly affect to the strength of
encryption scheme. The strength of cipher depends up on the
key length.
17. Block Cipher
● Block ciphers process blocks of fixed sizes (say 64 bits).
● The length of plaintexts is mostly not a multiple of the block
size.
● For example, a 150-bit plaintext provides two blocks of 64 bits
each with third block of balance 22 bits.
● The last block of bits needs to be padded up with redundant
information so that the length of the final block equal to block
size of the scheme.
● Here, the remaining 22 bits need to have additional 42
redundant bits added to provide a complete block.
● The process of adding bits to the last block is referred to as
padding.
19. Feistel Cipher Structure
• Feistel networks offer another approach for constructing block
ciphers.
• The inputs to the encryption algorithm are a plaintext block of
length 2w bits and a key K.
• The plaintext block is divided into two halves, LE0 and RE0.
• The two halves of the data pass through n rounds of processing
and then combine to produce the ciphertext block.
• Each round i has as inputs LEi-1 and REi-1 derived from the
previous round, as well as a subkey Ki derived from the overall K.
• The subkeys Ki are different from K and from each other and are
generated from the key by a subkey generation algorithm.
• 16 rounds are used, although any number of rounds could be
implemented.
• Number of rounds is public.
20. Feistel Cipher Structure
• A symmetric block cipher consists of a
sequence of rounds, with each round
performing substitutions and permutations
conditioned by a secret key value.
21. Fiestal cipher structure
• A substitution is performed on the left half of the
data.
• This is done by applying a round function F to the right
half of the data and then taking the exclusive-OR
(XOR) of the output of that function and the left half
of the data.
• The round function has the same general structure for
each round but is parameterized by the round subkey
Ki .
• Following this substitution, a permutation is
performed that consists of the interchange of the two
halves of the data
25. Fiestel cipher structure
• Fiestel cipher structure
– A symmetric block cipher depends on the choice of the
following parameters :
• Block size:
• Key size
• Number of rounds
• Round function
• Subkey generation algorithm
• Decryption with a symmetric block cipher
– The rule is as follows:
• Use the ciphertext as input to the algorithm
• Use the subkeys Ki in reverse order. ie. use Kn in the first round, Kn-
1 in the second round, and so on until K1 is used in the last round.
f
26. Data Encryption Standard
• Symmetric block ciphers:
– the Data Encryption Standard (DES),
– triple DES (3DES), and
– Advanced Encryption Standard (AES).
• Data Encryption Standard
– The most widely used encryption scheme
– The algorithm is refered to the Data Encryption
Algorithm (DEA)
– DES is a block cipher
– The plaintext is processed in 64-bit blocks
– The key is 56-bits in length
28. Data Encryption Standard
• The overall processing at each iteration, DES:
• The Strength of DES
(1) concerns about the algorithm itself and
(2) concerns about the use of a 56-bit key.
29. Triple Data Encryption Standard
• Triple DES:
– 3DES uses three keys and three executions of the DES
algorithm.
– The function follows an encrypt-decrypt-encrypt (EDE)
sequence
– Use three keys and three executions of the DES algorithm
(encrypt-decrypt-encrypt)
C = E(K3, D(K2, E(K1, P))) where
C = ciphertext
P = plaintext
E[K, X] = encryption of X using key K
D[K, Y] = decryption of Y using key K
31. Triple Data Encryption Standard
• Triple DES: Decryption
• Decryption is simply the same operation with
the keys reversed
P = D(K1, E(K2, D(K3, C)))
• The original DES, which uses a single 56-bit
key
• With a 168-bit key length, brute-force attacks
are effectively impossible
32. AES
• AES must be a symmetric block cipher with a block length of 128
bits and support for key lengths of 128, 192, and 256 bits.
• The input to the encryption and decryption algorithms is a single
128-bit block.
• This block is depicted 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 matrix.
• Similarly, the 128-bit key is depicted as a square matrix of bytes.
• This key is then expanded into an array of key schedule words: Each
word is four bytes and the total key schedule is 44 words for the
128-bit key.
• The ordering of bytes within a matrix is by column.
33.
34. AES
• The AES block cipher has a 128-bit block length
and can use 128-, 192-, or 256-bit keys.
• The length of the key affects the key schedule
• AES is essentially a substitution-permutation
network.
• The number of rounds depends on the key
length.
• Ten rounds are used for a 128-bit key, 12 rounds
for a 192-bit key, and 14 rounds for a 256-bit key.
35. AES
• Four different stages are used, one of permutation and
three of substitution
• Substitute bytes: Uses a table, referred to as an S-
box,4 to perform a byte by-byte substitution of the
block.
• Shift rows: A simple permutation that is performed
row by row.
• Mix columns: A substitution that alters each byte in a
column as a function of all of the bytes in the column.
• Add round key: A simple bitwise XOR of the current
block with a portion of the expanded key.
37. AES
• The three types of AES also vary by the number
of rounds of encryption.
– AES-128 uses 10 rounds, and uses a 128-bit key
length to encrypt and decrypt a block of messages.
– AES-192 uses 12 rounds, and uses a 192-bit key
length to encrypt and decrypt a block of messages.
– AES-256 uses 14 rounds and uses a 256-bit key length
to encrypt and decrypt a block of messages.
• The more rounds there are, the safer the
encryption.
41. Stream ciphers
• A block cipher processes the input one block of
elements at a time, producing an output block
for each input block.
• A stream cipher processes the input elements
continuously, producing output one element
at a time as it goes along.
• The most popular symmetric stream cipher,
RC4.
44. Stream cipher
• Example Algorithm for Pseudo-Random Number Generator
– Accept some initial input number, that is a seed or key.
– Apply that seed in a sequence of mathematical operations to generate
the result. That result is the random number.
– Use that resulting random number as the seed for the next iteration.
– Repeat the process to emulate randomness.
• Eg. Linear congruential generators
• This generator produces a series of pseudorandom numbers.
• Given an initial seed X0 and integer parameters a as the
multiplier, b as the increment, and m as the modulus, the generator
is defined by the linear relation:
Xn ≡ (aXn-1 + b)mod m.
46. Stream cipher
Design considerations for a stream cipher.
• 1. The encryption sequence should have a large period.
– A pseudorandom number generator uses a function that produces a
deterministic stream of bits that eventually repeats.
– The longer the period of repeat, the more difficult it will be to do
cryptanalysis.
• 2. The keystream should approximate the properties of a true random
number stream as close as possible.
– For example, there should be an approximately equal number of 1s and 0s.
– If the keystream is treated as a stream of bytes,then all of the 256 possible
byte values should appear approximately equally often.
– The more random-appearing the keystream is, the more randomized the
ciphertext is, making cryptanalysis more difficult.
• 3. The output of the pseudorandom number generator is conditioned on
the value of the input key.
– To guard against brute-force attacks, the key needs to be sufficiently long..
– Thus, with current technology, a key length of at least 128 bits is desirable.
47. Cipher Block Modes of Operation
• Electronic Codebook Mode
• Plaintext is handled b bits at a time and each block of
plaintext is encrypted using the same key.
• The term codebook is used because, for a given key, there
is a unique ciphertext for every b-bit block of plaintext.
• There is an entry for every possible b-bit plaintext pattern
showing its corresponding ciphertext.
• With ECB, if the same b-bit block of plaintext appears more
than once in the message, it always produces the same
ciphertext.
• Because of this, for lengthy messages, the ECB mode may
not be secure.
49. Cipher Block Modes of Operation
• Cipher
Feedback
Mode
• It is possible to
convert any
block cipher
into a stream
cipher by using
the cipher
feedback (CFB)
mode.
50. Cipher Block Modes of Operation
• Counter Mode
• the counter is
initialized to
some value
and then
incremented
by 1 for each
subsequent
block (modulo
2b, where b is
the block size).