Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Assignment no 1 (Marks 5)

1) Explain One -time pad Encryption and decryption with the help of example (not mentioned in
the slides)
2) Explain the Rail Fence cipher Encryption and decryption with the help of example (Not
mentioned in slides)
One -time pad Encryption and decryption
What Is One-Time pad?

• In cryptography, the one-time pad is an encryption technique that cannot be cracked, but
requires the use of a one-time pre-shared key the same size as the message being sent.

• In this technique, a plaintext is paired with a random secret key (also referred to as a one-time
pad)

Encryption Formula:

• plaintext + key = cipher text 

Decryption Forumla:

• cipher text-key=plain-text

Some Rules for Encryption

• First We chose plain text which we want to convert into cipher text.

• We can chose random key.

• Key length is always equal to length of cipher text.

• After adding plain text and keys .If num is ≥26 then we subtract 26 from cipher text in
Encryption.

• Keys have two copies One for sender and one for receiver.

• Keys is discarded after one time use.


METHODOLOGY

• The flowchart of the proposed methodology is illustrated in Figure 1. In the stage of the
implementation part, the VB.Net programming language is used to create the system. Figure 2
shows the Vernam system. Therefore, the main steps of our methodology, Firstly, a random
encryption key is generated, to en-crypt the plain text with the Vernam algorithm, then the
key with the encrypted version is stored in one file. Secondly, the AES algorithm is utilized to
encrypt the password, which is considered the point of separation between the encrypted text
and the encryption key. The encryption phase includes two algorithms (Vernam and AES) and
using a simple steganography technique that hid the cryptographic key data. Thirdly, data
compression is implemented since the file size has doubled due to the encryption key mode
with encrypted data in the same file. Therefore, Huffman algorithm is used. The outlines of
the encryption phase and the decryption phase are shown in Algorithm 1 and Algorithm 2,
respectively.
Table Alphabet

ABCDE F GH I J K L M N O P Q R S T Y V W X Y Z
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Encryption Example
Decryption
Why OTP is secure?

• The security depends on the randomness of the key.

Drawback in OTP

• Key-stream should be as long as plain-text.

• Key distribution & Management difficult.

Solution

• Stream Ciphers in which key-stream is a solution

• Stream cipher generated in pseudo-random fashion from relatively short secret key.
Rail Fence cipher Encryption and decryption
Rail Fence Cipher

• In this method plain text is written downwards on “rails of fence “ , starting a new column
when bottom is reached.

Algorithm:

• First write down plain text message as a sequence of diagonals.

• Read the plain text written in first step as a sequence of rows.

Rail Fence Cipher

Example:

• Plain text: come home tomorrow

• Cipher text: cmhmtmrooeoeoorw

Example:
We encipher NOTHING IS AS IT SEEMS by first writing it on two lines in a zig-zag pattern (or rail fence).
The ciphertext is produced by transcribing the first row followed by the second row.

NTIGSSTEMOHNIAISES

Ciphertext: NTIGS STEMO HNIAI SES.

To decrypt, we write half the letters on one line, half on the second.

(Note that if there are an odd number of letters, we include the “middle” letter on the top line.)

Example:

Decipher MKHSE LWYAE ATSOL.

Solution:

Since there are 15 letters, we write 8 on the top line and 7 on the bottom line so that

MKHSELWYAEATSOL

Plaintext: MAKE HASTE SLOWLY.

You might also like