Key
• Confidentiality protection is to prevent
or minimize unauthorized access to
the data.
• Integrity: It is the concept of
protecting the reliability and
correctness of data. The integrity
protection prevents an unauthorized
alteration of data.
• Availability: Ensuring that the systems
and information are accessible when
needed.
Symmetric Key Cryptography
Plain-text input Cipher-text Plain-text output
“The quick “The quick
brown fox “AxCv;5bmEseTfid3)fGsmW brown fox
jumps over the e#4^,sdgfMwir3:dkJeTsY8R jumps over the
lazy dog” \s@!q3%” lazy dog”
Encryptio Decrypti
n on
Same key
(shared secret)
Symmetric Pros and Cons
• Strength:
🞂 Simple and really very fast (order of 1000 to 10000 faster than asymmetric
mechanisms)
🞂 Super-fast (and somewhat more secure) if done in hardware (3DES, Rijndael)
• Weakness:
🞂 Must agree the key beforehand
🞂 Securely pass the key to the other party
Key Distribution Problem
• In symmetric key cryptosystems
• Over complete graph with n nodes, nC2 = n(n-1)/2 pairs secret
keys are required.
• Example: n=100, 99 x 50 = 4,950 keys are required
• Problem: Managing large number of keys and keeping
them in a secure manner is difficult
a
Secret keys are required between
(a,b), (a,c), (a,d), (a,e), (b,c),
b e
(b,d), (b,e), (c,d), (c,e), (d,e)
c d
Desirable properties
Use briefcase example to come up with a specification that are
desirable for any cipher system that is to be used between two
entities who do not already share a symmetric key.
14
Symmetric Key Cryptography
• Also known as conventional or single-key encryption.
• The same keys are used for data encryption and
decryption
• Plays a crucial role in securing data
• Some Principal Techniques Used in Symmetric Key
Cryptography:
• Substitution Techniques (Caesar Cipher)
• Transposition
Substitution Techniques
• Hiding some data or represented in other form is known as
encryption.
• When plain text is encrypted, it becomes unreadable and is
known as ciphertext.
• In a Substitution cipher, any character of plain text from the
given fixed set of characters is substituted by some other
character from the same set depending on a key.
• For example, with a shift of 1, A would be replaced by B, B
would become C, and so on.
• A special case of Substitution cipher is known as
Caesar cipher, where the key is taken as 3.
Substitution Techniques
• Mathematical representation
• The encryption can be represented using modular
arithmetic by first transforming the letters into
numbers, according to the scheme, A = 0, B = 1,…, Z =
25. Encryption of a letter by a shift n can be described
mathematically as.
Transposition Cipher Techniques in Cryptography
• This encryption method is done by playing with the position of letters of the
plain text.
• The positions of the characters present in the plaintext are rearranged or
shifted to form the ciphertext.
• It makes use of some kind of permutation function to achieve the encryption
purpose. It is very easy to use and so simple to implement.
• Types of Transposition Cipher Techniques:
There are three types of transposition cipher techniques
• Rail Fence Transposition Cipher
• Block (Single Columnar) Transposition Cipher
Simplified Data Encryption Standard Key Generation
• Simplified Data Encryption Standard (S-DES) is a simple version of the DES Algorithm.
• It is similar to the DES algorithm but is a smaller algorithm and has fewer parameters than
DES. It was made for educational purposes so that understanding DES would become simpler.
• It is a block cipher that takes a block of plain text and converts it into ciphertext. It takes a
block of 8 bit.
• It is a symmetric key cipher i.e. they use the same key for both encryption and decryption. In
this article, we are going to demonstrate key generation for s-des encryption and decryption
algorithm. We take a random 10-bit key and produce two 8-bit keys which will be used for
encryption and decryption.
Key Generation
• In the key generation algorithm, we accept the 10-bit key and
convert it into two 8-bit keys. This key is shared between both
sender and receiver.
• In the key generation, we use three functions:
1. Permutation P10:
2. Permutation P8
3. Left Shift
Key Generation
• Step 1: We accepted a 10-bit key and permuted the
bits by putting them in the P10 table.
• Step 2: We divide the key into 2 halves of 5-bit each.
• Step 3: Now we apply one bit left-shift on each key.
• Step 4: Combine both keys after step 3 and permute
the bits by putting them in the P8 table. The output of
the given table is the first key K1.
• Step 5: The output obtained from step 3 i.e. 2 halves
after one bit left shift should again undergo the process
of two-bit left shift.
• Step 6: Combine the 2 halves obtained from step 5 and
permute them by putting them in the P8 table. The
output of the given table is the second key K2.
• Final Output
Example
Step 1: We accepted a 10-bit key and permuted
the bits by putting them in the P10 table.
Key = 1 0 1 0 0 0 0 0 1 0 (k1, k2, k3, k4, k5, k6, k7, k8, k9, k10) = (1, 0, 1, 0, 0, 0, 0, 0, 1,
0)
P10 Permutation is: P10(k1, k2, k3, k4, k5, k6, k7, k8, k9, k10) = (k3, k5, k2, k7, k4, k10, k1,
k9, k8, k6)
After P10, we get 1 0 0 0 0 0 1 1 0 0
Step 2: We divide the key into 2 halves of 5-bit
each.
l=1 0 0 0 0, r=0 1 1 0 0
Step 3: Now we apply one bit left-shift on each
key.
l = 0 0 0 0 1, r = 1 1 0 0 0
Step 4: Combine both keys after step 3 and permute the bits by putting them in
the P8 table. The output of the given table is the first key K1.
After LS-1 combined, we get 0 0 0 0 1 1 1 0 0 0
P8 permutation is: P8(k1, k2, k3, k4, k5, k6, k7, k8, k9, k10) = (k6, k3, k7, k4, k8, k5,
k10, k9)
After P8, we get Key-1 : 1 0 1 0 0 1 0 0
Step 5: The output obtained from step 3 i.e. 2 halves after one bit left shift
should again undergo the process of two-bit left shift.
Step 3 output - l = 0 0 0 0 1, r = 1 1 0 0 0
After two bit shift - l = 0 0 1 0 0, r = 0 0 0 1 1
Step 6: Combine the 2 halves obtained from step 5 and permute them by putting
them in the P8 table. The output of the given table is the second key K2.
After LS-2 combined = 0 0 1 0 0 0 0 0 1 1
P8 permutation is: P8(k1, k2, k3, k4, k5, k6, k7, k8, k9, k10) = (k6, k3, k7, k4, k8, k5,
k10, k9)
After P8, we get Key-2 : 0 1 0 0 0 0 1 1
Final Output:
Key-1 is: 1 0 1 0 0 1 0 0
Key-2 is: 0 1 0 0 0 0 1 1
Data Encryption Standard
• The Data Encryption Standard (DES) is a symmetric-key block cipher published by the National Institute of Standards and
Technology (NIST).
• DES is an implementation of a Feistel Cipher.
• Feistel Cipher model is a structure or a design used to develop many block ciphers such as DES.
• Same encryption as well as decryption algorithm is used.
• A separate key is used for each round. However same round keys are used for encryption as well as
decryption.
• It uses 16 round Feistel structure.
• The block size is 64-bit.
• Though, key length is 64-bit, DES has an effective key length of 56 bits, since 8 of the 64 bits of the key are not used by the
encryption algorithm (function as check bits only)
DES
DES
Since DES is based on the Feistel Cipher, all that is required to
specify DES is −
• Round function
• Key schedule
• Any additional processing − Initial and final permutation
Drawbacks of DES
Brute Force Attack
Captcha
• Gmail won’t allow you to do Brute Force attack.
• Captcha is very efficient invention.
Double DES
Start Inter Final
Final Inter Start
Double DES
Meet in the middle attack
Triple DES (3-DES)
Simplified AES
K1
K2
K3
ASCII values
‘O’ =110
‘K’ = 107
K0 K1 K2
G function: w is 8-bits
W5= W4 W3
Shift Rows
Mix Columns
Mix Columns
GF(16)= GF( 2^4)
• In mathematics, a finite field or Galois field is a field that contains a finite number of elements.
• As with any field, a finite field is a set on which the operations of multiplication, addition, subtraction
and division are defined and satisfy certain basic rules.
• The most common examples of finite fields are the integers mod when is a prime number.
How AES works?
AES has the following advantages:
•The encryption processes of AES are easy to learn, making it more attractive to those
dealing with AES.
•It employs longer key sizes for encryption, such as 128, 192, and 256 bits.
• Therefore, it makes the AES algorithm more resistant to infiltration or access.
•AES can be combined with other security protocols when it needs an extra security layer.
•To overcome 128-bit encryption, approximately 2128 attempts are required. This makes
it extremely difficult to infiltrate, resulting in a very secure protocol.
AES has the following drawbacks:
•Each block is always encrypted using the same algorithm.
•It employs overly simplistic algebraic structure.
•AES in counter mode is difficult to implement in software when
considering both performance and security.
•Software implementation is difficult.
Public-Key Cryptography
🞂 Probably most significant advance in the history of cryptography
🞂 Uses two keys – a public & a private key
🞂 One for encryption and another one for decryption
🞂 Knowledge of the encryption key doesn’t give knowledge of the decryption key
🞂 Asymmetric since parties are not equal
🞂 Uses number theoretic concepts to function
Main uses of Each Key
🞂 A public-key
🞂 Public to anybody
🞂 used to encrypt messages and verify signatures
🞂 A private-key
🞂 known only to the owner
🞂 used to decrypt messages, and sign (create) signatures
How does 2 different keys work?
🞂 Just a very simple example:
🞂 Public Key = 4, Private Key = 1/4, message M = 5
🞂 Encryption:
🞂 Ciphertext C = M * Public Key
🞂 5 * 4 = 20
🞂 Decryption:
🞂 Plaintext M = C * Private Key
🞂 20 * ¼ = 5
An Example: Internet Commerce
🞂 Bob wants to use his credit card to buy some brownies
from Alice over the Internet.
🞂 Alice sends her public key to Bob.
🞂 Bob uses this key to encrypt his credit-card number
and sends the encrypted number to Alice.
🞂 Alice uses her private key to decrypt this message
(and get Bob’s credit-card number).
Public Key Encryption
Clear-text Input Cipher-text Clear-text Output
“The quick “The quick
brown fox “Py75c%bn&*)9| brown fox
jumps over the fDe^bDFaq#xzjFr@g5=&nm jumps over the
lazy dog” dFg$5knvMd’rkvegMs” lazy dog”
Encryption Decryption
public Different keys privat
e
Recipient’s Recipient’s
public key private key
Discrete Logarithmic Problem
Discrete Logarithmic Problem
• 17 is prime number and 5 is prime root and also called as a generator
=5 =12
=8 =9
=6 =11
If x is known, its easy to compute it.
=13 =4
But if x not known, then its hard.
=14 =3
=2 =15
=10 =7 X can be 9, 25, 41, 57, 73,……
So easy in one direction, but hard in other direction.
=16 =1
This is an analogy of one-way function
g is a generator or prime root, p is prime no.
Answer is 6
Can exchange values 26 and 39.
Others can not access shared key 42.
Tom can act as man in the Middle
attack
Elliptic Curve Cryptography