0% found this document useful (0 votes)
13 views29 pages

Crypto

Overview of cryptography

Uploaded by

Mrunal Nerkar
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)
13 views29 pages

Crypto

Overview of cryptography

Uploaded by

Mrunal Nerkar
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/ 29

Cryptography

Contents
1.Introduction
2.Cryptography(encryption/decryption
algorithm)
3. Cryptography Machine
4. Algorithms
5. Conclusions
6.References
INTRODUCTION
The science and art of manipulating messages to
make them secure is called as cryptography.
SENDER

plaintext encryption cipher text

RECIEVER

cipher text decryption plaintext


Example:
Insecure communication

Alice Bob
data, control
channel
messages

data secure secure data


sender receiver

Devil
Cryptographic communication

Alice’s Bob’s
KA encryption KB decryption
key key

plaintext encryption ciphertext decryption plaintext


algorithm algorithm

Devil
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
l
Symmetric-key
l
Symmetric-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?
l
Key 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.
l
Trust 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.
l
Asymmetrical encryption
l
Asymmetrical encryption is also known as public key
cryptography, which is a relatively new method, compared to
symmetric encryption.
l
Asymmetric encryption uses two keys to encrypt a plain text.
Secret keys are exchanged over the Internet or a large network. It
ensures that malicious persons do not misuse the keys.
l
When Host1 needs to send data to Host2, he obtains the public
key of Host2 from repository, encrypts the data, and transmits.
l
Host2 uses his private key to extract the plaintext.
l
How many keys are required for secure
communication among 1000 person if:
l
1.Symmetric key encryption algorithm is
used?
l
2.Asymmetric key encryption algorithm is
used?
l
For symmetric, you need n(n−1)/2 keys.
l
For 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
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
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
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


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 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.
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 E E T O I S L C R N C
msg
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 E E T O I S L C R N C
msg 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


1.2.2 Vernam 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


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
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
CONCLUSION
Cryptography is considered as the secure
means for communication of confidential data
over a communication channel.

Symmetric key algorithm are suitable for


same numeric key as well as alphabetic key.
whereas Asymmetric key algorithm is suitable
for same and different keys .
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.

You might also like