0% found this document useful (0 votes)
77 views44 pages

Chapter 3 Cryptography

The document contains lecture notes on the topic of cryptography. It covers the basics of cryptography including definitions of plaintext, ciphertext, encryption, and decryption. It then discusses different cryptographic techniques like Caesar cipher, Vigenere cipher, transposition techniques including rail fence cipher and columnar transposition, and stenography. Specific techniques like the Vigenere cipher are explained through examples. The document aims to teach students about classic cryptographic algorithms and concepts.

Uploaded by

NARESH BADWE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views44 pages

Chapter 3 Cryptography

The document contains lecture notes on the topic of cryptography. It covers the basics of cryptography including definitions of plaintext, ciphertext, encryption, and decryption. It then discusses different cryptographic techniques like Caesar cipher, Vigenere cipher, transposition techniques including rail fence cipher and columnar transposition, and stenography. Specific techniques like the Vigenere cipher are explained through examples. The document aims to teach students about classic cryptographic algorithms and concepts.

Uploaded by

NARESH BADWE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 44

1

DEPARTMENT OF COMPUTER TECHNOLOGY


V-SEMESTER
COMPUTER SECURITY

CHAPTER NO.3
CRYPTOGRAPHY

2
CHAPTER 1:- SYLLABUS

1 Introduction
.

2 Substitution techniques

3 Transposition techniques

4 Hashing

5 Symmetric and asymmetric cryptography

DTEL 3
CHAPTER-1 SPECIFIC OBJECTIVE / COURSE OUTCOME

The student will be able to:

1 To understand cryptography.
.

2 To understand transposition techniques

3 To understand symmetric and asymmetric cryptography

DTEL 4
LECTURE 1:- CRYPTOGRAPHY Introduction

•Method of writing a secret code.


•Necessary while communicating over un-trusted media
like internet
•There are some specific requirements, including :

–Authentication: Process of proving identity

–Privacy/Confidentially : Ensuring that no one can read


the message except intended receiver.
–Integrity: Received message has not been altered.

–Non-repudiation: A mechanism to prove that the


sender really send this message.
5

DTEL 5
LECTURE 1:- CRYPTOGRAPHY Introduction

• The initial unencrypted data is referred as “plaintext”

• The encrypted text is called as “cipher-text”

• The process of converting the plaintext into cipher-text is


called as encryption.

• The process of converting the cipher-text into original


plaintext is called as decryption.

DTEL 6
LECTURE 1:- CRYPTOGRAPHY Introduction

Three type of cryptography:


Secrete Key cryptography (SKC)/ Symmetric
cryptography :
Used a single key for both encryption and decryption

Public Key cryptography (PKC)/ Asymmetric


cryptography:
Uses one key for encryption and another for
decryption

Hash functions:
Uses a mathematical transformation to irreversibly
“encrypt” information.
7

DTEL 7
LECTURE 1:- CRYPTOGRAPHY Introduction

Encryption and decryption process

Sender Receiver

Plain text Plain text

Encrypt Decrypt

Cipher Internet Cipher


Text Text 8

DTEL 8
LECTURE 1:- CRYPTOGRAPHY

THANK YOU

DTEL 9
LECTURE 2:- CRYPTOGRAPHY Caesar’s Cipher

Cryptography:
Cryptography is an ancient art and science of writing in
secret message. In areas like data and telecommunications

Cryptanalysis:
The process of trying to break any cipher text message to
obtain the original massage itself is known as cryptanalysis.

Cryptology:
It is a combination of cryptography and cryptanalysis.
In cryptography, a cipher (or cypher) is an algorithm for
performing encryption

10

DTEL 10
LECTURE 2:- CRYPTOGRAPHY Caesar’s Cipher/shift cipher

Plain text: ABCDEFGHIJKLMNOPQRSTUVWXYZ

Cipher: DEFGHIJKLMNOPQRSTUVWXYZABC
(When key is 3 or shift is 3)

Here, letter of the plaintext is replaced by a letter with


some fixed number of positions from the alphabets

The transformation can be represented by arranging


the position of two alphabets - the cipher alphabet is
nothing but the plain alphabet rotated left or right by
some number of positions

11

DTEL 11
LECTURE 2:- CRYPTOGRAPHY

THANK YOU

DTEL 12
LECTURE 3:- CRYPTOGRAPHY Vigenere Cipher

To decrypt the text consider the row start with the key letter
and find the cipher-text letter in that row.

After finding the cipher-text letter in that row, check in which


column that letter is available.

And finally write that column letter.

This process is repeated till the end of cipher-text.


This method used only for the text .

13

DTEL 13
LECTURE 3:- CRYPTOGRAPHY Vigenere Cipher

The Vigenere cipher consists of several Caesar ciphers in


sequence with different shift values.

To encrypt, a table of alphabets can be used, termed a


tabula recta, Vigenère square, or Vigenère table.

It consists of the alphabet written out 26 times in different


rows, each alphabet shifted cyclically to the left compared to
the previous alphabet

14

DTEL 14
LECTURE 3:- CRYPTOGRAPHY Vigenere Cipher

15

DTEL 15
LECTURE 3:- CRYPTOGRAPHY Vigenere Cipher

•For example, suppose that the plaintext to be encrypted is


ATTACKATDAWN
•keyword :"LEMON":
•Now
A T T A C K D O W N
L EM ON L E M O N

• (plain text check in column)


•(keyword check in row)

•The resultant encrypted text is


–LXFOPVEFRNHR
16

DTEL 16
LECTURE 3:- CRYPTOGRAPHY Transposition Technique

•Rail Fence Cipher


In a Rail Fence Cipher, after removing the spaces from the
original message, we would write the characters in the
message in the zigzag pattern.
Ex:
THIS IS A TEST

(key is 3)
The result is “ TIE HSSTS IAT “
17

DTEL 17
LECTURE 3:- CRYPTOGRAPHY Transposition Technique

•Columnar Transposition Cipher


The message is written out in rows of a fixed length and
read out again column by column.
A columnar transposition, also known as a row-column
transpose
The length of column is decide from the keyword

18

DTEL 18
LECTURE 3:- CRYPTOGRAPHY Transposition Technique

For example :
Suppose we use the keyword ZEBRAS and the message
WE ARE DISCOVERED. FLEE AT ONCE. In a regular
columnar transposition, we write this into the grid as
Follows:
Z E B R A S-----------------keyword
6 3 2 4 1 5
W E A R E D
I S C O V E
R E D F L E
E A T O N C
E Q K J E U
Providing five nulls (QKJEU) at the end. The cipher text is
then read off as:
19
EVLNE ACDTK ESEAQ ROFOJ DEECU WIREE
DTEL 19
LECTURE 3:- CRYPTOGRAPHY

THANK YOU

DTEL 20
LECTURE 4:- CRYPTOGRAPHY Stenography

Stenography :

Steganography is a technique of hiding a large amount of


secret message within an ordinary message and the
extraction of it at its destination.

Steganography takes cryptography a step further by hiding


an encrypted message so that no one suspects it exists.
Ideally, anyone scanning your data will fail to know it
contains encrypted data.

21

DTEL 21
LECTURE 4:- CRYPTOGRAPHY Stenography

Advantages :

• Advantage is that it can be employed by parties who have


something to lose should the fact of their secret
communication be discovered.

• Encryption flags are important or secret or may identify


the sender as someone with something to hide.

• In modern digital steganography, data is first encrypted by


the usual means and then inserted using a special
algorithm, into redundant data that is part of a particular
file format such as JPEG image.
22

DTEL 22
LECTURE 4:- CRYPTOGRAPHY Stenography

Disadvantages :

• Disadvantage is it requires a lot of overhead to hide a few


bits of information.

• Once the system is discovered, it becomes virtually


worthless. This problem is solved by insertion method
which uses some sort of key.

• Alternative is, first encrypt the message and then hide
using Steganography.

23

DTEL 23
LECTURE 4:- CRYPTOGRAPHY Stenography

Disadvantages :

• Disadvantage is it requires a lot of overhead to hide a few


bits of information.

• Once the system is discovered, it becomes virtually


worthless. This problem is solved by insertion method
which uses some sort of key.

• Alternative is, first encrypt the message and then hide


using Steganography.

24

DTEL 24
LECTURE 4:- CRYPTOGRAPHY

THANK YOU

DTEL 25
LECTURE 5:- CRYPTOGRAPHY Hashing

A hash is a special function that performs one-way


encryption, meaning that once the algorithm is processed,
there is no feasible way to take the cipher text and retrieve
the plaintext that was used to generate it.

The purpose of a hash function is to produce a “fingerprint”


of a file, message, or other block of data.

26

DTEL 26
LECTURE 5:- CRYPTOGRAPHY Hashing

• Hash value should have the following properties for


message authentication-

• Hash function (H) can be applied to a block of data of any


size.

• Hash function (H) produces a fixed length output.

• Hash Function, H (m) is relatively easy to compute for


any given m.

27

DTEL 27
LECTURE 5:- CRYPTOGRAPHY Hashing

• By providing any hash value h, it is computationally


infeasible to find m such that H(m) = h. This is known
as “one-way property”.

• By providing any given block m, it is computationally


infeasible to find k ≠ m with
H (k) = H (m). This is known as “weak collision
resistance”.

• It is computationally infeasible to find any pair (m, k) such


that H (m) = H (k). This is known as “strong collision
resistance”

28

DTEL 28
LECTURE 5:- CRYPTOGRAPHY

THANK YOU

DTEL 29
LECTURE 6:- CRYPTOGRAPHY Symmetric and asymmetric
key encryption

Symmetric Algorithm:
• In symmetric algorithm, the same key is used for
encryption and decryption. Hence this is also known as
• Single key or secrete key or shared key algorithm. This
key has to kept secret, sender and receiver uses the
same key to read encrypted data. The key is only known
to sender and receiver and no one else.
• The sender and receiver must agree on a key before they
communicate. To set up private channels with different
parties, you need a new key for each channel.
Maintaining a large number of shared secret key can
become a quite tedious task.

30

DTEL 30
LECTURE 6:- CRYPTOGRAPHY Symmetric and asymmetric
key encryption

Encryption algorithms are divided into two types

Block Cipher a block cipher encrypts 64-bit blocks of data,


with a complex encryption function. Security of these
ciphers totally depends on the design of the encryption
function. A block cipher encrypts blocks belonging to the
same document all under the same key.

Stream Cipher: It encrypts smaller blocks of plain text data,


usually bits or bytes. A stream cipher encrypts the plain text
under a continuously changing key stream. Security of these
ciphers depends on the design of the key stream generator.

31

DTEL 31
LECTURE 6:- CRYPTOGRAPHY Symmetric and asymmetric
key encryption
Asymmetric Algorithm:
• Asymmetric Encryption is a form of Encryption where
keys come in pairs. What one key encrypts, only the other
can decrypt.
• Frequently the keys are interchangeable, in the sense
that if key A encrypts a message, then B can decrypt it,
and if key B encrypts a message, then key A can decrypt
it. While common, this property is not essential to
asymmetric encryption.
• Asymmetric Encryption is also known as Public Key
Cryptography, since users typically create a matching key
pair, and make one public while keeping the other secret.

32

DTEL 32
LECTURE 6:- CRYPTOGRAPHY Symmetric and asymmetric
key encryption
• Users can ‘sign’ messages by encrypting them with their
private keys. This is effective since any message
recipient can verify that the user’s public key can decrypt
the message, and thus prove that the user’s secret key
was used to encrypt it.
• If the user’s secret key is, in fact, secret, then it follows
that the user, and not some impostor, really sent the
message.
• Users can send secret messages by encrypting a
message with the recipient’s public key. In this case, only
the intended recipient can decrypt the message, since
only that user should have access to the required secret
key.
33

DTEL 33
LECTURE 6:- CRYPTOGRAPHY

THANK YOU

DTEL 34
LECTURE 7:- CRYPTOGRAPHY DES

35

DTEL 35
LECTURE 7:- CRYPTOGRAPHY DES

Steps :
• 64 bit plain text block is handed over to an Initial
Permutation (IP) function.
• Initial Permutation is performed on plain text.
• IP produces two halves of permuted block.
• Left Plain Text (LPT) and
• Right Plain Text (RPT)

• Each LPT and RPT goes through 16 rounds of
encryption process, each with its own key. In the end
LPT and RPT are rejoined and Final Permutation (FP) is
performed on the combined block.
• The result is 64 bit cipher text
36

DTEL 36
LECTURE 7:- CRYPTOGRAPHY DES

 Initial Permutation (IP) happens only once. IP replaces


the first bit of original plain text block with 58th bit of
original plain text block, second bit with the 50th bit and
so on.
 Complete transposition table is used by IP and should
read from left to right.
 After IP is done, the resulting 64 bit text block is divided
into two half block, each with 32 bits.

 (LPT and RPT). Now 16 Rounds are performed on these
two blocks.
 Each 16 Rounds are consists of following broad level
steps
37

DTEL 37
LECTURE 7:- CRYPTOGRAPHY

THANK YOU

DTEL 38
LECTURE 8:- CRYPTOGRAPHY Digital Signatures

 A digital signature is an electronic signature.

 It is used to authenticate the identity of the sender or the


signer of a document.

 It has ability to ensure that the original content of the


message or document that has been sent is unchanged.

 Digital signatures are used with any kind of message and


easily transportable. It can be automatically time-
stamped. If a message with digital signature arrived
means that the sender cannot easily repudiate it later.

39

DTEL 39
LECTURE 8:- CRYPTOGRAPHY Digital Signatures

 A digital signature can be used with encrypted or plain


text message, so that the receiver can be ensured the
identity of the sender and the message received is
original or tampered.

 A digital certificate contains the digital signature of the


certificate-issuing authority (CA) hence anyone can verify
that the certificate is real or fake.

 Digital signatures are based upon both hashing functions


and asymmetric cryptography. Both encryption methods
play an important role when signing digital document.
40

DTEL 40
LECTURE 8:- CRYPTOGRAPHY Digital Signatures

How It Works :
• Assume you were going to send the draft of a contract to
your lawyer in another town. You want to give your
lawyer the assurance that it was unchanged from what
you sent and that it is really from you.

• You copy-and-paste the contract into an e-mail note.

• Using special software, you obtain a message hash


(mathematical summary) of the contract.

• You then use a private key that you have previously


obtained from a public-private key authority to encrypt
the hash.
41

DTEL 41
LECTURE 8:- CRYPTOGRAPHY Digital Signatures

• The encrypted hash becomes your digital signature of


the message.

• At the other end, your lawyer receives the message.


• To make sure it’s intact and from you, your lawyer makes
a hash of the received message.

• Your lawyer then uses your public key to decrypt the


message hash or summary.

• If the hashes match, the received message is valid

42

DTEL 42
LECTURE 8:- CRYPTOGRAPHY

THANK YOU

DTEL 43
References Books:
cryptography and Network security by atul kahate
Compute security principle and practice by william
stalling

References Web:
http://www.pgpi.org/doc/pgpintro
http://www.emailtrackerpro.com
http://www.kmint21.com
http://www.jjtc.com/Steganography/tools.html

DTEL 44

You might also like