0% found this document useful (0 votes)
33 views7 pages

1 Cryptography:: 4.1 Encryption

This document provides an overview of the topics that will be covered in the [CS304] Introduction to Cryptography and Network Security course. The key topics include: 1. Cryptography, cryptoanalysis, and cryptology which involve designing and breaking security algorithms. 2. Classical encryption techniques like the Caesar cipher, substitution ciphers, transposition ciphers, and the Playfair cipher. 3. Modern techniques like the affine cipher that use modular arithmetic and one-way functions. 4. Cryptographic services like confidentiality, integrity, authentication, and non-repudiation.

Uploaded by

Alpha Wolf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views7 pages

1 Cryptography:: 4.1 Encryption

This document provides an overview of the topics that will be covered in the [CS304] Introduction to Cryptography and Network Security course. The key topics include: 1. Cryptography, cryptoanalysis, and cryptology which involve designing and breaking security algorithms. 2. Classical encryption techniques like the Caesar cipher, substitution ciphers, transposition ciphers, and the Playfair cipher. 3. Modern techniques like the affine cipher that use modular arithmetic and one-way functions. 4. Cryptographic services like confidentiality, integrity, authentication, and non-repudiation.

Uploaded by

Alpha Wolf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

[CS304] Introduction to Cryptography and Network Security

Course Instructor: Dr. Dibyendu Roy Winter 2022-2023


Scribed by: Suryansh Shukla (202051187) Lecture Week 1

1 Cryptography:
The part where we develope algorithms to get security/ designing the algorithm.

2 Cryptoanalysis:
We try to break the security of designed algorithm.

3 Cryptology:
Cryptology: Cryptography + Cryptoanalysis

4
ATM 1 = PIN 1 + x = Y1 – write
ATM 2 = PIN 2 + x = Y2 – write
ATM 3 = PIN 3 + x = Y3 – write.....

ATM 10 = PIN 10 + x = Y10 – write

Where,
PIN is the plain text
x is the ”secret key” (Any Number)
Y is the Cipher Text

4.1 Encryption
Convert readable text to an unreadable text.

Ciphertext: Its readable but meaningless and is used to find the plain text.

E(P,K)=C

1
4.2 Decryption
D(C,K)=P

5 Crypto
Crypto is based on two keys:

1. Symetric Key Crypto

• One secret key

2. Public Key

• Public[E(P,Ck)=C]
• Secret[D(C,dk)=P]

6 Cryptography provides following security services


1. Confidentiality(Hide information from undesirable person)

2. Integrity(Reciever should be able to identify that message has not been altered)

3. Authentication(Able to identify that information information is been shared from the desired
sourse)

4. Non-repudiation(Cannot deny that you have sent the message)

7 CAESAR Cipher
This cipher is named after ”Julius Caesar”. It relies on shiftingthe letters of a message by an
agreed number.
Agreed No.= 3
A=0,B=1,C=2,.......Z=25.

7.1 Encryption:
E(x,3)=(x+3)%26

7.2 Decryption:
D(C,3)=(C+26-3)%26

2
8
Plain text= INTERNET
Agreed No.= 3 (Secret Key)
Cipher text= LQWHUQHW (Eacj Alphabet+3)

9 One Way Function


Its Essential for cryptography. From this we can easily compute the output from the input. If you
have the output you can have the input.
In a given function you can easily compute output it can be difficult to find the input.
F: X– Y is called one way if given xX.
It is easy to compute f(x) but in given f(x) it is ard to find x.

For Eg.: It is given that


p is a prime(large)
q is a prime(large)

N=pXq
Its easy to compute. Therefore,
Given N, find p,q, st. N=pXq.
Where, p q are large primes

10 Substitution Box
S : A → B with |B| ≤ |A|

Its a mapping where size of domain is less than equal to size of codamain.

11 Transposition Cipher
m = m1, m2, ....mt → plaintext
e: permutation on t elements (Secret Key)
1,2,3.....t

11.1 Encryption:
C = me(1), me(2), ......me(t) = c1c2....ct
where c is cipher text

3
11.2 Decryption:
m = Ce− 1(1)....Ce− 1(t)

Example:

Plain text: CAESAR = m1m2...m6

1 2 3 4 5 6
Secret key e:
6 4 1 3 5 2
(Encryption)
It is a bijection(Permutation).

Ciphertext: RSCEAA = C1C2C3...C6

1 2 3 4 5 6
d = e− 1
3 6 4 2 5 1
(Decreption)

12 Substitution Cipher
m = m1m2m...ml
A = A, B, C, ..., Z
miA.

e: Substitution from A to A
e is Secret key.

12.1 Encryption:
C = e(m1)e(m2)....e(ml)

Example:
e(A)=Z, e(B)=D,... e(C)=A

ABC is Plain text.


ZDA is Cipher Text.

4
13 Affine Cipher
A=0 to Z=25
Therefore, (Z26= 0-25) 0,1,2,...25 A= Set of elements A is Z26 Z26 =Z26 mod 26
K= Secret Key= (a, b)Z26XZ26.
x:plain text(xZ26.)
Encryption function
x(x, k) = (a.x + b)mod26 = C.
Decryption function
d(c, k) = ((c − b).a).a− 1)mod26
Multiplicative inverse: When we devide any number its mod should be 1.
Here, a− 1 is Multiplicative Inverse.
and b is Additive Inverse.
a ∗ a− 1 = 1mod26
plaintext: xZ26. gcd(a,26)=1
Z26=0,1,2,3,4,5 x, yZ26. Z=(x+y)%6
x + (6 − x) = 6%6 = 0
0: Additive identity

0 1 2 3 4 5
1 2 3 4 5 0
2 3 4 5 0 1
3 4 5 0 1 2
4 5 0 1 2 3
5 0 1 2 3 4

(x, yZ26.)
x+y=z%6=y
x ∗ 6y
1 is multiplicative identity
(x ∗ y)%6 = 1

0 0 0 0 0 0
0 1 2 3 4 5
0 2 4 0 2 4
0 3 0 3 0 3
0 4 2 0 4 2
0 5 4 3 2 1

0 6= xZ26. iff gcd (x,6)=1


0 6= xZm
gcd(x, m) = 1
⇐⇒ x ∗ my = 1
x ∗ y ≡ 1( mod m)
xy − 1 = t.m
1 = t1m + xy
gcd between (x, n) = ax + by

5
This is Extended Eucledian algorithm(We can find the GCD). m is deviding (xy-1) there is one
integer t.
t = m/(xy − 1)

13.1 Question:
Let us consider m=17, x=3

Therefore, it’s GCD will be 1.

Since, gcd = am + yx

Therefore,
1 = am + yx
1 = 3 − (1X2)
3 + (−1).2
3 + (−1)17 − (5X3))
3 + (−1).17 + (5X3)
6X3 + (−1)X17
6X3 ≡ 1 mod 17

14 Playfair Cipher
Secret key= Playfair Example

P L A Y F
I R E X M
B C D G H
K N O Q S
T U V W Z
Plain Text:H I D E

Therefore,

H I → BM
D E → OD

Ciphertext: B M O D

Using the secret key we have to prepare 5X5 table. We need to keep all 25 alphabets in 5X5
table. Exactly same alphabets I J so they are same. Therefore, J will also be considerd as I.

6
Message is H I D E ⇒

First Block Second Block


HI DE

So, from the Playfair Example table, rectangle whose corner points are H I are replaced with
the end points of otherside B M. Same goes with D E, It shifts verticaly downwards.
So, E becomes D and D becomes O.

****

You might also like