Crypto
Crypto
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
RECIEVER
Alice Bob
data, control
channel
messages
Devil
Cryptographic communication
Alice’s Bob’s
KA encryption KB decryption
key key
Devil
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
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
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
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
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
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
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
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
ENCRYPTION
COL 1 COL 2 COL 3 COL 4 COL 5
H E L L O
W O R L D
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
K1 = 9 K2 = 9
Hence K1 = K2
CONCLUSION
Cryptography is considered as the secure
means for communication of confidential data
over a communication channel.