Simple Encryption

Apr 3, 2012 at 9:02pm
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?
Apr 3, 2012 at 9:07pm
the key is the encryption key which determines your algorithm for your encryption...

i believe
Apr 3, 2012 at 9:08pm
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.
Apr 3, 2012 at 9:23pm
ignore this comment :p
Last edited on Apr 3, 2012 at 10:16pm
Apr 3, 2012 at 10:15pm
So the middle line is my key, what is the point of the plain text?
Apr 3, 2012 at 11:39pm
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
}
Apr 4, 2012 at 12:41am
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.