Crptography PPT-2

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 48

CRYPTOGRAPHY

WHAT IS CRYPTOGRAPHY ?
Cryptography means “secret writing”.

It is the art and science of using mathematics to


encrypt and decrypt data.

Enables you to store sensitive information or


transmit it across insecure networks so that it
cannot be read by anyone except the intended
recipient.
COMPONENTS
PLAINTEXT & CIPHER TEXT

Original message ,before being transformed is


called plaintext.
After being transformed is called cipher text.
ENCRYPTION & DECRYPTION
ENCRYPTION
Encryption –
The process of converting plain text into an
unintelligible format (cipher text) is called
Encryption.
Encryption algorithm transforms plain text to
cipher text
A sender uses an encryption algorithm.
DECRYPTION
Decryption –
The process of converting cipher text into a
plain text is called Decryption.
A decryption algorithm transforms the ciphertext back
into plaintext.
Receiver uses decryption algorithm.
CIPHER
Encryption algorithm and decryption algorithm are
referred as cipher.
It is also referred to different categories of
algorithm in cryptography.
KEY
Key is a number or a set of numbers that the
cipher operates on.

To encrypt a message we need an encryption


algorithm, an encryption key, and plain text which
creates a cipher text.

To decrypt a message, we need a decryption


algorithm, a decryption key, and cipher text
revealing the plain text.
ALICE, BOB & EVE

Three characters used in cryptography.


Alice is the sender who needs to send secure data.
Bob is the recipient.
 Eve is the person who disturbs the communication
between Alice and Bob by intercepting messages or
changing the data.
ALICE, BOB & EVE
CLASSIFICATION

CRYPTOGRAPH
Y

SYMMETRIC ASYMETRIC
KEY KEY
Symmetric Key Cryptography
Asymetric Key (Public key Cryptography
Symmetric Key Cryptography
Simple modern Ciphers
 XOR cipher
 Rotation Cipher
S box
P Box
XOR Cipher
 Size of plain text, key and cipher text are
same
Rotation Cipher
Input bits are rotated to left/right
Keyed/keyless
In keyed rotation, value of key defines
number of rotations
In keyless, the no. of rotations is fixed.
Rotation Cipher (contd..)
If length of original stream is N, after N
rotations, we get original input stream.

No. of rotations must be between 1 and N-


1.
Substitution Cipher : S-Box
Transposition Cipher : P-Box
Modern Round Ciphers

 Ciphers of today are called round ciphers


because they involve multiple rounds.
Each round is a complex cipher and is
made up of simple ciphers.

 Two modern symmetric key ciphers : DES


and AES.
These ciphers are called block ciphers.
Data Encryption Standard (DES)
One Round in DES Cipher
DES Function
Advanced Encryption Standard (AES)
Configuration
Advanced Encryption Standard (AES)
Asymetric Key
Cryptography
RSA (Rivest, Shamir and Adleman)
Choosing Public and Private
Keys
1. Bob chooses two large prime numbers p and q

2. Bob Computes n= p × q

3. Bob Chooses φ such that φ = (p-1) x (q-1)

4. Bob chooses a random integer e.

5. Calculates d such that (d × e) = 1 mod φ

6. Bob announces e and n to the public; He keeps φ and d


secret.
SECURITY SERVICES
CONFIDENTIALITY
Message confidentiality or privacy means that the sender
and the receiver expect confidentiality.

 The transmitted message must make sense to only the


intended receiver.

To all others, the message must be garbage

For eg:When a customer communicates with her bank,


she expects that the communication is totally confidential
Confidentiality with Symmetric-Key Cryptography

 To provide confidentiality with symmetric-key cryptography, a sender


and a receiver need to share a secret key

 In the past when data exchange was between two specific person it was
possible to personally exchange the secret keys

 Today's communication does not often provide this opportunity

 So now a days we use a session key

 A session key is one that is used only for the duration of one session
Confidentiality with Asymmetric-Key
Cryptography
 there is no key sharing; there is a public announcement
 that is a person creates two keys: one private and one public

 keeps the private key for decryption

 he publicly announces the public key to the world

 The public key is used only for encryption; the private key is
used only for decryption

 The public key locks the message; the private key unlocks it.
Message Integrity
 The data must arrive at the receiver exactly as
they were sent

 There should be no changes over


transmission , neither accidentally or
maliciously

 Integrity of the message must be preserved for


a secure communication
Document & fingerprint
 To preserve the integrity of a document , fingerprint is needed

 For a document sent over a network , a fingerprint can be added at the


bottom to avoid illegal changes made

 Hacker wont be able to modify contents or create false files

 In order to ensure the file received, recipient can compare fingerprint


on document with fingerprint on file, if they are not same document is
not from original sender
Message and message digest
 Electronic equivalent of document & fingerprint
 Integrity is preserved by passing it through an algorithm called hash
function
 Hash function creates a compressed image of the message that can be
used as fingerprint
Creating & checking digest
 Message digest is a compressed image of the message
 It is created by sender using a hash function
 At the receiver , it creates the hash function again and compares the
new message digest with received one
 If both are same the received message has not been changed
 The message digest is kept secret and send secretly
Hash function criteria
 Hash function is used to create message digest
 To be eligible for a hash, function needs to meet 3 criteria
One-wayness
 Message digest is created by a one-way hashing function
 It must be extremely difficult to create the message if the
message digest is given

 Weak collision resistance


 Message cannot be easily forged
 In a given message & its digest, it is impossible to create another
message with same digest.
 If Alice creates a message and a digest and sends both to Bob, it
ensures that Eve cannot easily create another message that hashes
exactly to the same digest.
 If 2 messages are created using same digest ,a collision occurs
 Strong collision resistance
 Ensures that we cannot find 2 messages with same digest

 If Alice can create two messages that hash to the same digest, she can
deny sending the first to Bob and claim that she sent only the second.

 Probability of collision is higher than in previous case


Secure Hashing Algorithm-1 (SHA-1)

 Here each creates a digest of length N from a multiple


block message
Message Authentication
• Alice needs to provide proof that it is Alice sending the
message.

• To provide authentication, message authentication code


(MAC) is used.

• MAC uses a keyed hash function.

 A keyed hash function includes the symmetric key


between the sender and receiver when creating the
digest.

You might also like