0% found this document useful (0 votes)
57 views

Presented By: Shibani Sarangi IT Branch, Regd No. 1001289324 Guided By: Prof. X

Here are the solutions: Q1(a) Plain Text: A B S T R A C T i: 1 2 3 4 5 6 7 8 xi: 1 7 19 19 23 1 20 8 σi(xi): 25 2 23 23 1 25 4 22 Cipher Text: Y C W W A Y B V Q1(b) Cipher Text: A J S K H D A yi: 1 10 19 11 8 4 1 xi= 23−1yi - 4xi−1 mod 26: 1 7 19 19 23 1 20 8 Plain Text: A B S T R A C T Q2(a) Encipher HELLO Q

Uploaded by

ALII AKBAR
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

Presented By: Shibani Sarangi IT Branch, Regd No. 1001289324 Guided By: Prof. X

Here are the solutions: Q1(a) Plain Text: A B S T R A C T i: 1 2 3 4 5 6 7 8 xi: 1 7 19 19 23 1 20 8 σi(xi): 25 2 23 23 1 25 4 22 Cipher Text: Y C W W A Y B V Q1(b) Cipher Text: A J S K H D A yi: 1 10 19 11 8 4 1 xi= 23−1yi - 4xi−1 mod 26: 1 7 19 19 23 1 20 8 Plain Text: A B S T R A C T Q2(a) Encipher HELLO Q

Uploaded by

ALII AKBAR
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Presented By : Shibani Sarangi

IT Branch, Regd no. 1001289324

Guided By : Prof. X
1
Choose a, b , 𝑥0 be any elements of ℤ𝑛 with gcd(a,n)=1
Let 𝑥𝑖 ∈ ℤ𝑛 represent ith letter in the plain text message.
We Encipher 𝑥𝑖 by using the affine mapping
𝜎𝑖 : ℤ𝑛 → ℤ𝑛 given by
𝜎𝑖 (x)=ax +b𝑥𝑖−1 , i=1,2,3,….
𝜎𝑖 (𝑥𝑖 )=a 𝑥𝑖 +b𝑥𝑖−1 i=1,2,3,…..
This type of stream cipher is known as Text-induced .

Example : Use the Text-induced stream affine cipher


𝜎𝑖 (x)=(5x +9𝑥𝑖−1 ) mod 26 , i=1,2,3,…
With 𝑥0 =1 to
a) Encipher HAPINESS
b) Decipher ZLQRCP

2
Example : Use the Text-induced stream affine cipher
𝜎𝑖 (x)=(5x +9𝑥𝑖−1 ) mod 26 , i=1,2,3,… With 𝑥0 =1 to Encipher HAPINESS Decipher ZLQRCP

SOLUTION: a)
Plain Text : H A P P I N E S S
𝑖 : 1 2 3 4 5 6 7 8 9
𝑥𝑖 : 8 1 16 16 9 14 5 19 19
(5 𝑥𝑖 +9 𝑥𝑖−1 )mod26: 23 25 11 16 7 21 21 10 6
Cipher Text : W Y K P G U U J F

b) Let 𝑦𝑖 represents the ith letter in cipher text


𝑦𝑖 =(5 𝑥𝑖 +9 𝑥𝑖−1 ) mod 26
𝑥𝑖 =5−1 ( 𝑦𝑖 - 9𝑥𝑖−1 ) mod 26 = (21 𝑦𝑖 +19 𝑥𝑖−1 ) mod 26
Cipher Text: Z L Q R C P
𝑖 : 1 2 3 4 5 6
𝑥𝑖= 5 𝑦𝑖 +19 𝑥𝑖−1 mod26: 19 15 18 18 15 23
Plain text : S O R R O W
3
In this Cipher we extend the bijective mapping ρ: Ω → ℤ𝑛 where Ω = n
ρ ∶ Ω𝑟 → (ℤ𝑛 )𝑟
ρ(a1, a2, a3, …., ar)=(ρ(a1), ρ(a2), ρ(a3), ….., ρ(ar))
However a natural bijection is
𝜏: (ℤ𝑛 )𝑟 → ℤ𝑛𝑟 defined as
𝜏(𝑥1 , 𝑥2 , 𝑥3 , ….., 𝑥𝑟 )= 𝑥1 𝑛𝑟−1 + 𝑥2 𝑛𝑟−1 +….. 𝑥𝑟

𝜏 𝜊 ρ: Ω𝑟 → ℤ𝑛𝑟 is a bijection mapping.

𝜎 ∶ ℤ𝑛𝑟 → ℤ𝑛𝑟 be an affine mapping defined by


𝜎(x)=(ax+b)mod 𝑛𝑟 where a,b are elements of ℤ𝑛𝑟
and gcd(a,n)=1

4
Ω𝑟 → (ℤ𝑛 )𝑟 → ℤ𝑛𝑟 → ℤ𝑛𝑟 → (ℤ𝑛 )𝑟 → Ω𝑟

If the mapping for Affine cipher is 𝜎 ∶ ℤ𝑛𝑟 → ℤ𝑛𝑟 then the total
number of keys for this cipher is 𝑛𝑟 𝜙(𝑛𝑟 ).

If n=26 and r=2 then the possible total number of keys are
262 ϕ(262 )
= 262 ϕ(132 , 22 )
=676(156× 2)
=210910
So There are 210910 possible keys for affine cipher for r=2 and
n=26.
5
Example: Use the blocks of two letters and the affine
cipher 𝜎(𝑥) = (35𝑥 + 120)mod676
a) Encipher HELLO b) Decipher IUOZDG
Solution: a) We break the message into blocks of two
letters and adding an extra letter Z at the end to
complete block.
Plain Text : HE LL OZ
𝑥1 , 𝑥2 : 8,5 12,12 15,0
𝑥 = 26𝑥1 + 𝑥2 : 213 324 130
𝑦 = (35𝑥 + 120)mod676: 139 644 614
𝑦1 , 𝑦2 : 5,9 24,20 23,16
Cipher Text: EI XT WP
Hence we get cipher text is EIXTWP Corresponding
to HELLO
6
b) If 𝑦 = 35𝑥 + 120 𝑚𝑜𝑑676
𝑡ℎ𝑒𝑛 𝑥 = 35−1 𝑦 − 120 𝑚𝑜𝑑676
This implies that 𝑦 = 367𝑦 + 576 𝑚𝑜𝑑676
Cipher Text: IU OZ DG
𝒚𝟏 , 𝒚𝟐 : 9,21 15,0 4,7
y=26𝒚𝟏 +𝒚𝟐 : 255 390 111
x= 𝟑𝟔𝟕𝒚 + 𝟓𝟕𝟔 𝒎𝒐𝒅𝟔𝟕𝟔 197 394 77
𝒙𝟏 , 𝒙𝟐 : 7,15 15,4 2,25

Plain Text : GO OD BY
Hence we get plain text is GOODBY corresponding to
Cipher text IUOZDG
7
ℤ𝑝 [𝑥]
≈ 𝐺𝐹 𝑝, 𝑟 = 𝐺𝐹(𝑝𝑟 )=ℱ𝑝𝑟
<𝑓 𝑥 >
Where f(x) is monic irreducible polynomial of degree r
over ℤ𝑝
ℱ𝑝𝑟 =൛𝑎1 𝑡 𝑟−1 + 𝑎2 𝑡 𝑟−2 + 𝑎3 𝑡 𝑟−3 + ⋯ + 𝑎𝑟−1 𝑡 + 𝑎𝑟 ∶
𝑎1 , 𝑎2 , 𝑎3 , … 𝑎𝑟 ∈ ℤ𝑝 ൟ
Where f(t)= 𝑡 𝑟 + 𝑐1 𝑡 𝑟−1 + 𝑐2 𝑡 𝑟−2 + ⋯ + 𝑐𝑟 =0
t is known as primitive element and ℱ𝑝𝑟 is Galois field
extension of the prime field ℤ𝑝 . Moreover ℱ𝑝𝑟 is vector
space over ℤ𝑝 with dimension r. However
(ℱ𝑝𝑟 )∗ = ℱ𝑝𝑟 − 0 Is multiplicative cyclic group of
order 𝑝𝑟 − 1 and t is its generator with order 𝑝𝑟 − 1 .
8
9
Galois Field
power form n-tuple form polynomial form
0 0000 0
 0100 
2 0010 2
3 0001 3
Table of Galois Field which is 4 1100 1
generated by primitive 5 0110   2
element ξ . 6 0011 2  3

ℤ𝑝 [𝑥] 7 1101 1    3
≈ 𝐺𝐹 𝑝, 𝑟 = 𝐺𝐹(𝑝𝑟 )=ℱ𝑝𝑟 8 1010 1  2
<𝑓 𝑥 >
Where f(x) is monic irreducible 9 0101   3
polynomial of degree r over ℤ𝑝  10 1110 1    2
 11 0111   2  3
 12 1111 1    2  3
 13 1011 1  2  3
 14 1001 10 1  3
 15 1 1

Department of Mathematics
Ω → ℤ𝑝𝑟 → ℱ𝑝𝑟 → ℱ𝑝𝑟 → ℤ𝑝𝑟 → Ω
Here Ω is set of Alphabet of n order.

If we take n=27
𝑓 𝑥 = 𝑥 3 +2x+1 is monic irreducible over ℤ3
ℱ33 = ℱ27 ={𝑎𝑡 2 +bt+c : a, b, c∈ ℤ3 }
Where t satisfies the relation 𝑡 3 + 2𝑡 + 1 = 0,
𝑡 3 = −2𝑡 − 1
𝑡3 = 𝑡 + 2
By taking successive powers of t we can find the order of t is 26.
Thus t is primitive element and therefore every non zero element
in Field ℱ27 Is the power of t.
Now we make the table which shows that for each character in Ω
its numerical value in ℤ27 , the corresponding element in ℱ27 and
its expression as a power of t
11
Ω ℤ𝑝𝑟 ℱ𝑝 𝑟 ℱ𝑝 𝑟 Ω ℤ𝑝𝑟 ℱ𝑝𝑟 ℱ𝑝 𝑟
A 1 1 t0 N 14 t 2 +t+2 t11
B 2 2 t13 O 15 t 2 +2t t4
C 3 t t1 P 16 t 2 +2t+1 t18
D 4 t+1 t9 Q 17 t 2 +2t+2 t7
E 5 t+2 t3 R 18 2t 2 t15
F 6 2t t14 S 19 2t 2 +1 t 25
G 7 2t+1 t16 T 20 2t 2 +2 t8
H 8 2t+2 t 22 U 21 2t 2 +t t17
I 9 t2 t2 V 22 2t 2 +t+1 t 20
J 10 t 2 +1 t 21 W 23 2t 2 +𝑡 + 2 t5
K 11 t 2 +2 t12 X 24 2t 2 +2t t 23
L 12 t 2 +t t10 Y 25 2t 2 +2t+1 t 24
M 13 t 2 +t+1 t6 Z 26 2t 2 +2𝑡 + 2 t19
SPACE 0 0 0

12
Use the representation table of the alphabet by ℱ27 describe in
previous slide and the affine cipher 𝜎: ℱ27 → ℱ27 given by
𝜎 𝑢 = 𝑡 + 1 𝑢 + 𝑡2 + 2
(a) Encipher FIELD (b) Decipher FVC A

SOLUTION: (a)
We write for each letter in the plain text its representation 𝑢 ∈ ℱ27
and find
𝜎 𝑢 = 𝑡 + 1 𝑢 + 𝑡 2 + 2. The table shows the work
Plain Text: F I E L D
𝑢 ∈ ℱ27 : 2t 𝑡2 t+2 𝑡 2 +t t+1
𝜎 𝑢 : 2t+2 2𝑡 2 +t+1 2𝑡 2 +1 2t+1 2𝑡 2 +2t
Cipher text: H V S G X

13
(b) Decipher FVC A
SOLUTION: (b)
From the table we find that 𝑡 + 1 = 𝑡 9 , Hence the inverse of
𝑡 + 1 is 2𝑡 2 +t . Because (𝑡 + 1)−1 = (𝑡 9 )−1 = 𝑡 17 = 2𝑡 2 +t
Thus the inverse mapping 𝜎 −1 is given by
𝜎 −1 𝑣 = 2𝑡 2 + t v − 𝑡 2 + 2 = 2𝑡 2 + t v + 2t + 1
The table shows the work
Cipher Text: F V C SPACE D
V∈ ℱ27 : 2t 2𝑡 2 +𝑡 + 1 t 0 1
𝜎 −1 𝑣 : 2𝑡 2 𝑡2 𝑡 2 + 𝑡 + 2 2t+1 2𝑡 2 +1
Plain Text: R I N G S

14
Q1: Use the Text induced stream affine cipher with 𝑥0 =5
and 𝜎𝑖 (x)=(7𝑥 + 4𝑥𝑖−1 )mod26
(a)Encipher ABSTRACT (b) Decipher AJSKHDA

Q2: Use blocks of two letters and the affine cipher


(23x+314)mod262
(a)Encipher HEAVEN (b) Decipher RMLR

Q3: Use the representation of the alphabetic by the


field ℱ27 and the affine cipher
𝜎 𝑢 = 𝑡2 + 1 u + t + 1
(a) Encipher NEW (b) Decipher ITJ
15

You might also like