0% found this document useful (0 votes)
65 views

Chapter 3 Cryptography

Cryptography is used to secure communication over insecure channels. It includes encryption to encode messages into ciphertext and decryption to decode ciphertext back into plaintext. There are symmetric encryption algorithms that use the same key for encryption and decryption, and asymmetric algorithms that use different public and private keys. Common techniques include substitution ciphers that replace letters and transposition ciphers that rearrange letters. Steganography hides encrypted messages within ordinary cover files like images.
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)
65 views

Chapter 3 Cryptography

Cryptography is used to secure communication over insecure channels. It includes encryption to encode messages into ciphertext and decryption to decode ciphertext back into plaintext. There are symmetric encryption algorithms that use the same key for encryption and decryption, and asymmetric algorithms that use different public and private keys. Common techniques include substitution ciphers that replace letters and transposition ciphers that rearrange letters. Steganography hides encrypted messages within ordinary cover files like images.
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/ 43

Introduction:

Cryptography is used to make communication over insecure medium.

Terms used in Cryptography:

Plain text

Plain text signifies a message that can be understood by the sender, the recipient and also by
anyone else who gets an access to the message.

Cipher text

When a plain text message is codified using any suitable scheme, the resulting message is
called as cipher text.
Cryptography

Cryptography is an ancient art and science of writing in secret message. In areas like data and
telecommunication, cryptography is most important when communicating over any untrusted
medium. It includes any network, internet.
Cryptography, not only protect data from alteration, but it can also be used for authentication
of users.
Applications of Cryptography

1. Data Hiding: The original use of cryptography is to hide something that has been
written.

2. Digitally Code: Cryptography can also be applied to software, graphics or voice that
is, it can be applied to anything that can be digitally coded.

3. Electronic payments in Banking: When electronic payments are sent through a


network, the biggest risk is that the payment message will alter or bogus messages
introduced and the risk that someone reads the messages may be minor significance.

4. Message Authentication: One cannot entirely prevent someone from tampering with
the network and changing the message, but if this happens it can certainly be detected.
This process of checking the integrity of the transmitted message is often called message
authentication. The most recent and useful development in the uses of cryptography is
the Digital Signature
5. Mobile banking, ATM , Credit cards

6. Email, Ecommerce, Electronic payment gateways


Cryptanalysis

Cryptanalysis is the technique of decoding messages from a non-readable format back to


readable format without knowing how they were initially converted from readable format to
non-readable format.
Cryptology:

It is a combination of cryptography and cryptanalysis.


In cryptography , a cipher is an algorithm for performing encryption and decryption.

Conventional Cryptosystem Model


Encryption:

The process of encoding plain text into cipher text message is known as Encryption.

Decryption:

The process of transforming cipher text message into plain text or original text is known as
Decryption.
At the time of communication , the sender computer transforms a plain text message into
cipher text message with the help of encryption.

Then the encrypted cipher text message is sent to the receiver over a network i.e. internet.

The computer at receivers end then takes this encrypted message, and perform the reverse
of encryption means the decryption process to get original plaintext message.

For encryption a plaintext message , the sender performs encryption with the help of
different encryption algorithms.

For decrypting a received encrypted message, the recipient performs the decryption with
the help of decryption algorithms.
Substitution and Transposition Techniques:
In substitution technique, letters of plaintext can be replaced by another letters or
numbers or symbols.

CAESAR’S CIPHER :

• Was Developed By Julius Caesar.


• the characters of plain text message are replaced
by other characters, numbers or symbols.
• Example :If each alphabet in a message is replaced
by an alphabet 3 place down the line then
PLAIN TEXT: ABC
KEY: 3
CIPHER TEXT: DEF
Modified Caesar’s Cipher:

Mono-alphabetic Cipher

 Major Weakness of Caesar Cipher is its predictability


 Here, Random Substitution is used.
 In the plaintext message each A is replaced with any
alphabet i.e. B….Z.& each B replaced with any
alphabet A or C...Z

Homophonic Substitution Cipher

 One plain text alphabet can map to more than one


cipher text alphabet.
 A can be replaced by [D,H,P,R] and B can be
replaced by [E,I,Q,S].
Polygram Substitution Cipher

 PolyGram Substitution Cipher Technique replaces one block of plain text with a block of
cipher text.

 It does not work on a Character-by-Character basis.

 Example:

HELLO POLYGRAM SUBSTITUTION YUQQW

HELL POLYGRAM SUBSTITUTION TEUI


.
Transposition Technique:

Transportation technique does not replace alphabets from plaintext with other whereas, it
performs some permutation on alphabets of plaintext.

Simple Columnar Transposition:


Algorithm Steps:-

1. Write the plain text message row by row in a rectangle of a predefined size (keyword
size)

2. Read the message column by column, however, it need not be in the order of columns, it
can be any random order.

3. The message thus obtained is the cipher text message.


Example: Plain Text: ―Come Home Tomorrow”

Keyword: ZEBRAS

Consider a rectangle with six column and. Therefore, when the message is written in the
rectangle row by row it will look as follow

Column 1 Column 2 Column 3 Column 4 Column 5 Column 6

C O M E H O
M E T O M O
R R O W
Now, decide the order of columns as some random order, say, 4, 6, 1, 2, 5, 3 Then read
the text in the order of these columns.

The cipher text obtained from it would be :EOW OO CMR OER HM MTO

While Decryption phase the cipher is written back in same rectangle with same size and
all ciphers are placed as per the key.
Double Columnar Transposition technique

Algorithm Steps:-

1. Write the plain text message row by row in a rectangle of a predefined size
(keyword size)

2. Read the message column by column, however, it need not be in the order of
columns, it can be any random order.

3. The message thus obtained is the cipher text message of round 1

4. Repeat steps 1 to 3 as many times as desired.

Example: Plain Text: ―Come Home Tomorrow


Keyword: ZEBRAS
Consider a rectangle with six column and. Therefore, when the message is written in the
rectangle row by row it will look as follow

Column 1 Column 2 Column 3 Column 4 Column 5 Column 6

C O M E H O
M E T O M O
R R O W

Now, decide the order of columns as some random order, say, 4, 6, 1, 2, 5, 3 Then
read the text in the order of these columns.

The cipher text obtained from it would be :EOW OO CMR OER HM MTO
Column 1 Column 2 Column 3 Column 4 Column 5 Column 6

E O W O O C
M R O E R H
M M T O

Now, decide the order of columns as some random order, say, 4, 6, 1, 2, 5, 3


Then read the text in the order of these columns.

The cipher text obtained from it would be : OEO CH EMM ORMORWOT in


Round 2
Steganography :
It 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.

In modern digital steganography , data is encrypted using encryption algorithm.


Encrypted data is inserted into cover media (JPEG image).
Encrypted data will be added in cover media using Stego-key

The following formula provides the description of Steganographic process.

Cover media + Hidden data + Stego- key =. Stego -medium


Cover media is the file in which we will hide the hidden-data, which may also be
encrypted using stego-key . The resulted file is stego-medium. Cover media can be image
or audio file.

Disadvantage is it requires a lot of overhead to hide a few bits of information.

Once a 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.

Advantage is that it can be employed by parties who have something to loss 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.
Terminology used in steganography:

Cover medium: Data within which a message is to be hidden.

Stegno-medium: Data within which a message has been hidden.

Message: Data that is or will be hidden within a stegno-medium or cover-medium


respectively.

Redundant Bits: Bits or data in cover-medium that can be modified without compromising
that medium’s integrity.
Symmetric and Asymmetric Cryptography:

Cryptographic algorithms are nothing but the sequences of processes or rules, which are
used to encode and decode message in a cryptographic system.

There are two types of cryptographic algorithms

Symmetric Algorithm and

Asymmetric Algorithm.
Introduction to Symmetric Encryption:
In symmetric algorithm, the same key is used for encryption and decryption. Hence this is
also known as single key or secret key or shared key algorithm The key has to be 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.
Encryption algorithms are divided into two types:

Block Cipher:
Block Cipher technique involves encryption of one block of text at a time. Decryption also
takes one block of encrypted text at a time.
The blocks used in block ciphers generally contain 64 bits or more.
Advantages: Random Access, Potentially High Security.
Disadvantages: Larger Block Size needed, Patterns retained throughout messages.
Stream Cipher:
Stream Cipher technique involves the encryption of one plain text byte at a time. The
decryption also happens one byte at a time .
Advantages: Can work on smaller Block series, Little memory/processing/Buffering Needed.
Disadvantages: Random Access Difficult, Hard to use large keys, sender and receiver must
be synchronized, inserted bits can lead to errors.
Data Encryption Standard (DES):

The DES is the classic among the symmetric block cipher algorithms. DES was developed
in the 1970s as a US-government standard for protecting non-classified information and
was published as a Federal Information Processing Standard.

DES encrypts 64 bit clear text blocks under the control of 56 bit keys. Each key is extended
by a parity byte to give a 64 bit working key.

DES based on two fundamental attributes of cryptography:

Substitution and Transposition

DES consists of 16 steps each of which is called as a round.

Each round performs the steps of substitution and transportation techniques for scrambling
of the characters.
Steps:
64 bit plaintext is handed over to an Initial Permutation (IP) function.
Initial Permutation is performed on plaintext.
IP produces two halves of permuted block. Left Plaintext (LPT) and Right Plaintext (RPT).
Each LPT and RPT goes through 16 rounds of encryption process each with its own key.
In the end LPT and RPT are re-joined and Final Permutation (FP) is performed on the
combined block.
The result is 64 bit Cipher text.
Initial Permutation (IP) happens only once. IP replaces the first bit of original Plaintext block
with 58 th bit of original plaintext block, second bit with the 50 th 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
bit (LPT and RPT).
Now 16 rounds are performed on these blocks.
Each 16 Rounds are consists of following broad level steps.
Key Transformation:

A 56 bit key is available for every round.

During each round, a separate 48 bit sub-key is generated from 56 bit key using key
transformation process.

This is possible by dividing 56 key into 2 half of 28 bits. Now, these 28 bits are
circularly shifted left by one or two positions depending upon round.

For example, Round=1,2,9,16 and shift=1.


Expansion Permutation:

During this phase, the Right plaintext (RPT) is expanded from 32 bits to 48 bits.

Then the 32 bit RPT is divided into 8 different blocks and each block consisting of 4 bits.

Next, each 4 bit block of previous step is expanded to a corresponding 6 bit block i.e. per 4
bit block, 2 more bits.

This process results into expansion as well as permutation of the input bits. While creating
the output.

48 bit key is XOR with 48 bit RPT and resulting output is given to next step.
S- Box Substitution:

This process accepts the 48 bit input from the XOR operation involving the compressed
key and expanded RPT and produces a 32- bit output using substitute technique.

The substitution is performed by 8 substitution boxes, and it has 6 bit input and 4 bit
output.

The 48 block is divided into 8 sub block.

The output of each S box is combined to form 32 bit block and given to next stage.
P- Box Permutation:

The 32 bit outputs are permuted using a P- Box.

This involves simple permutation.

For example- 16 in the block indicates that the bit at position 16 of the original input
moves to a bit at position 1 in output.
XOR and swap :

Left half portion of the initial 64 bit text block is XORed with the output produced by
P- Box permutation.

Result is now the new right half i.e RPT.

The old RPT becomes new left half in process of swapping.

Final permutation is performed only once, at the end of 16 rounds.

The output of Final permutation is the 64 bit encryption block.


Asymmetric Cryptography:

• Each party contain two keys.

– Public key & private key.

• One key used for encryption and another, different key for decryption.

• Also known as public key cryptography.

• Sender send message encrypting with receivers public key.

• Receiver decrypt using private key.


Digital Signature:

 Used to authenticate the identity of the sender or


signer of a document.
 It has ability to ensure that content of message are
unchanged.
 It provides no repudiation .
 It can be used with encrypted message or plaintext
 It is based on hashing and asymmetric cryptography.
 Digital certificate contains digital signature of the
certificate issuing authority.
Digital signatures are based upon both hashing functions and asymmetric cryptography.
Both encryption methods play an important role when signing digital document.
.
At Senders End :
Message digest is generated using a set of Hash function (algorithm).
A message digest is encrypted using senders private key. The resulting encrypted message
digest is known as digital signature.
Digital signature is attached with the data or message and sends it to the receiver.
At Receivers End :
Receiver uses senders public key to decrypt digital signature to obtain message digest
generated by sender.
Receiver uses same message digest algorithm, which is used by sender to generate a new
message digest ( of receiver).
Now, receiver will compare these two message digests, i.e senders message digest and
receivers message digest.
If message digest are equal then the signature is valid else not.
Digital Signature – Advantages:

 Authentication

 Used to authenticate the source of message


 When ownership of a digital signature secret key is bound
to specific user.
 A valid signature shows that the message sent by that user.

 Integrity

 If a message is digitally signed, any change in the message will


invalidate the signature.
 Furthermore there is no efficient way to modify a message and
its signature to produce new message with valid signature.
Digital Signature – Disadvantages:

 Algorithms & protocols of digital signature will not


provide certainty about the date and time
 The sender might / might not have included a time
stamp with signature.
Non-repudiation
 Repudiation refers to act of disclaiming responsibility for a message.
 Recipient may insist the sender attach signature to make repudiation more difficult.
 Loss of users private key will mean that all digital signatures using key & form user are
suspect.
 CA maintain a public repository of public key so the association user key is certified and
signature cannot be repudiated.

You might also like