Simple Encryption

Alrighty!!

So I have an assignment ( it is supposed to be a simple one ....yeah right)
the point of the assignment is to implement a one time pad. We finished covering pointers and I/o files so I know that I should be doing something with this. The problem I encounter when trying to start the assignment is this:

The following show the encryption results.

 Plain Text : Whats up?

 Key : Man it is cold outside

 Encrypted Text: LRSY  IJ // it also contains some undefined symbols

So why are there three lines? I thought that if I was to encrypt something that I would have the original plain text and then the symbols . I dont understand why i have the middle line?
the key is the encryption key which determines your algorithm for your encryption...

i believe
The middle line is your key. You use the key to convert the plain text to the encrypted text, and also to convert the encrypted text to plain text.
ignore this comment :p
Last edited on
So the middle line is my key, what is the point of the plain text?
You encrypt the plain text using the key which gives you the encrypted text.
Your encyption function looks something like:

encrypted encrypt(key,plain)
{
encrypted = key+plain
return encrypted
}
Thanks blacksheep!

We were given :

offset = (KeyLetter - 'A') + 1
encryptedLetter = 'A' + (original distance from 'A' + offset) % 26
encryptedLetter = 'A' + (plainTextLetter - 'A' + offset) % 26

is this supposed to be the equation that the encrypted words turn into?
Topic archived. No new replies allowed.