100% found this document useful (1 vote)
47 views42 pages

IANSunit 1 Cryptography 2

The document discusses cryptography and encryption techniques. It begins by defining basic cryptography terminology like plaintext, ciphertext, cipher, key, encryption, decryption, etc. It then describes different types of cryptography including symmetric key cryptography where the same key is used for encryption and decryption, and asymmetric key cryptography which uses public and private keys. Specific encryption techniques are also summarized like substitution and transposition ciphers, DES, RSA, and others.

Uploaded by

Amrin Mulani
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
100% found this document useful (1 vote)
47 views42 pages

IANSunit 1 Cryptography 2

The document discusses cryptography and encryption techniques. It begins by defining basic cryptography terminology like plaintext, ciphertext, cipher, key, encryption, decryption, etc. It then describes different types of cryptography including symmetric key cryptography where the same key is used for encryption and decryption, and asymmetric key cryptography which uses public and private keys. Specific encryption techniques are also summarized like substitution and transposition ciphers, DES, RSA, and others.

Uploaded by

Amrin Mulani
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/ 42

Cryptography

Introduction
• In Greek means secret writing
• Today referred as the science and art of
transforming messages to make them secure
and immune to attacks
Basic Terminology
• plaintext - the original message
• ciphertext - the coded message
• cipher - algorithm for transforming plaintext to ciphertext
• key - info used in cipher known only to sender/receiver
• encipher (encrypt) - converting plaintext to ciphertext
• decipher (decrypt) - recovering ciphertext from plaintext
• cryptography - study of encryption principles/methods
• cryptanalysis (codebreaking) - the study of principles/ methods
of deciphering ciphertext without knowing key
• cryptology - the field of both cryptography and cryptanalysis
Plain Text and Cipher Text
• Plain Text: Language that can be easily
understood

• Cipher Text: Language that cannot be


understood

• To achieve security, plain text is transformed


into cipher text
• Cipher is a term refers to different categories of
algorithms in cryptography
• Sender-receiver needs own unique cipher fro
secure communication
• Key is a number that the cipher operates on
• To encrypt you require
– Encryption algo
– Encryption key and
– plaintext
Encryption and Decryption
• Algorithms are public
• Anyone can access them
• Keys are secret
• Need to be protected
• Alice, Bob and Eve
Cryptography
• can characterize by:
– type of encryption operations used
• substitution / transposition / product
– number of keys used
• single-key or private / two-key or public
– way in which plaintext is processed
• block / stream
Types of Cryptography

Cryptography techniques

Symmetric key cryptography Asymmetric key cryptography


Symmetric Encryption
• or conventional / private-key / single-key
• sender and recipient share a common key
• all classical encryption algorithms are private-
key
• was only type prior to invention of public-key
in 1970’s
Symmetric Cipher Model

In symmetric-key cryptography, the same key is used by


the sender (for encryption) and the receiver (for
decryption). The key is shared.
In symmetric-key cryptography, the same key is
used in both directions.
Advantages
• Algorithm used for decryption is reverse of
encryption
• i.e if encryption uses a combination of
addition and multiplication decryption is
combination of division and subtraction
• Symmetric algorithms are efficient
• Take less time to encrypt than asymmetric

Symmetric-key cryptography is often


used for long messages.
Disadvantages
• Each pair must have a unique symmetric key
• If N people want to use there need n(n-1)/2
keys
• Distribution of keys between two parties can
be difficult
Techniques for Plain Text to Cipher Text
Conversion – Traditional Ciphers

 
Transforming a plain text
message into cipher text

Substitution techniques Transposition techniques


Classical Substitution Ciphers

• where letters of plaintext are replaced by


other letters or by numbers or symbols
• or if plaintext is viewed as a sequence of bits,
then substitution involves replacing plaintext
bit patterns with ciphertext bit patterns
• Monoalphabetic
• Polyalphabetic
Monoalphabetic
• A character changes to the same character
always regardless of its position in the text
• First is the Ceaser Cipher
Caesar Cipher
• earliest known substitution cipher
• by Julius Caesar
• first attested use in military affairs
• Mechanism to make a message non-understandable
• replaces each letter by 3rd letter on
• example:
meet me after the toga party
PHHW PH DIWHU WKH WRJD SDUWB
Caesar Cipher

 
Plain Text and Cipher Text

Hi Amit, Kl Dplw,
 
Hope you are doing fine. How about Krsh brx duh grlqj ilqh. Krz derxw
meeting at the train station this Friday phhwlqj dw wkh wudlq vwdwlrq wklv
at 5 pm? Please let me know if it is ok Iulgdb dw 5 sp? Sohdvh ohw ph nqrz
with you. li lw lv rn zlwk brx.

Regards. Uhjdugv.

Atul Dwxo

Plain text message Corresponding cipher text


message
Caesar Cipher
• can define transformation as:
a b c d e f g h i j k l m n o p q r s t u v w x y z
D E F G H I J K L M N O P Q R S T U V W X Y Z A B C

• mathematically give each letter a number


a b c d e f g h i j k l m
0 1 2 3 4 5 6 7 8 9 10 11 12
n o p q r s t u v w x y Z
13 14 15 16 17 18 19 20 21 22 23 24 25
Mono-alphabetic Cipher
• Caesar cipher – if k is known rest is simple
• rather than just shifting the alphabet – random
substitution
• could shuffle (jumble) the letters arbitrarily
• each plaintext letter maps to a different random
ciphertext letter
• hence key is 26 letters long
Plain: abcdefghijklmnopqrstuvwxyz
Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN
Plaintext: ifwewishtoreplaceletters
Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA
Polyalphabetic Cipher
• Each occurrence of a character can have a
different substitute
• Relationship is one to many
• Char A can be replaced D once and Y the other
• Eg. Vigenere cipher
Vigenere Cipher
• Character in the ciphertext is chosen form a 2
dimensional table (26*26)
• Each row is permutation of 26 characters (A to Z)
• To encrypt algo finds the character to be replaced
in the first row
• Finds the position of the character in the text
(mod 26) and uses it as the row number
• then replaces the character with the character
found in the table
Transpositional Cipher
• The characters retain
their plaintext form but
change their positions
to create the plaintext
• Text is organized as a
two dimensional matrix
• The columns are
interchanged according
to the key
Block Cipher
• Traditional ciphers used character or symbols as he unit of
encryption/decryption
• Modern ciphers use a block of bits as a unit of encryption
and decryption
P box
• Permutation box
• Performs transposition at bit level
• Transposes bits
• The key and the encryption/decryption algo are
embedded in the hardware
• Plain text and cipher text have the same number of
1s and 0s
S box
• Substitution box
• Performs substitution at bit
level
• Transposes the permuted bits
• substitutes one decimal digit
with another
• 3 components
– Encoder
– Decoder
– P box
Product block
Data Encryption Standard (DES)
►most widely used block cipher in world
►encrypts 64-bit data using 56-bit key
►has widespread use
►has been considerable controversy over its
security
Conceptual View of DES

64-bit Plain 64-bit Plain 64-bit Plain


text text text



56-bit Key 56-bit Key 56-bit Key


DES DES DES

64-bit 64-bit 64-bit


Cipher text Cipher text Cipher text

Block 1 Block 2 Block n


Data Encryption Standard

16

DES has
2 transposition blocks
one swapping block
16 complex blocks called the iteration blocks
General scheme of DES

Each iteration
uses a different
key derived
form original
key
Iteration block
Triple DES
The DES cipher uses the same concept
as the Caesar cipher, but the
encryption/decryption algorithm is
much more complex due to the sixteen
48-bit keys derived from a 56-bit key.
Public Key Cryptography
• Two keys
• Public and private key
• Public key is announced to the public
Advantages
• Removes the restriction of a shared symmetric
key between two entities
• Number of keys needed is reduced
• For 10 users require 20 keys

Public-key algorithms are more


efficient for short messages.
Disadvantages
• Complex algorithms
• Association between the entity and the public
key must be verified
RSA (Rivest, Shamir, Adleman)
• The most popular one.
• Assumption/theoretical basis:
– Factoring a big number is hard.
• Variable key length (usually 512 bits).
• Variable plaintext block size.
– Plaintext must be “smaller” than the key.
– Ciphertext block size is the same as the key length.
• Based on the theory of Prime Numbers
RSA Algorithm
1. Choose two large prime numbers P and Q.
2. 2. Calculate N = P x Q.
3. Select the public key (i.e. the encryption key) E such that
it is not a factor of (P – 1) and (Q – 1).
4. Select the private key (i.e. the decryption key) D such
that the following equation is true:
(D x E) mod (P – 1) x (Q – 1) = 1
5. For encryption, calculate the cipher text CT from the
plain text PT as follows:
CT = PTE mod N
6. Send CT as the cipher text to the receiver.
7. For decryption, calculate the plain text PT from the
cipher text CT as follows: Fig 4.4
PT = CTD mod N
Example of RSA Algorithm
Encryption algorithm using Decryption algorithm using
the public key the private key

1. Encode the original 1. Raise the number to the


character using A = 1, B = 2 power D, here 77.
etc.
2. Divide the result by 119
2. Raise the number to the and get the remainder. The
power E, here 5. resulting number is the
cipher text.
3. Divide the result by 119
and get the remainder. The 3. Decode the original
resulting number is the character using 1 = A, 2 = B
cipher text. etc.

F F 6 41 4177 F B
A
6 5 Result modulo 119
Result modulo 119 6 F
= 41

You might also like