lecture 4 deciphering classical cipher systems by: noor dhia al- shakarchy 2012-2013
DESCRIPTION
SIMPLE SUBSTITUTION CIPHERS: Example: If k =3 then we can decrypted the following ciphertext as: C = U H Q D L V V D Q F H Dk(M) = R E N A I S S A N C E = M NOTE:- Sometimes when we apply the equation of decipher the ciphertext to plaintext, the result becom negative value. And in this case we adding the value of n to this equation to avoid the negative value as see in example. K = U = 20 ; C = F = 5; ∑ A … Z M = (5 – 20 ) Mod 26 = -15 Mod 26 (Adding 26 ) = 26 – 15 Mod 26 = 11 Mod 26 = 11 = LTRANSCRIPT
Lecture 4DECIPHERING CLASSICAL CIPHER
SYSTEMS
By:NOOR DHIA AL- SHAKARCHY
2012-2013
SIMPLE SUBSTITUTION CIPHERS:Ek(M) = F(m1) F(m2) … ..F(mN) =CDK(M) = F(c1) F(c2) ….. ..F(cN) = M Where: N : is the length of the message. M : is plaintext message given by M = ( m1, m2, … ..,mN). C : is ciphertext message given by C = (c1,c2,… .., cN).There are many types of simple substitution ciphers according to its
equations used to encryption, they:• Shifted alphabet (Caesar cipher): C = Ek(M) = F(a) = (a + k) mod n M = DK(M) = (Ek(M) – K ) mod n = ( c – k ) mod n Where k : is the number of positions to be shifted. a : is a single character of the alphabet. n : is the size of the alphabet.
SIMPLE SUBSTITUTION CIPHERS:Example:If k =3 then we can decrypted the following ciphertext as:
C = U H Q D L V V D Q F H Dk(M) = R E N A I S S A N C E = MNOTE:-Sometimes when we apply the equation of decipher the ciphertext to
plaintext , the result becom negative value.And in this case we adding the value of n to this equation to avoid the
negative value as see in example.K = U = 20 ; C = F = 5; ∑ A … ZM = (5 – 20 ) Mod 26 = -15 Mod 26 (Adding 26 ) = 26 – 15 Mod 26 = 11 Mod 26 = 11 = L
SIMPLE SUBSTITUTION CIPHERS:• Multiplication based (decimation): C = Ek(M) = F(a) = ak mod n Where k, n are relatively prime in order to produce a complete set of
residues. M = DK(M) = a = [ c * inv (k, n)] mod nNOTE:-The algorithm inv(k, n) returnes the value of a according to the
equation C = ak mod n and this algorithm gives as later.Addition and multiplication (affine):The encryption equation Ek(M):F(a) = (ak1+k0) mod nWhere k1 and n are relatively primeThe decryption equation Dk(C): C – (K0 mod n) = aK1 mod n a = [ (C-(K0 mod n)) * inv (K1, n)]
STREAM CIPHER SYSTEMSIs a system in which the key is fed to an algorithm, which uses
the key to generate finite sequence. The algorithm is usually referred to as the sequence generator or key stream generator. stream cipher systems produced long sequence of displacement which were applied character by character to the plaintext message.
The encryption and decryption process are:C = EKi(mi) = K Ө M …….. to encryption
M = DKi(ci) = C Ө K
= ( M Ө K ) Ө K = M ….. to decryptionK Ө K = 0 and K Ө 0 = K
mi message
Key generator
I0
Initial value
mi message
Ci ciphertextessageXOR
(mixer)
Kikey
I0
Initial value
Encryption Decryption
Key generator
Ki
key
XOR
(mixer)
A B XOR
0 0 0
0 1 1
1 0 1
1 1 0 XOR- Table
Stream cipher process
STREAM CIPHER SYSTEMSThe type of stream cipher systems:-• According to repeated key :
– Periodic: if the key repeats after d characters (bits).– Not periodic : if the key not repeats that’s mean the key is
long enough to avoid repeation. • According to generate the key:• Synchronous: the stream message generated alone and
the stream key generated alone also with out dependent on another. The stream Ciphertext generated by mixed them by XOR mixer.
• Self- synchronous: the stream message generated alone and the stream key generated in depending on previous Ciphertext.