[3] Symmetric Encryption and Message Confidentiality (AES)
Stream Ciphers
- Faster and use far less code.
- Key is used to produce stream of Pseudo-Random Sequence Generation.
- XOR keystream output with plaintext bitstream.
- Encryption sequence should have a large period, large enough to ensure no repetition.
- Keystream approximates random number properties.
- Should use a sufficiently long key.
- Randomeness of stream key completely destorys statistical properties in message, but stream key should never be reused to ensure randomness.
Types of Stream Ciphers
- Stream cipher is a finite state machine
- 1. Key-auto-Key (RC4, block cipher in OFB mode)
- State determined by last bits of keystream.
- Precomuting keystream is possible.
- 2. Ciphertext-auto-key (block cipher in CFB mode)
- State determined by last bits of ciphertext.
- Precomputing keystream is not possible.
RC4
- Cryptographically very strong and easy to implement.
- Use proprietary cipher owned by RSA to produce keystream.
- Variable key size, byte-oriented stream cipher.
- Normally uses 64 bit and 128 bit key sizes.
- Consists of 2 parts
- 1. Key Scheduling Algorithm
- 2. Peudo-Random Generation Algorithm
KSA and Pseudo-Random Generation Algorithm
- Generate State array
- Use the secret key to initialize and permute state vector S.
- Vector S initialization : S[i] = i;
- Vector K is bytes of secret key.
- Vector T initialization : T[i] = K[i % K.length];
- Use 8-bit index pointers i and j (0~255)
- Swap S[i] and S[j] to permutate state vector S.
- Here, j = (j + S[i] + T[i]) % 256;
RC4 Encryption and Decryption
- The output byte is selected by looking up the values of S[i] and S[j].
- k = (S[i] + S[j]) % 256;
- Swap S[i] and S[j] as well after calculating k.
- XOR S[k] with next byte of message to encrypt or decrypt.
- Perform this encryption per byte.
- Decryption : (A xor B) xor B = A
- A = Plain Text or Data
- B = KeyStream
Advanced Encryption Standard (AES)
- Can be implemented in cheap processors and a minimum amount of memory.
- Performed by 3 layers
- 1. Linear Minxing Layer : stable high diffusion effect
- 2. Non-Linear Layer : parallel application of S-Box
- 3. Key addition layer : XOR operation with intermediate round key
- Composition of 10 rounds for a 128 bit key.
- 12 rounds for 192 bit and 14 rounds for 256 bit keys
- A round key addition process at the start of the first round.
AES Encryption
- Convert to state array
- Each round function consists of four transformation states:
- 1. Substitude Bytes
- 2. Shift Row
- 3. Mix Columns (not in the final round)
- 4. Add Round Key
AES Decryption
- Use the inverse function of the functions used in the encryption.
Finite Fields
- GF(2^8)
- {01100011} - binary
- {63} - hex
- Own arithmetic operations
- 1. Addition : {57} XOR {83} = {d4}
- 2. Multiplication : xtime() - efficiently multiplies its input by {02}.
- Multiplication by higher powers can be accompolished through repeated application of xtime()
AES Parameters
- Key length
- Plaintext block size
- Number of rounds
- Round key length
- Extended key length
. . .
'CS > 정보 보안' 카테고리의 다른 글
[정보 보안] AI Security (12) (0) | 2024.06.22 |
---|---|
[정보 보안] Business Chances of Blockchain (11) (0) | 2024.06.22 |
[정보 보안] Symmetric Encryption Message Confidentiality (9) (0) | 2024.06.22 |
[정보 보안] Classic Encryption Techniques (8) (0) | 2024.06.22 |
[정보 보안] Buffer Overflow (7) (0) | 2024.06.22 |