Cryptography Rev
Cryptography Rev
CRYPTO
CRYPTO
Cryptology The art and science of making and breaking “secret codes”
1
5/18/2025
CRYPTO
Basic assumptions
The system is completely known to the attacker
Only the key is secret
That is, crypto algorithms are not secret
This is known as Kerckhoffs’ Principle
Why do we make this assumption?
Experience has shown that secret algorithms are weak when
exposed
Secret algorithms never remain secret
Better to find weaknesses beforehand
2
5/18/2025
key key
Cryptography(encryption/decryption algorithm)
1 2
Symmetric(Private) Asymmetric(Public)
1.2.1
1.1.1 1.1.2 1.1.3 Rail-Fence
Mono- Poly-
Simple 1.2.2
Alphabetic Alphabetic Vernam
cipher
3
5/18/2025
lSymmetric-key
lSymmetric-key algorithms are algorithms for
cryptography that use the same
cryptographic keys for both encryption of
plaintext and decryption of ciphertext.
l The keys, in practice, represent a shared
4
5/18/2025
used?
l2.Asymmetric key encryption algorithm is
used?
lFor symmetric, you need n(n−1)/2 keys.
1.1.1 Simple
A B C D E F G H I J K L M
1 2 3 4 5 6 7 8 9 10 11 12 13
N O P Q R S T U V W X Y Z
14 15 16 17 18 19 20 21 22 23 24 25 26
H O S P I T A L I T Y
8 15 19 16 9 20 1 12 9 20 25
5
5/18/2025
T R E A T
20 18 5 1 20
ENCRYPTION
MESSAGE:- 8 15 19 16 9 20 1 12 9 20 25
KEY :- 20 18 5 1 20 20 18 5 1 20 20
CODE:- 28 33 24 17 29 40 19 17 10 40 45
SUBTRACT: - 26 26 26 26 26 26
CODE : - 2 7 24 17 3 14 19 17 10 14 19
ENCRYPTED: B G X Q C N S Q J N S
B G X Q C N S Q J N S
2 7 24 17 3 14 19 17 10 14 19
DECRYPTION
MESSAGE:- 2 7 24 17 3 14 19 17 10 14 19
ADD :- 26 26 26 26 26 26 26 26 26 26 26
(a) CODE:- 28 33 50 43 29 40 45 43 36 40 45
(b) KEY: - 20 18 5 1 20 20 18 5 1 20 20
(a) – (b) : - 8 15 45 42 9 20 27 38 35 20 25
26 26 26 26 26
SUB:-
8 15 19 16 9 20 1 12 9 20 25
CODE: -
H O S P I T A L I T Y
DECRYPTION:-
DECRYPTED MESSAGE IS : - HOSPITALITY
6
5/18/2025
1.1.2 Mono-alphabetic
A B C D E F G H I J K L M
1 2 3 4 5 6 7 8 9 10 11 12 13
N O P Q R S T U V W X Y Z
14 15 16 17 18 19 20 21 22 23 24 25 26
ENCRYPTION
MESSAGE H E L L O
ENCRYPTION K H O O R
DECRYPTION
MESSAGE K H O O R
DECRYPTION H E L L O
7
5/18/2025
1.1.3 Poly-alphabetic
A B C D E F G H I J K L M
1 2 3 4 5 6 7 8 9 10 11 12 13
N O P Q R S T U V W X Y Z
14 15 16 17 18 19 20 21 22 23 24 25 26
ENCRYPTION
MESSAGE H E L L O
CODE 8 5 12 12 15
ADD: - 12 (key) 8 5 12 12
CODE 20 13 17 24 27
(27-26)
ENCRYPTED T M Q X A
8
5/18/2025
DECRYPTION
MESSAGE T M Q X A
CODE 20 13 17 24 1
SUB: - 12 (key) 8 5 12 12
CODE 8 5 12 12 -11
ADD FOR -ve 26
CODE 8 5 12 12 15
DECRYPTED H E L L O
A B C D E F G H I J K L M
27 28 29 30 31 32 33 34 35 36 37 38 39
N O P Q R S T U V W X Y Z
40 41 42 43 44 45 46 47 48 49 50 51 52
ENTER THE MESSAGE : - ELECTRONICS
9
5/18/2025
ENCRYPTION
MESSAGE E L E C T R O N I C S
CODE 31 38 31 29 46 44 41 40 35 29 45
E E T O I S
L C R N C
ENCRYPTED msg E E T O I S L C R N C
31 31 46 41 35 45 38 29 44 40 29
CODE
ENCRYPTED MESSAGE : - EETOISLCRNC
If spaces are shown in the ciphertext, then they must be included in the count of
letters to determine the width of the solution grid.
DECRYPTION
ENCRYPTED msg E E T O I S L C R N C
31 31 46 41 35 45 38 29 44 40 29
CODE
E E T O I S
L C R N C
MESSAGE E L E C T R O N I C S
CODE 31 38 31 29 46 44 41 40 35 29 45
10
5/18/2025
Vernam cipher
11
5/18/2025
Note:
For the Decryption apply the just reverse process of encryption
Transposition cipher
ENTER THE MESSAGE : - HELLO WORLD
ENCRYPTION
12
5/18/2025
DECRYPTION
Example
Alice and Bob want to share some data
Step 1:- Choose two prime number n and g
Let n = 11 and g = 7
13
5/18/2025
K1 = 9 K2 = 9
Hence K1 = K2
REFERENCES
[1] Kaufman, Perlman & Speciner. Network Security
Private Communication in a Public World.
[2] S. Burnett and S. Paine. RSA Security’s Official Guide
to Cryptography.
[3] Albert Leon-Garcia. Communication networks
Fundamental Concepts and Key Architectures.
[4] Bishop and Venkatramanayya. Introduction to
Computer Security.
[5] B. A. Forouzan TCP/IP Protocol Suite.
14
5/18/2025
15