Topics and Sub-Topics: Cryptography
Topics and Sub-Topics: Cryptography
Encryption is the process which take Decryption is the process which take
2.
place at sender’s end. place at receiver’s end.
Its major task is to convert the plain Its main task is to convert the cipher text
3.
text into cipher text. into plain text.
• Substitution Technique:
• Caesar Cipher
• Monoalphabetic Cipher
• Playfair Cipher
• Hill Cipher
• Polyalphabetic Cipher
• One-Time Pad
3.2.1 Caesar Cipher:
• On receiving the cipher text, the receiver who also knows the secret shift,
positions his sliding ruler underneath the cipher text alphabet and slides it to
RIGHT by the agreed shift number, 3 in this case.
• He then replaces the cipher text letter by the plaintext letter on the sliding ruler
underneath. Hence the cipher text “phhw ph wrpruurz” is decrypted to “meet me
tomorrow”.
• To decrypt
Ciphe A B C Da message
E F G Hencoded
I J Kwith
L aMShift
N ofO 3,P generate
Q R S the
T plain
U Vtext
W alphabet
X Y Z
r text
Plain
by using a shift of ‘-3’ as shown below:
X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
text
3.2.1 Caesar Cipher: Continue…..
En(x) = (x + n) mod 26
Dn(x) = (x - n) mod 26
• In Modified Caesar Cipher the original plain text alphabets may not necessarily be
three places down the line, but instead can be any places down the line.
Step 1: Write down all the characters of plain text message in a sequence of
diagnosis.
Step 2: Read the plain text written in step 1 as a sequence of rows.
Example: Suppose plain text corporate bridge, and we want to create the cipher text
of the given.
First, we arrange the plain text in a sequence of diagnosis, as shown below.
• Now read the plain text by row-wise, i.e. croaerdeoprtbig.
• So, here the plain text is a “corporate bridge” and cipher text is “croaerdeoprtbig”.
• The Rail-Fence technique is quite easy to break.
Example: Let’s assume that Plain text is a corporate bridge, and we need to calculate
the cipher text using a simple columnar transposition technique.
• Let’s take 6 columns and arrange the plain text in a row-wise manner.
c o r p o r
a t e b r i
d g e
• Decide the column order for reading the message – let’s assume 1,3,5,2,4,6 is an
order.
• Now read the message in a columnar manner using the decided order. –
cadreeorotgpbri, this is a cipher text.
3.3 Steganography:
• Steganography is the art and science of writing hidden message in such a way
that no one, apart from the sender and intended recipient, suspects the existence
of the message.
computer files (such as graphics, sound, text, html or even floppy disks) with bits
• This hidden information can be plain text, cipher text or even images.
• In modern 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
• Cover media is the file in which we will hide the hidden data, which may also be
encrypted using stego-key. Cover-media can be image or audio file.
b. Message - Real data that you can mask within pictures. The message may be in
the form of standard text or an image.
3.3.2 Different Types of Steganography Continue……..
• Step-01:
• Cryptography Techniques-
• Cryptography techniques may be classified as-
3.4.1 Symmetric Cryptography:
• In this technique, Both sender and receiver uses a common key to encrypt and
decrypt the message.
• This secret key is known only to the sender and to the receiver.
• It is also called as secret key cryptography.
3.4.1 Symmetric Cryptography: Continue………
• Working-
• The message exchange using symmetric key cryptography involves the following
steps-
• Before starting the communication, sender and receiver shares the secret key.
• This secret key is shared through some external means.
• At sender side, sender encrypts the message using his copy of the key.
• The cipher text is then sent to the receiver over the communication channel.
• At receiver side, receiver decrypts the cipher text using his copy of the key.
• After decryption, the message converts back into readable format.
• Disadvantages-
1. The number of keys required is very large.
2. Sharing the secret key between the sender and receiver is an important issue.
• While sharing the key, attackers might intrude.
4. Block cipher Uses confusion as well as While stream cipher uses only confusion.
diffusion.
In block cipher, reverse encrypted text is While in-stream cipher, reverse encrypted
5. hard. text is easy.
The algorithm modes which are used in The algorithm modes which are used in
6. block cipher are ECB (Electronic Code Book) stream cipher are CFB (Cipher Feedback) and
and CBC (Cipher Block Chaining). OFB (Output Feedback).
• We have mentioned that DES uses a 56-bit key. Actually, The initial key consists of
64 bits.
• However, before the DES process even starts, every 8th bit of the key is discarded
to produce a 56-bit key. That is bit positions 8, 16, 24, 32, 40, 48, 56, and 64 are
discarded.
3.4.2 DES Algorithm (Data Encryption Standard)
• DES is a block cipher and encrypts data in blocks of size of 64 bits each, which
means 64 bits of plain text go as the input to DES, which produces 64 bits of
cipher text. The same algorithm and key are used for encryption and decryption,
with minor differences. The key length is 56 bits.
• The basic idea is shown in the figure:Draw
• We have mentioned that DES uses a 56-bit key. Actually, The initial key consists of
64 bits.
• However, before the DES process even starts, every 8th bit of the key is discarded
to produce a 56-bit key. That is bit positions 8, 16, 24, 32, 40, 48, 56, and 64 are
discarded.
3.4.2 DES Algorithm (Data Encryption Standard)
• Thus, the discarding of every 8th bit of the key produces a 56-bit key from the original 64-bit
key.
DES is based on the two fundamental attributes of cryptography: substitution (also called
confusion) and transposition (also called diffusion).
• DES consists of 16 steps, each of which is called a round. Each round performs the steps of
substitution and transposition. Let us now discuss the broad-level steps in DES.
• In the first step, the 64-bit plain text block is handed over to an initial Permutation (IP) function.
• The initial permutation is performed on plain text.
• Next, the initial permutation (IP) produces two halves of the permuted block; saying Left Plain
Text (LPT) and Right Plain Text (RPT).
• Now each LPT and RPT go through 16 rounds of the encryption process.
• In the end, LPT and RPT are rejoined and a Final Permutation (FP) is performed on the combined
block
• The result of this process produces 64-bit ciphertext.
3.4.2 DES Algorithm (Data Encryption Standard)
3.4.2 DES Algorithm (Data Encryption Standard)
• Initial Permutation (IP):
• It happens only once. It replaces the first bit of the original plain text block with
the 58th bit of the original plain text block, the
• second bit with the 50th bit of original plain text block and so on. The
• resulting 64-bits permuted text block is divided into two half blocks. Each half
• block consists of 32 bits. The left block called as LPT and right block called as
RPT.16 rounds are performed on these two blocks. Details of one round in DES
3.4.2 DES Algorithm (Data Encryption Standard)
3.4.3 Asymmetric Cryptography:
• Asymmetric Cryptography is also known as public-key cryptography.
• It uses public and private keys to encrypt and decrypt data. One key in the pair which can be
shared with everyone is called the public key. The other key in the pair which is kept secret
and is only known by the owner is called the private key.
• Either of the keys can be used to encrypt a message; the opposite key from the one used to
encrypt the message is used for decryptio n.
1. A key generation algorithm that selects a private key uniformly at random from a
set of possible private keys. The algorithm outputs the private key and a corresponding
public key.
2. A signing algorithm that, given a message and a private key, produces a signature.
3. A signature verifying algorithm that, given a message, public key and a
signature, either accepts or rejects the message's claim to authenticity.
• A digital signature performs the same function as its physical counterpart, the sender
“marks” the message so that the recipients can verify that the message really came
from the sender.
• The steps followed in creating digital signature are :
1. The process of digitally signing a message starts with the creation of a unique
identify for the message. The unique identifier can be created using a mathematical
technique called Hashing.
3.4.3.1 Digital Signature Continue.......
2. A hash function uses a mathematical algorithm to convert the message into a
short fixed-length of bits, often referred to as a “hash value” or “message digest”
that uniquely represents the message used to create it.
3. The hash value is specific to the contents of the message. Thus any change to the
message contents will change the hash value that would be generated by the hash
function.
4. Next, the hash value is encrypted using the sender’s private key. Finally, the
message is sent along with the encrypted hash value.
5. On receiving the message and the encrypted hash value, the recipient can only
decrypt the hash value using the sender’s public key.
6. This confirms that the message came from the sender and no one else, as long as
the sender’s private key remains secure. The message can be rehashed and
compared with the decrypted hash value-if the values do not match, then the
message has been altered since it was not same.
3.4.3.2 Digital Certificate:
• Digital certificate is issued by a trusted third party which proves sender’s identity to the
receiver and receiver’s identity to the sender.
• A digital certificate is a certificate issued by a Certificate Authority (CA) to verify the
identity of the certificate holder.
• The CA issues an encrypted digital certificate containing the applicant’s public key and a
variety of other identification information.
• Digital certificate is used to attach public key with a particular individual or an entity.
• Digital certificate contains:- The authenticity
- Name of certificate holder.
- Serial number which is used to uniquely identify a certificate, the individual or the entity
identified by the certificate.
- Expiration dates.
- Copy of certificate holder’s public key.(used for decrypting messages and digital signatures)
- Digital Signature of the certificate issuing authority.
• Digital certificate is also sent with the digital signature and the message.