Vous êtes sur la page 1sur 129

Cryptography

By
Farhan M.Shaikh
B.Sc. (CS),M.Sc. (IT), B.Ed.,M.Ed., M.A (Sociology)., UGC-NET (Education/ Sociology)

Visiting Faculty
L.S. Raheja College, SantaCruz
Tolani College, Andheri
Pioneer Education Center, Borivali, Andheri & Vasai
L.I.I.T., Dadar & Mulund
T.I.M.E., Andheri & Borivali
Unit 4
Traditional and Modern Symmetric- Key
Ciphers
DES and AES
Asymmetric Key Cryptography
RSA and ELGAMAL cryptosystems
Message Digest
Digital Signature
Key Management

farhan.mohd@yahoo.co.in 2
Introduction to Basic Encryption &
Decryption
The term 'Cryptography' means the concept of
encryption and decryption together.
Cryptography is the technique in which the
original 'plain text' message is 'encrypted' i.e.
converted into a coded form called 'cipher text'
at the sender's end, which is then transmitted to
the receiver.
The receiver then 'decrypts' i.e. converts the
'cipher text' back into the 'plain text' to get the
original message back.

farhan.mohd@yahoo.co.in 3
Introduction to Basic Encryption &
Decryption

Cryptography is also called as an art or


technique to achieve secure communication
between the communicating parties by
encoding the messages between them such
that no third party can gain anything useful
out of interception.
farhan.mohd@yahoo.co.in 4
Cryptography Components

farhan.mohd@yahoo.co.in 5
Categories of Cryptography

farhan.mohd@yahoo.co.in 6
Techniques of Cryptography
Symmetric key cryptography: - in which the
'key' element used, is the 'same' for both
encryption as well as decryption.
Asymmetric key cryptography :- in which the
'key' element used, is different for both
encryption as well as decryption.
Symmetric key cryptography is also known as
'private or secret key cryptography'
Asymmetric key cryptography is also known as
'public key cryptography.

farhan.mohd@yahoo.co.in 7
Symmetric Key Cryptography

farhan.mohd@yahoo.co.in 8
Asymmetric Key Cryptography

farhan.mohd@yahoo.co.in 9
Three types of Keys

farhan.mohd@yahoo.co.in 10
Comparison between two categories

farhan.mohd@yahoo.co.in 11
Symmetric Key Cryptography

farhan.mohd@yahoo.co.in 12
Cryptanalysis

farhan.mohd@yahoo.co.in 13
Types of Cryptanalysis Attacks

farhan.mohd@yahoo.co.in 14
Types of Cryptanalysis Attacks

farhan.mohd@yahoo.co.in 15
Traditional Symmetric Key Ciphers

farhan.mohd@yahoo.co.in 16
Substitution Ciphers
Substitution technique - the very basic
technique, which makes use of simple letter
substitution to generate cipher text.
Specific methods used in this type include
1. Caesar cipher (used by Julius Caesar),
2. Modified Caesar Cipher,
3. Mono-alphabetic cipher,
4. Homophonic substitution cipher,
5. Polygram substitution cipher
6. Polyalphabetic cipher etc.
farhan.mohd@yahoo.co.in 17
Caesar cipher
A cryptographic scheme proposed by
Julius Caesar is one special case of
substitutional cipher where each alphabet
is the message is replaced by an
alphabet, three places down the line, in
the alphabetical order.
Thus A becomes D and B becomes
E

farhan.mohd@yahoo.co.in 18
Caesar cipher

farhan.mohd@yahoo.co.in 19
Algorithm to break Caesar Cipher

farhan.mohd@yahoo.co.in 20
Modified Version of Caesar Cipher

farhan.mohd@yahoo.co.in 21
Mono-alphabetic Cipher

farhan.mohd@yahoo.co.in 22
Mono-alphabetic Additive Cipher

farhan.mohd@yahoo.co.in 23
Mono-alphabetic Additive Cipher

farhan.mohd@yahoo.co.in 24
Mono-alphabetic Additive Cipher

farhan.mohd@yahoo.co.in 25
Mono-alphabetic Multiplicative Cipher

farhan.mohd@yahoo.co.in 26
Mono-alphabetic Multiplicative Cipher

farhan.mohd@yahoo.co.in 27
Affine Cipher

farhan.mohd@yahoo.co.in 28
Affine Cipher

farhan.mohd@yahoo.co.in 29
Homophonic Substitution Cipher

farhan.mohd@yahoo.co.in 30
Other Substitution Techniques

farhan.mohd@yahoo.co.in 31
Other Substitution Techniques

farhan.mohd@yahoo.co.in 32
Polyalphabetic Autokey Cipher

farhan.mohd@yahoo.co.in 33
Other Substitution Techniques

farhan.mohd@yahoo.co.in 34
Playfair Cipher

farhan.mohd@yahoo.co.in 35
Playfair Cipher

farhan.mohd@yahoo.co.in 36
Playfair Cipher

farhan.mohd@yahoo.co.in 37
Playfair Cipher

farhan.mohd@yahoo.co.in 38
Playfair Cipher

farhan.mohd@yahoo.co.in 39
Playfair Cipher

farhan.mohd@yahoo.co.in 40
Playfair Cipher

farhan.mohd@yahoo.co.in 41
Playfair Cipher

farhan.mohd@yahoo.co.in 42
Playfair Cipher

farhan.mohd@yahoo.co.in 43
Hill Cipher

farhan.mohd@yahoo.co.in 44
Hill Cipher

farhan.mohd@yahoo.co.in 45
Hill Cipher

farhan.mohd@yahoo.co.in 46
Transposition Ciphers
Transposition technique - Modified version of
substitution technique because this not only
substitutes letters but also makes some sort of
permutation over the plain text in order to
generate cipher text. Specific examples include
1. Rail fence technique
2. Simple columnar transposition
3. Simple columnar transposition with multiple
rounds
4. Vernam cipher,
5. Book cipher etc.

farhan.mohd@yahoo.co.in 47
Rail Fence Technique

farhan.mohd@yahoo.co.in 48
Simple Columnar Transposition Technique

farhan.mohd@yahoo.co.in 49
Simple Columnar Transposition Technique

farhan.mohd@yahoo.co.in 50
Simple Columnar Transposition Technique
with multiple rounds

farhan.mohd@yahoo.co.in 51
Vernam Cipher (One-Time Pad)
The Vernam Cipher, also called as One-Time Pad,
is implemented using a random set of non-
repeating characters as the input cipher text.
The most significant point here is that once an
input cipher text for transposition is used; it is
never used again for any other message (hence
the name one-time).
The length of the cipher text is equal to the length
of the original plain text.
Since, it is used as one-time pad and is discarded
after a single use, this technique is highly secure
and suitable for small plain text message, but is
impractical for large messages.
farhan.mohd@yahoo.co.in 52
Vernam Cipher (One-Time Pad)

farhan.mohd@yahoo.co.in 53
Vernam Cipher (One-Time Pad)

farhan.mohd@yahoo.co.in 54
Book Cipher / Running Block Key
Cipher
The idea used is quite simple and similar in principle to
Vernam Cipher. For producing cipher text, some
portion of text from a book is used, which serves the
purpose of a one-time pad. This, the characters from a
book are used as one time pad, and they are added to
the input plain text messages.

farhan.mohd@yahoo.co.in 55
Modern Symmetric Key Ciphers

farhan.mohd@yahoo.co.in 56
XOR Cipher

farhan.mohd@yahoo.co.in 57
Rotation Cipher

farhan.mohd@yahoo.co.in 58
Substitution Cipher: S-Box

farhan.mohd@yahoo.co.in 59
Transposition Cipher: P-Box

farhan.mohd@yahoo.co.in 60
P-boxes: straight, expansion, and compression

farhan.mohd@yahoo.co.in 61
Modern Cipher: Stream Cipher

farhan.mohd@yahoo.co.in 62
Modern Cipher: Stream Cipher

farhan.mohd@yahoo.co.in 63
Modern Cipher: Stream Cipher

farhan.mohd@yahoo.co.in 64
Modern Cipher: Block Cipher

farhan.mohd@yahoo.co.in 65
Modern Cipher: Block Cipher

farhan.mohd@yahoo.co.in 66
Algorithms modes

farhan.mohd@yahoo.co.in 67
Electronic Code Book mode

farhan.mohd@yahoo.co.in 68
Electronic Code Book mode

farhan.mohd@yahoo.co.in 69
Cipher Block Chaining mode

farhan.mohd@yahoo.co.in 70
Cipher Block Chaining mode

farhan.mohd@yahoo.co.in 71
Cipher Block Chaining mode

farhan.mohd@yahoo.co.in 72
Data Encryption Standard (DES)

farhan.mohd@yahoo.co.in 73
Data Encryption Standard (DES)

farhan.mohd@yahoo.co.in 74
Broad Level Steps in DES

farhan.mohd@yahoo.co.in 75
Broad Level Steps in DES

farhan.mohd@yahoo.co.in 76
DES Function

farhan.mohd@yahoo.co.in 77
Advanced Encryption Standard (AES)

farhan.mohd@yahoo.co.in 78
Advanced Encryption Standard (AES)

AES has three different configurations


with respect to the number of rounds
and key size.

farhan.mohd@yahoo.co.in 79
Advanced Encryption Standard (AES)

farhan.mohd@yahoo.co.in 80
Advanced Encryption Standard (AES)

farhan.mohd@yahoo.co.in 81
DES v/s AES

farhan.mohd@yahoo.co.in 82
Asymmetric Key Cryptography
The Asymmetric key cryptography is also known
as a 'public key cryptography', which uses a
key-pair rather than a single key.
The importance of this scheme is that only one
key-pair is required to securely communicate
between any number of other parties.
One of these two keys is called public key
(which can be announced to the world) and
another is private key (obviously to be kept with
oneself).

farhan.mohd@yahoo.co.in 83
Working of public and private keys
Suppose, X wants to send a message to Y
without having to worry about its security.
1. Then X and Y should each have a private key
and a public key.
X should keep its private key secret.
Y should keep its private key secret.
X should inform Y about its public key.
Y should inform X about its public key
( Both now have their own set of keys ready. )

farhan.mohd@yahoo.co.in 84
Working of public and private keys
2. When X wants to send message to Y, X
encrypts with Y's public key (as it is
known to everyone)
3. X then sends this message to Y.
4. Then, Y decrypts this message using his
own private key (known only to Y)
5. Y encrypts the message using X's public
key and sends this to X
6. On receiving the message, X can further
decrypt it using his own private key.
farhan.mohd@yahoo.co.in 85
Working of public and private keys
The basis of this working lies in the
assumption of large prime number with
only two factors. If one of the factors is
used for encryption process, only the
other factor shall be used for decryption.
The best example of an asymmetric key
cryptography algorithm is the famous RSA
algorithm (developed by Rivest, Shamir
and Adleman at MIT in 1978, based on
the framework setup by Diffie & Hellman
earlier).
farhan.mohd@yahoo.co.in 86
What would happen if your private key were
made public????

farhan.mohd@yahoo.co.in 87
RSA (Rivest, Shamir, Adleman)
Algorithm

farhan.mohd@yahoo.co.in 88
RSA Algorithm

farhan.mohd@yahoo.co.in 89
RSA Algorithm

farhan.mohd@yahoo.co.in 90
RSA Algorithm

farhan.mohd@yahoo.co.in 91
RSA Algorithm

farhan.mohd@yahoo.co.in 92
Applications of RSA

farhan.mohd@yahoo.co.in 93
ELGAMAL cryptosystems

farhan.mohd@yahoo.co.in 94
ELGAMAL cryptosystems

farhan.mohd@yahoo.co.in 95
Concept of Hash (Message Digest)

farhan.mohd@yahoo.co.in 96
Concept of Hash (Message Digest)

farhan.mohd@yahoo.co.in 97
Idea of a Message Digest

farhan.mohd@yahoo.co.in 98
Idea of a Message Digest

farhan.mohd@yahoo.co.in 99
Requirement of a Message Digest

farhan.mohd@yahoo.co.in 100
Message Digest

farhan.mohd@yahoo.co.in 101
Digital Signatures

farhan.mohd@yahoo.co.in 102
Digital Signatures

farhan.mohd@yahoo.co.in 103
Digital Signatures

farhan.mohd@yahoo.co.in 104
Steps for the process

farhan.mohd@yahoo.co.in 105
Digital Signatures

farhan.mohd@yahoo.co.in 106
The Senders Side

farhan.mohd@yahoo.co.in 107
The Receivers Side

farhan.mohd@yahoo.co.in 108
Properties of Digital Signatures
Digital signature does not provide
privacy. If there is a need for privacy,
another layer of encryption/decryption
must be applied.
Digital signatures can provide
1. Integrity,
2. Authentication, and
3. Nonrepudiation.

farhan.mohd@yahoo.co.in 109
Properties of Digital Signatures

farhan.mohd@yahoo.co.in 110
Properties of Digital Signatures
1. Integrity The integrity of a message is preserved
because if Eve intercepted the message and
partially or totally changed it, the decrypted
message would be unreadable.
2. Authentication We can use the following reasoning
to show how a message can be authenticated. If
Eve sends a message while pretending that it is
coming from Alice, she must use her own private
key for encryption. The message is then decrypted
with the public key of Alice and will therefore be
nonreadable. Encryption with Eve's private key
and decryption with Alice's public key result in
garbage.

farhan.mohd@yahoo.co.in 111
Properties of Digital Signatures
3. Nonrepudiation Digital signature also
provides for nonrepudiation. Bob saves
the message received from Alice. If Alice
later denies sending the message, Bob
can show that encrypting and decrypting
the saved message with Alice's private
and public key can create a duplicate of
the saved message. Since only Alice
knows her private key, she cannot deny
sending the message.

farhan.mohd@yahoo.co.in 112
Key Management
We never discussed how secret keys in
symmetric-key cryptography and how
public keys in asymmetric-key
cryptography are distributed and
maintained. In this section, we touch
on these two issues. We first discuss
the distribution of symmetric keys; we
then discuss the distribution of
asymmetric keys.

farhan.mohd@yahoo.co.in 113
Key Management

farhan.mohd@yahoo.co.in 114
Key Distribution Center :KDC

farhan.mohd@yahoo.co.in 115
Key Distribution Center :KDC

farhan.mohd@yahoo.co.in 116
Key Distribution Center :KDC

A session symmetric key between two


parties is used only once.

farhan.mohd@yahoo.co.in 117
Session Keys

farhan.mohd@yahoo.co.in 118
Session Keys

farhan.mohd@yahoo.co.in 119
Session Keys

farhan.mohd@yahoo.co.in 120
Key Management

In public-key cryptography, everyone


has access to everyones public key;
public keys are available to the public.

farhan.mohd@yahoo.co.in 121
Public Announcement

farhan.mohd@yahoo.co.in 122
Public Announcement

farhan.mohd@yahoo.co.in 123
Trusted Center

farhan.mohd@yahoo.co.in 124
Controlled Trusted Center

farhan.mohd@yahoo.co.in 125
Certification Authority

farhan.mohd@yahoo.co.in 126
Certification Authority

farhan.mohd@yahoo.co.in 127
References
Cryptography and Network Security,
Forouzan B (TMH)

Cryptography and Network Security,


Kahate A (TMH)

Firewalls and Internet Security - Repelling


the Wily Hacker.2nd Edition
farhan.mohd@yahoo.co.in 128
farhan.mohd@yahoo.co.in 129

Vous aimerez peut-être aussi