Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

The 20 Line Challenge / Encryption Program

Author
Message
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 16th Feb 2008 10:26 Edited at: 18th Feb 2008 06:04
Got bored so I made an encryption program, then cut it down to 20 lines.

Here is how it works:
1. Enter a word or phrase (only letters)
2. Enter another word or phrase for the cipher text (doesn't matter the length)
3. It then prints the encrypted text on the screen

The paper way is simply adding the values of the letters. A is 1, B=2, C=3 and so on. The cipher is repeated until there are enough cipher characters for every character in the first message. It then adds the corresponding values (First letters with first letters etc). The resulting numbers are then simplified (if they are over 26 they are subtracted from) and then converted back to letters.




This should work in both dbp and dbc. It was written in dbc though, so it definitely works in that.
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 17th Feb 2008 07:31 Edited at: 18th Feb 2008 06:38
Upon some testing for an addition I found a couple bugs, mostly relating to some weird math. anyway, here is an upgraded and fixed version. Let me know if you find any problems! This one also includes a decryption option!



Note that in this version, spaces are shown with a _. Do not type the _ character into the decryptor and expect it to be treated as a space. It is only there so that should there be a space at the beginning or end, you can see that it is there.

Login to post a reply

Server time is: 2024-03-28 21:18:33
Your offset time is: 2024-03-28 21:18:33