Unit 2 Private and Public Cryptosystem
Unit 2 Private and Public Cryptosystem
Hrs.)
• Block Ciphers, • ElGamal Curve Cryptography,
• DES • Elliptic Curve Cryptography,
• AES, • Format Preserving Encryption,
• IDEA, • Overview of Homomorphic
• Stream Ciphers, Encryption,
• RC4, • Lightweight Cryptography and
• Stream Cipher using Feedback • Post Quantum Cryptography
Shift Registers,
Cryptography
• The word cryptography comes from two Greek words meaning ―secret writing‖
and is the art and science of information hiding.
• This field is very much associated with mathematics and computer science with
application in many fields like computer security, electronic commerce,
telecommunication, etc.
• In the ancient days, cryptography was mostly referred to as encryption – the
mechanism to convert the readable plaintext into unreadable (incomprehensible)
text i.e. ciphertext, and decryption – the opposite process of encryption i.e.
conversion of ciphertext back to the plaintext.
• Though the consideration of cryptography was on message confidentiality
(encryption) in the past, nowadays cryptography considers the study and practices
of authentication, digital signatures, integrity checking, and key management, etc.
Cryptanalysis
The terms encode and decode or encipher and decipher are used instead of encrypt and decrypt. That is, we say
that we encode, encrypt, or encipher the original message to hide its meaning. Then, we decode, decrypt, or
decipher it to reveal the original message.
Encryption and Decryption
Encryption is the process of encoding a message so that its meaning is not obvious i.e. converting information
from one form to some other unreadable form using some algorithm called cipher with the help of secret
message called key.
The converting text is called is plaintext and the converted text is called ciphertext.
Decryption is the reverse process, transforming an encrypted message back into its normal, original form. In
decryption process also the use of key is important.
The terms encode and decode or encipher and decipher are used instead of encrypt and decrypt. That is, we say
that we encode, encrypt, or encipher the original message to hide its meaning. Then, we decode, decrypt, or
decipher it to reveal the original message.
Key
• A key is a parameter or a piece of information used to determine the output of
cryptographic algorithm.
• While doing the encryption, key determines the transformation of plaintext to the
cipher text and vice versa.
• Keys are also used in other cryptographic processes like message authentication
codes and digital signatures.
• Most of the cryptographic systems depend upon the key and thus the secrecy of
the key is very important.
• Another important issue for the key is its length.
• Since key is the sole entity that defines the strength of the security (normally
algorithm used is public) we need to select the key in a way such that attacker
should take long enough to try all possibilities.
• To prevent the key from being guessed the choice of the key must be random.
Cipher
• Historical Ciphers: Also called classical ciphers used processes like substitution
and transposition or combination of both called product ciphers.
• These historic ciphers use the single key for both encryption and decryption
(symmetric cipher).
• To reduce the cipher attacks, in substitution instead of
• monoalphabetic - a letter for letter,
• polyalphabetic- one or more letters for single letter substitution can be used.
Modern Ciphers:
Modern encryption methods can be divided by two criteria: by type of
input data, and by type of key used.
Shifting
Rounds Shift
1, 2, 9, 16 One bit
… , 𝐾1.
Double DES
𝑆; 𝑏𝑖𝑗 = 𝑆(𝑎𝑖𝑗).
In the SubBytes step, each byte in the state is replaced with the corresponding S-box value,
Advanced Encryption Standard (AES)
2. Shift Rows
1st row: no shift.
In the ShiftRows step, bytes in each row of
2nd row: a 1-byte circular left shift.
the state are shifted cyclically to the left. The
3rd row: a 2-byte circular left shift.
number of places each byte is shifted differs
for each row. 4th row: a 3-byte circular left shift.
Advanced Encryption Standard (AES)
3. Mix Columns
• For example, if the next byte generated by the generator is 01101100 and the next
• Asymmetric encryption use two keys, one to encrypt the data, and
another key to decrypt the data.
• These keys are generated together.
• One is named as Public key and is distributed freely.
• The other is named as Private Key and it is kept hidden.
• Both Sender & Recipient has to share their Public Keys for
Encryption and has to use their Private Keys for Decryption.
Asymmetric Key Cryptography
How it WORK?
Difference between Symmetric and asymmetric Key Cryptography
ElGamal Cryptography
• Public Key encryption algorithm.
• Proposed by Taher Elgamal in 1985.
• Based on Diffie-Hellman key Exchange.
Steps
• Key Generation
• Encryption
• Decryption
Key Generation
• Agent X Chooses
1. A large Prime p
2. A primitive element(root) g modulo p
3. A (possibly random) integer d with 1 < d < p-1
4. Compute e= gd mod p
5. Posts public key (p, g, e).
6. Private key is d.
Encryption
1. Agent Y encrypts a short message M (M<p) and send it
to Agent X .
2. Agent Y chooses a random integer k such that 1<=k<=p-
1 (which he keeps secret).
3. Agent Y computes Y1= gk mod p and Y2= M*e k mod p.
4. Agent Y sends his encrypted message (Ciphertext) (Y1,
Y2) to agent X.
Decryption
1. When Agent X receives the encrypted message
(Ciphertext) (Y1, Y2), he decrypts (using the private key
d) by Computing
2. Plaintext(M)= Y2*(Y1 d )-1 mod p
Exercise
• Let p=11
• d=3
• E1=2
• Pt=7
• R=4
• Perform the encryption and decryption using Elgamal
algorithm.
Solution
Elliptic Curve Cryptography
• Elliptic Curve Cryptography (ECC) is an encryption technology
comparable to RSA that enables public-key encryption.
• While RSA’s security is dependent on huge prime numbers, ECC
leverages the mathematical theory of elliptic curves to achieve
the same level of security with considerably smaller keys.
• It was discovered by Victor Miller of IBM and Neil Koblitz of the
University of Washington in the year 1985.
Elliptic Curve Cryptography
• ECC, as the name implies, is an asymmetric encryption algorithm
that employs the algebraic architecture of elliptic curves with
finite fields.
• •Elliptic Curve Cryptography (ECC) is an encryption technology
comparable to RSA that enables public-key encryption.
• •Elliptic curve cryptography algorithms entered wide use from
2004 to 2005.
Elliptic Curve Cryptography
• Elliptic Curve Cryptography (ECC)is an approach to public-key
cryptography, based on the algebraic structure of elliptic curves
over finite fields. ECC requires a smaller key as compared to
non-ECC cryptography to provide equivalent security.
Elliptic Curve Cryptography
• For a better understanding of Elliptic Curve Cryptography, it is very important to
understand the basics of the Elliptic Curve.
• An elliptic curve is a planar algebraic curve defined by an equation of the form
y2 = x3+ax+b
• Where ‘a’ is the co-efficient of x and ‘b’ is the constant of the equation.
• The curve is non-singular; that is, its graph has no cusps or self-intersections.
• In general, an elliptic curve looks like as shown below.
• Elliptic curves can intersect almost 3 points when a straight line is drawn
intersecting the curve.
• As we can see, the elliptic curve is symmetric about the x-axis.
• This property plays a key role in the algorithm.
Elliptic Curve Cryptography
Elliptic Curve Cryptography
For the sake of simplicity and practical implementation of the
algorithm, we will consider only 4 variables, one prime P and G (a
primitive root of P) and two private values a and b.
•P and G are both publicly available numbers.
•Users (say Alice and Bob) pick private values a and b and they
generate a key and exchange it publicly.
•The opposite person receives the key and that generates a secret
key, after which they have the same secret key to encrypt.
Components of Elliptic Curve Cryptography
1. ECC keys:
•Private key: ECC cryptography’s private key creation is as
simple as safely producing a random integer in a specific
range, making it highly quick.
•Any integer in the field represents a valid ECC private key.
•Public keys: Public keys within ECC are EC points, which
are pairs of integer coordinates x, and y that lie on a curve.
Generator Point
•ECC cryptosystems establish a special pre-defined EC point called
generator point G (base point) for elliptic curves over finite fields,
which can generate any other position in its subgroup over the
elliptic curve by multiplying G from some integer in the range [0…r].
•The number r is referred to as the “ordering” of the cyclic
subgroup.
•Elliptic curve subgroups typically contain numerous generator
points, but cryptologists carefully select one of them to generate the
entire group (or subgroup), and is excellent for performance
optimizations in calculations.
•This is the “G” generator.
Global Public Elements