Block Ciphers and Modes of Operation Block Ciphers: how do we do encryption on a block of data

modes of operation: how do we do encryption on a LOT of blocks of data

Block Ciphers: AES CBC is an example

Types of Symmetric key crypto use a fixed length key to encrypt a fixed length block of data for example, a 64 bit block of data and a 128 bit key.

Idea behind a block cipher is like a big substitution cipher substitution cipher is a j b l etc to sub out the alphabet to encrypt the table is the key

if we have a 64 bit block cipher, then our subtitution table has 2^64 entries ( 1.8 * 10^19) the goal of a block cipher is to be able to look up, in that big table,

Data Encryption Standard ( DES ) 64 bit block size 56 bit key size released in 1976 us govt standard until 2001

Advanced Encryption Standard ( AES ) 128 bit block size 128, 192, or 256 bit key size current us government standard most widely used

aes more better because more big key. mmm.

Block cipher is an encryption / decryption algorithm that encrypts a fixed size of bits

a secure block cipher behaves like a randomly chosen permutation from the set of all permutations on n bit strings a random permutation: each n bit input is mapped to one randomly chosen n bit input when the key k is fixed, ek(M) must be a permutation ( bijective function ) on n bit strings ( each input must correspond to exactly one unique output )

suppose ek(m) is not bijective, then? two inputs might correspond to the same output e.g. Ek(x1) = Ek(x2) = y given ciphertext y you cant uniquely decrypt.

2128 possibilities for a 128 bit key 210 = 1000 2128 = 210*12.8 = (103)12.8 = (103 )13 = 1039 if we have massive hardware that can try 10^9 billion keys in 1 nanosecond, that is 10^18 keys per second we need 10^21 second to crack a key one year is 3*10^7 seconds 10^21 seconds is 30 trillion years

encryption and decryption should be computable in microseconds. formally, KeyGen(), Enc(), Dec() should not take exponential time

block cipher algorithms typically use operations like XOR bit shifting, and small table lookups very fast on modern processors modern cpus provide dedicated hardware support for block ciphers

aes key size 128, 192, or 256 block size 128 bits ( aalways 128 bits, regardless of key size ) you dont need to know how AES works, but you do need to know it’s parameters

block ciphers are not ind cpa secure, because they’re deterministic

No deterministic scheme can be ind cpa secure becaues the adversary can always tell if the same message has been encrypted twice block ciphers can only encrypt messages of a fixed size what if we want to encrypt something longer than 128 bits? to address these problems, we use modes of operation

what to do with large messages?

how about chunking

if we take 128 bits of plaintext input, and use our key to generate ciphertext, and then just add the encrypted segments together

if you have 256 bits of text which is all the same, then they can detect the pattern between the chunks, so if the first 128 bit message and second 128 bit message are the same, they can start to find patterns.

ECB is NOT ind-cpa secure i can see that penguin so vividly

an IV, initialization Vector , is injecting randomness into the plaintext before encryption.

this is aes cbc:

input plaintext and iv ciphertext ciphertext is then used as iv for next block

R = M1 XOR IV Enc(K, M1 XOR IV) = C1 Ci =Enc(K,M1 XOR Ci-1)
C0 = IV

Split M into j plaintext blocks from M1 to Mj choose a random IV compute an output(Iv, C1, … , Cj)

IV was randomly generated recipient needs to know what IV was in order to decrypt