Crypto-system consists of five tuples
- (P, C, K, E, D) :
- P : Plain text
- C : Cipher text
- K : Key
- E : Encryption Algorithm
- D : Decryption Algorithm
Shift cipher
- 문자를 K만큼 Shifting
- 공격자 입장에서 역추적 하기 쉬움
- P = C = K = Z(26) : Alphabet
for 0 <= k <= 25
y = ek(x) = (x+k) mod 26 ....... modulo
x = dk(y) = (y-k) mod 26 ....... modulo
Substitution cipher
- Shifting 하지말고 Shuffle, 임의의 문자로 1:1 mapping
- P = C = Z(26) : Alphabet
- K consists of all possible permutation of the 26 symbols (0 ≤ k ≤ 25)4
Affine cipher
- Alphabet에 mapping 시켜놓은 숫자를 다른 숫자로 수정하여 modular 연산을 진행
P=C=Z26K={(a,b)∈Z26∗Z26, gcd(a,26)=1}ek(x)=(ax+b)mod26=ydk(x)=a−1mod26=xwhere a∗a−1mod26=1
- 예) K={a,b}={(3,1)}일 때,
- Plain text = SIMPLE → 18 3 12 15 11 4 →
- Cipher text = DZLUIN → 3 25 11 20 8 13 → 1. +25 → 2. (x 9) → 3. mod 26
- Plain text = → 28, 50, 36, 45, 33, 38 → 252, 450, 324, 405, 297, 342 → 18, 3, 12, 15, 11, 4 → SIMPLE
- Decryption 함수 공식화
y≡3x+1mod26:congruencey+25≡3x+1+25mod26≡3xmod269(y+25)≡9⋅3xmod269(y+25)=x mod26→x=9(y+25)mod26x=9y+225mod26x=9y+17mod26→Kd=(9,17)
- 예) (5x+8)mod26
y≡5x+8mod26y+18≡5x+8+18mod26≡5xmod2621(y+18)≡21⋅5xmod2621(y+18)≡xmod26x≡21(y+18)mod26x≡21y+14mod26