CPS633 WK 3 AND 4, BASIC CRYPTO SHORTENED

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/76

encourage image

There's no tags or description

Looks like no tags are added yet.

77 Terms

1
New cards

What is cryptanalysis

Science behind breaking or analyzing cryptography

2
New cards

What is the work factor

The computational effort needed to break a cryptosystem

3
New cards

What is the correctness requirement of encryption?

decrypted ciphertext identical to plaintext

I.e, D(Kd, E(Ke, P)) = P

4
New cards

What is a keyless cryptosystem?

no key involved with encryption and decryption

5
New cards

Which key does sender use in an asymmetric cryptosystem to maintain confidentiality?

Encrypt with receiver's public key

decrypt with receiver's private key

6
New cards

What is the confidentiality security property for?

Preventing unauthorized reading by attackers

7
New cards

What is the integrity security property for?

Detecting unauthorized modification

8
New cards

What is the authentication security property for?

Verifying message coming from right place

9
New cards

What is the availability property for?

Ensuring users have access to info

10
New cards

What is the replay protection property for?

Preventing reuse of previously valid messages

11
New cards

What is the non repudiation property?

can trace message or data back to its sender

12
New cards

What is alphabet substitution

each letter represented as a number,

each letter is replaced by another letter based on a position shift determined by key k

I.e - Ci = Pi + k mod 26 —> a=1, c=a+2

13
New cards

What are transposition ciphers?

rearranges character positions in plaintext by some rearrangement rule, usually defined by the key

14
New cards

What is the caesar cipher?

substitution cipher that shifts characters a certain number of positions in the alphabet (alphabet substitution)

15
New cards

What are the properties of a caesar cipher?

plaintext letter always maps to the same ciphertext letter

  • only 26 keys

  • Subject to exhaustive search and frequency analysis


16
New cards

How can caesar cipher be broken with frequency analysis

If text long enough, compare frequency of letters in ciphertext with how common letters are used in the english language

  • can infer which substitutions were made

  • (i.e if i in ciphertext has highest frequency in ciphertext, and e has highest frequency in alphabet, then maybe i was replaced with e)


17
New cards

How can caesar cipher be broken with exhaustive search?

only 26 keys —> check every single shift for a coherent word

18
New cards

What is a vignere cipher?

Use a word as a key —> wraps entire length of plaintext; each letter of keyword represents positional shift for plaintext character

19
New cards

What is the vignere cipher equation?

Ci = (Pi + Ki) mod 26

Pi = (Ci - Ki) mod 26

  • i = letter position, K = key word, each letter of the P/C lines up with a letter of K


20
New cards

What is a property of vignere cipher?

A letter of plaintext can map to different letters of ciphertext, based on the keyword letters

21
New cards

What is a one time pad?

cipher uses random key as long as message.

  • Each key is used once and kept secret


22
New cards

Why is reusing a key in XOR ciphers dangerous?

keys cancel out in XOR operations —> can reveal relationship between two plaintexts if you know their ciphertexts

23
New cards

What is a columnar transposition?

transposition cipher where write a plaintext row by row into k number of columns, and the ciphertext is the text read column by column.

24
New cards

What is a rail-fence cipher?

Similar to columnar cipher, —> plaintext is arranged across k number of rows, and each row is concatenated with each other to form the cipher text

25
New cards

How are transposition ciphers broken?

it preserves frequencies —> do frequency analysis

26
New cards

What are product ciphers?

When different ciphers are chained together, but this does not always automatically improve security

27
New cards

What is the caesar statistical correlation formula?

An equation which gives a correlation score for a key, based on the ciphertext frequencies compared with the english letter frequencies

Where

score = Sum of [f(c)p((c-i) mod 26)]

f(c) is frequency of ciphertext character c

p(x) , frequency of english character x)

So each p(i) is calculated for the 26 keys, and the highest score is considered

28
New cards

What is confusion?

When we hide the relationship between plaintext, key, and ciphertext

29
New cards

What is diffusion?

When a change in plaintext spreads across a large area of ciphertext

30
New cards

What are Shannon's design criteria?

Security matches the sensitivity of the information

Key selection and algorithm used is practical

Implementation is not unnecessarily complicated

Error propagation is limited

Ciphertext should not expand compared to plaintext after encryption

31
New cards

What are stream ciphers?

Symmetric encryption done by processing plaintext bit-by bit with a keystream

32
New cards

How do stream ciphers work?

Both sender and receiver generate matching keystreams, plaintext is encrypted with keystream by some operation (XOR) and then is decrypted with an (XOR) with the same keystream

33
New cards

What is a keystream?

sequence used to be processed with the plaintext, through some operation like XOR

34
New cards

What is a block cipher?

Block ciphers encrypt plaintext block by block

35
New cards

What is a ciphertext-only attack model

When an attacker has only ciphertext and not the plaintext

Example: frequency analysis of caesar ciphetext

36
New cards

What is known-plaintext attack?

When an attacker knows a plaintext and ciphertext pair, so you can make inferences on the relationship

37
New cards

What is a probable-plaintext attack?

When an attacker knows a partial portion of plaintext, and can guess the plaintext

38
New cards

What is chosen plaintext attack?

Attacker chooses what data the encryption device encrypts and observes the ciphertext output.

39
New cards

What is a chosen ciphertext attack?

The attacker has the ability to decrypt chosen portions of the ciphertext message and use the decrypted portion of the message to discover the key.

40
New cards

What is the DES cipher?

A symmetric block cipher using feistal rounds to encrypt a plaintext

41
New cards

What are the DES specifications?

Block size: 64 bit

Effective key size: 56 bits

Entire key size: 56 bits + 8 parity bits

Rounds: 16

Round subkey size: 48 bits

42
New cards

What are the parity bits in DES?

8 bits of the 64 bit DES key, which detect errors in the representation of the key

43
New cards

DES encryption procedure

1. Initial permutation of the plaintext bit

2. Divide the result into two left and right 32-bit halves

3. Perform 16 Feistel rounds with the specific subkeys

4. Combine final halves in reverse order

5. Apply inverse initial permutation

44
New cards

What is the initial permutation in DES?

A fixed rearrangement of the plaintext bits where first bit of output is a certain bit of plaintext, etc

45
New cards

What happens during a feistal round?

The left and right halves of the 64 bit input is rearranged, where

The new left half is the previous right half

The new right half is the old left half, XOR with the result of the round function that takes the old right half and the round subkey.

<p>The left and right halves of the 64 bit input is rearranged, where</p><p>The new left half is the previous right half</p><p>The new right half is the old left half, XOR with the result of the round function that takes the old right half and the round subkey.</p>
46
New cards

What is a DES round function?

A function that takes a 32 bit right half, and 48-bit round subkey as inputs

Process:

Expansion permutation of 32-bit right half into a 48-bit intermediary

XOR result with 48-bit subkey

Divide 48-bit result into eight groups of 6 bits each

Get 4 bit result from each of the 8 S-boxes

Rearrange resulting 32 bits according to another table

<p>A function that takes a 32 bit right half, and 48-bit round subkey as inputs</p><p>Process:</p><p>Expansion permutation of 32-bit right half into a 48-bit intermediary </p><p>XOR result with 48-bit subkey</p><p>Divide 48-bit result into eight groups of 6 bits each</p><p>Get 4 bit result from each of the 8 S-boxes</p><p>Rearrange resulting 32 bits according to another table</p>
47
New cards

What is a DES S-Box?

Each S-box takes 6 bit input to produce 4 bits.

48
New cards

What is an s box calculation?

Based on a table, which has row numbers and column numbers

Out of 6 bit input, first and last bit correspond to row number, and middle four bits correspond to a column number. The cell is the 4-bit binary output

49
New cards

How are DES subkeys generated?

The 64-bit DES key has its 8 parity bits discarded

The remaining 56 bits are permutated and divided into 28 bit halves

Each of the 16 rounds performs circular one or two bit left shifts on these halves to generate subkeys for each round

50
New cards

What is the difference between PC-1 and PC-2 DES permutation?

PC-1 is when the 56 bit effective key is permuted to form 28 bit halves, and subkeys are formed by performing circular left shifts according to a round schedule

PC2 is when 48 bits are selected from a 56-bit state to create each subkey

51
New cards

How is DES decrypted?

Same algorithm but using the subkeys in reverse order

52
New cards

What is ECB?

Electronic Code Book, where each block of plaintext is encrypted independently with the same key

<p>Electronic Code Book, where each block of plaintext is encrypted independently with the same key</p>
53
New cards

What are properties of ECB?

With the same key, identical plaintext produces identical ciphertext blocks

Blocks of ciphertext can be rearranged and decrypted to match rearranged plaintext

Errors of encryption/decryption is not propagated to other blocks due to each block being encrypted independently

54
New cards

What is CBC?

Cipher block chaining, where each block of plaintext is XOR with the previous ciphertext block, and then encrypted

55
New cards

What is the initialization vector?

The 0th block of ciphertext, which is used in block ciphers with the first block of plaintext

56
New cards

What are the encryption and decryption equations for CBC?

E: Ci = Ek(Pi XOR Ci-1)

D: Pi = Dk(Ci) XOR Ci-1

57
New cards

What are properties of CBC?

Chaining blocks hides the repeated plaintext patterns

CBC needs a random initial vector unique to a key

IV of CBC needs to be kept protected

Corrupted bit in Ci will affect all bits in Pi, and flip one bit in Pi+1

Uses sequential encryption and decryption

58
New cards

What is CFB?

Cipher Feedback algorithm, where the previous ciphertext block is encrypted, then XORd with the current plaintext block to find the current ciphertext block

59
New cards

What are the CFB encryption and decryption equations

E: Ci = Pi XOR Ek(Ci-1)

D: Pi = Ek(Ci-1) XOR Ci

60
New cards

What are the properties of CFB?

Ek is used for both encryption and decryption

Encryption is sequential

Errors are propagated for several ciphertext blocks

61
New cards

What is OFB?

When you use an output feedback function to generate a keystream for encryption.

This function takes the encryption of the previous output feedback. Where S0 is IV

62
New cards

What is encryption and decryption functions of OFB

Ci = Pi XOR Si

Pi = Ci XOR Si

Where Si is the encryption output

63
New cards

What are OFB properties

Ek is used for both encryptoin and decryption

Keystream is independent of plaintext and ciphertext

Keystream generation is sequential

Same key and IV uses the same keystream

64
New cards

What is CTR?

Counter mode cipher, where unique counter blocks are encrypted to generate a keystream

65
New cards

What are the encryption and decryption functions for CTR?

Ci = Pi XOR Ek(Ti)

Pi = Ci XOR Ek(Ti)

Where Ti = the counter block at position i

66
New cards

What are the weak keys of DES?

Repeated 0101

Repeated FEFE

Repeated E0E0

Repeated 1F1F in first half, then 0E0E in second half

67
New cards

What is AES?

The Advanced Encryption Standard using a fixed block size of 128 bits, and key lengths of 128, 192 and 256 bits

68
New cards

How many rounds in AES?

AES-128 uses 9 rounds + 1

AES-192 uses 11 rounds + 1

AES-256 uses 13 rounds + 1

69
New cards

What happens during each round of encryption in AES?

1. SubBytes

2. ShiftRows

3. MixColumns

4. AddRoundKey

70
New cards

What happens during each decryption round of AES?

1. Inverse shift rows

2. Inverse sub bytes

3. Inverse add round key

4. Inverse mix column

71
New cards

What is the AES encryption process?

1. 128 Bit input is represented as a 4-by-4 array of bytes called the state

2. AES performs addRoundKey which XORs state with initial ronud key

3. Go through rounds

72
New cards

What is the AES decryption process?

1. Addroundkey where ciphertext is XORed with last 4 words of key schedule

2. Go through rounds

73
New cards

What is sub bytes?

AES round operation where every byte in the state is replaced with another byte in a substitution table

74
New cards

What is shift rows?

AES round operation where each state row is shifted cyclically, row 1 by 1 byte, row 2 by 2 bytes, so on

75
New cards

What is mixcolumns?

AES round operation where each column of the state is randomly transformed so its output depends on multiple inputs

Promotes diffusion

Is not done in final encryption round

76
New cards

What is addroundkey?

An AES operation where the state is XOR with a round key thats generated by the AES key schedule

77
New cards

What is the difference between AES and DES?

DES uses block size of 64 bits, AES uses block size 128

DES uses 56 bit effective key, AES uses 128,192, or 256

DES uses 16 rounds, AES uses 10, 12, or 14 depending on key size

DES uses permutations and S-boxes, while AES uses different round operations

AES is more secure and supersedes DES