Crypto Flashcards
Block Cipher
takes n bits as input and produces n bits. Based on iteration.
3DES
n or block size is 64 bits. Key size is 168 bits. FiestelNetwork. Half of bits are unchanged.
AES
n or block size is 128 bits. Key size is 156, 512, 1025. Permutation Substitution network.
Modes of operation
use the same key to encrypt multiple times
CBC Mode
Cipher block chaining with random IV
Carter Wagman MAC
Use the fast hash function on the larger input and use slower encryption algorithm on hashed output.
SHA256
Markel dagmard function, davies mayer compressionl
Authenticated Encryption
Provides ciphertext integrity, cannot protect against replay attacks.
SSL
mac then encrypt E(Ke, m||tag)
SSH
enc then mac E(ke,m) and calculate tag on the message.
IPSEC
enc then mac E(ke,m) and calculate tag on the cipher text. IPSec is the best option.
Authenticated encryption modes
combining encryption and MAC
GalolisCounterMode
ctr mode encryption then cw-mac (cartel wagman)
CCM
cbc mac then ctr mode encryption. Uses AES.
TLS 1.2
( CBC AES-128, HMAC-SHA1). Mac then encypt.
Browser side enc (k b->s, data, ctr b->s) :
1. Tag – S(kmac, [++ctr b->s||header||data) value of ctr is included in tag. Ctr is acting as nonce and not send since both sides know what ctr has to be.
2. Pad [header||data||tag] to AES block.
3. CBC encypt with k and new random IV
4. prepend header.
Server side dec(kb->s, record, ctr b->s)
1.CBC decrpt record using kenc
2.Check pad format : send bad_record_mac if invalid
3.Check tag on [++ctr b->s||header||data]. Send bad_record_mac if invalid.
Replay attack prevented using ctr, since ctr won’t match.