Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 13

CRYPTOGRAPHY

(ONE TIME PAD CIPHER)

PRESENTED BY KUDAKWSHE CHUMA


R1910291 (HETTW)
ONE TIME PAD SYMETRIC CIPHER
ONE TIME PAD CIPHER

An Army Signal Corp officer, Joseph Mauborgne 1919, proposed an improvement to


the Vernam cipher a substitution technique which uses repeating key. Mauborgne
suggested using a random key that is as long as the message, so that the key need not
be repeated.
ONE TIME PAD CIPHER

The key used for a one-time pad cipher is called pad, as it is printed on pads of paper.
 Random key that is as long as the message.
 No repeating of key, once used it is discarded.
 Key is to be used to encrypt and decrypt a single message and then discarded.
 Each key should be used once and destroyed by both sender and receiver.
 New message new key required.
 The key is truly random and specially auto-generated.
 Key is a string un alike in Ceaser cipher where it is a integer.
ONE TIME PAD CIPHER

 There should be two copies of key: one with the sender and other with the receiver.
 The security of the one-time pad is entirely due to the randomness of the key. If the stream of
characters that constitute the key is truly random, then the stream of characters that constitute
the ciphertext will be truly random. Thus, there are no patterns or regularities that a cryptanalyst
can use to attack the ciphertext.

 ciphertext: ANKYODKYUREPFJBYOJDSPLREYIUNOFDOIUERFPLUYTS
 key: pftgpmiydgaxgoufhklllmhsqdqogtewbqfgyovuhwt
 plaintext: miss scarlet with the knife in the library
ONE TIME PAD CIPHER DIFFICULTIES

 Practical problem of making large quantites of keys, heavy computing.


 Key distribution and protection is a daunting task
 Perfect secrecy against other only in one time pad .it is the notion that given an encrypted message
(ciphertext) from a perfectly secure encryption system (cipher) absolutely nothing will be revealed
about the unencrypted message (plaintext) by the cypher text.
ONE TIME PAD CIPHER ENCRYPTION

 To encrypt a letter, a user needs to write a key underneath the plaintext. The plaintext letter is
placed on the top and the key letter on the left. The cross section achieved between two letters is
the plain text. It is described in the example below −
ONE TIME PAD CIPHER DECRYPTION

 To decrypt a letter, user takes the key letter on the left and finds cipher text letter in that row.
The plain text letter is placed at the top of the column where the user can find the cipher text
letter.
ONE TIME PAD CIPHER METHOD
ONE TIME PAD CIPHER IMPLEMENTATION

Python includes a hacky implementation module for one-time-pad cipher implementation. The package name is
called One-Time-Pad which includes a command line encryption tool that uses encryption mechanism similar to
the one-time pad cipher algorithm.
Installation
You can use the following command to install this module −
pip install onetimepad
If you wish to use it from the command-line, run the following command −
ONE TIME PAD CIPHER IMPLEMENTATION
Code
The following code helps to generate a one-time pad cipher −
import onetime pad

cipher = onetimepad.encrypt('One Time Cipher', 'random')


print("Cipher text is ")
print(cipher)
print("Plain text is ")
msg = onetimepad.decrypt(cipher, 'random')

print(msg)
Output
You can observe the following output when you run the code given above −
ONE TIME PAD CIPHER IMPLEMENTATION

Note − The encrypted message is very easy to crack if the length of the key is less than the length
of message (plain text).
In any case, the key is not necessarily random, which makes one-time pad cipher as a worth tool.
ONE TIME PAD CIPHER


THANK YOU

You might also like