Home »
Cryptography
One-Time Pad Cipher in Cryptography
Cryptography | One-Time Pad Cipher: In this tutorial, we will learn about the one-time pad cipher, we will first have a brief introduction regarding this technique and then will look into how the encryption and decryption are performed in it.
By Monika Sharma Last updated : May 25, 2023
What is One-Time Pad Cipher in Cryptography?
The One-time Pad cipher is almost similar to the Vernam cipher, this cipher technique also encrypts the plain text by working on the binary level of the text. The only difference between the two is that the length of the key in the Vernam Cipher must be less than or equal to the length of the plain text, whereas, in One-time pad Cipher, the length of the key must be equal to that of the Plain text. It cannot be less than that.
Now, talking about its characteristics and details, One-time pad cipher is a cipher in which we consider both the plain text and the key string in its binary form.
The following key points can be drawn for the One Time Pad cipher,
- The key chosen here is a string whose length must be equal to the length of the plain text.
- The key can be either in string form or directly in binary form also.
- It is a type of symmetric-key cryptography.
- It is a type of poly-alphabetic cipher, being a part of the substitution cipher.
One-Time Pad Cipher Encryption Process
One-Time Pad Cipher Decryption Process
The process of decrypting the ciphertext to convert it back into plain text is performed in the same way as the encryption process. Therefore, the formula for decryption of the text under Vernam cipher is as follows,
D (Ci , Ki) = Ci (XOR) Ki
One-Time Pad Cipher Example
Given Plain text: IF
Key: 1101011 0101111
Convert the given plain text into cipher text...
Solution
Note: You can cross-check your answer by applying the decryption process over the ciphertext, and if it comes back to be the same as the plain text, then it means that our answer is correct.