In your project you will simulate a technique called One-time Pad. From Wikipedi
ID: 3750791 • Letter: I
Question
In your project you will simulate a technique called One-time Pad. From Wikipedia: “In cryptography, the one-time pad (OTP) is an encryption technique that cannot be cracked if used correctly. In this technique, a plaintext is paired with a random secret key (also referred to as a one-time pad). Then, each bit or character of the plaintext is encrypted by combining it with the corresponding bit or character from the pad using modular addition. If the key is truly random, is at least as long as the plaintext, is never reused in whole or in part, and is kept completely secret, then the resulting cyphertext will be impossible to decrypt or break.” Since it is not practical to use true one-time pads we will simulate them using a random number generator. Note that this technique is not necessarily very secure, but it will serve to illustrate the approach. In our case we are interested in characters ‘ ’, ‘ ’ (numerical codes 9 and 10) and Space through ‘˜’ (numerical codes 32 through 126). Therefore, there are 97 displayable characters (if we count white space characters as displayable). If you use 0 to represent ‘ ’, 1 to re
Explanation / Answer
In cryptography, a one-time cushion is a framework in which a private key created haphazardly is utilized just once to scramble a message that is then unscrambled by the recipient utilizing a coordinating one-time cushion and key. Messages scrambled with keys in light of haphazardness have the preferred standpoint that there is hypothetically no real way to "break the code" by dissecting a progression of messages. Every encryption is exceptional and bears no connection to the following encryption so some example can be recognized. With a one-time cushion, nonetheless, the unscrambling party must approach a similar key used to encode the message and this raises the issue of how to get the way to the decoding party securely or how to keep both keys secure. One-time cushions have now and then been utilized when the two gatherings began at the same physical area and afterward isolated, each with learning of the keys in the one-time cushion. The key utilized in a one-time cushion is known as a mystery key on the grounds that on the off chance that it is uncovered, the messages encoded with it can without much of a stretch be deciphered. One-time cushions figured noticeably in mystery message transmission and secret activities previously and amid World War II and exposed War period. On the Internet, the trouble of safely controlling mystery keys prompted the creation of open key cryptography.
How It Works
Normally, a one-time cushion is made by producing a series of characters or numbers that will be at any rate as long as the longest message that might be sent. This series of qualities is produced in some arbitrary design - for instance, by somebody hauling numbered balls out of a lottery machine or by utilizing a PC program with an irregular number generator. The qualities are composed down on a cushion (or any gadget that somebody can read or utilize). The cushions are given to any individual who might probably send or get a message. Commonly, a cushion might be issued as an accumulation of keys, one for every day in multi month, for instance, with one key terminating toward the finish of every day or when it has been utilized once.
At the point when a message is to be sent, the sender utilizes the mystery key to encode each character, each one in turn. On the off chance that a PC is utilized, each piece in the character (which is generally eight bits long) is solely "OR'ed" with the comparing bit in the mystery key. (With a one-time cushion, the encryption calculation is essentially the XOR task. Where there is some worry about how really arbitrary the key is, it is some of the time joined with another calculation, for example, MD5.) One author depicts this sort of encryption as a "100% clamor source" used to cover the message. Just the sender and collector have the way to expel the commotion. Once the one-time cushion is utilized, it can't be reused. On the off chance that it is reused, somebody who captures numerous messages can start to think about them for comparable coding for words that may conceivably happen in the two messages.