0% found this document useful (0 votes)
10 views15 pages

Cryptography Rev

The document provides an overview of cryptology, including definitions of cryptography, cryptanalysis, and key concepts such as symmetric and asymmetric key cryptography. It discusses various encryption methods, including substitution, transposition, and specific algorithms like the Vernam cipher and Diffie-Hellman key exchange. Additionally, it highlights the challenges of symmetric key cryptography and presents examples of encryption and decryption processes.
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)
10 views15 pages

Cryptography Rev

The document provides an overview of cryptology, including definitions of cryptography, cryptanalysis, and key concepts such as symmetric and asymmetric key cryptography. It discusses various encryption methods, including substitution, transposition, and specific algorithms like the Vernam cipher and Diffie-Hellman key exchange. Additionally, it highlights the challenges of symmetric key cryptography and presents examples of encryption and decryption processes.
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/ 15

5/18/2025

CRYPTO

CRYPTO
Cryptology  The art and science of making and breaking “secret codes”

Cryptography  making “secret codes”

Cryptanalysis  breaking “secret codes”

Crypto  all of the above (and more)

1
5/18/2025

HOW TO SPEAK CRYPTO


A cipher or cryptosystem is used to encrypt the plaintext
The result of encryption is ciphertext
We decrypt ciphertext to recover plaintext
A key is used to configure a cryptosystem
A symmetric key cryptosystem uses the same key to encrypt
as to decrypt
A public key cryptosystem uses a public key to encrypt and
a private key to decrypt

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

CRYPTO AS BLACK BOX

key key

plaintext encrypt decrypt plaintext


ciphertext

A generic view of symmetric key crypto

Cryptography(encryption/decryption algorithm)
1 2

Symmetric(Private) Asymmetric(Public)

1.1 1.2 2.1 2.2


Diffie-
Substitution Transposition RSA
Hellman

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

secret between two or more parties that can


be used to maintain a private information link.

What are the challenges of symmetric


key cryptography?
lKey establishment − Before any communication, both the

sender and the receiver need to agree on a secret


symmetric key. It requires a secure key establishment
mechanism in place.
lTrust Issue − Since the sender and the receiver use the

same symmetric key, there is an implicit requirement that the


sender and the receiver ‘trust’ each other. For example, it
may happen that the receiver has lost the key to an attacker
and the sender is not informed.

4
5/18/2025

lHow many keys are required for secure


communication among 1000 person if:
l1.Symmetric key encryption algorithm is

used?
l2.Asymmetric key encryption algorithm is

used?
lFor symmetric, you need n(n−1)/2 keys.

lFor asymmetric, you need 2n keypairs.

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

ENTER THE MESSAGE : - HOSPITALITY

ENTER THE KEY : - TREAT

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

ENCRYPTED MESSAGE IS : - BGXQCNSQJNS

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

ENTER THE MESSAGE : - HELLO

ENTER THE KEY : - 4

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

ENTER THE MESSAGE : - HELLO

ENTER THE KEY : - 12

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

ENCRYPTED MESSAGE : - TMQXA

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

DECRYPTED MESSAGE : - HELLO

1.2.1 Rail Fence/zigzag cipher/transposition cipher

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

ENTER THE LENGTH : - 11

Rail/Key=2----> which means there is 2 rails, or 2 lines of text.


• In the rail fence cipher, the plain text is written downwards and diagonally on successive "rails"
of an imaginary fence, then moving up again diagonally when the bottom rail is reached.
• When the top rail is reached, the message is written downwards again until the whole plaintext
is written out. The message is then read off in rows.

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

DECRYPTED MESSAGE : - ELECTRONICS

10
5/18/2025

Vernam cipher

In this mechanism we assign a number to each character of


the Plain-Text, like (a = 0, b = 1, c = 2, … z = 25).
Method :
Key length to encrypt the plain text length should be equal to the
length of the plain text.
Encryption Algorithm:
1. Assign a number to each character of the plain-text and the
key according to alphabetical order.
2. Add both the number (Corresponding plain-text character
number and Key character number).
3. Subtract the number from 26 if the added number is greater
than 26, if it isn’t then leave it.

11
5/18/2025

Note:
For the Decryption apply the just reverse process of encryption

Transposition cipher
ENTER THE MESSAGE : - HELLO WORLD

ENTER THE SEQUENCE : - 3,2,4,5,1

ENTER THE COLUMN LENGTH :- 2

ENCRYPTION

COL 1 COL 2 COL 3 COL 4 COL 5


H E L L O
W O R L D

ENCRYPTED MESSAGE : - LREOLLODHW

12
5/18/2025

ENTER THE SEQUENCE : - 3,2,4,5,1

ENTER THE COLUMN LENGTH :- 2

DECRYPTION

ENCRYPTED MESSAGE : - LREOLLODHW

COL 1 COL 2 COL 3 COL 4 COL 5


H E L L O
W O R L D

DECRYPTED MESSAGE : - HELLOWORLD

2.2 Diffie – Hellman

Example
Alice and Bob want to share some data
Step 1:- Choose two prime number n and g
Let n = 11 and g = 7

Step 2:- Alice selects a number x and Cal A


A = (g^x) Mod n
let x = 3
A=2
Alice sends 2 to Bob

Step 3:- Bob independently selects a number y and Cal B


B = (g^y) Mod n
let y = 6
B=4
Bob sends 4 to Alice

13
5/18/2025

Step 4:- Calculate the Keys K1 and K2


K1 = (B^x)Mod n
K2 = (A^y)Mod n

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

You might also like