Another really simple encryption scheme is basic single-bit encryption which is also sucky (in that it's really easy to crack) but good for learning purposes. All you need is a key, and then you xor the bits in your string directly with those of the key. The same operation will unencrypt the string. Since you were so kind as to paste your code, I hacked together a simple example of it: [Java] Single-bit encryption demo - Pastebin.com
Code:
java LameSinglebitEncryption Encrypt lucid dreamviews
Encrypting [dreamviews] using key [lucid]
8-7-6-8-9-26-28-6-30-23
java LameSinglebitEncryption Decrypt lucid 8-7-6-8-9-26-28-6-30-23
Decrypting [8-7-6-8-9-26-28-6-30-23] using key [lucid]
dreamviews
Amusingly, because the "c" from lucid lands on the "e" from dreamviews both times, you get the same thing (where both e's map to 6). However, that changes if I change the length of my key a bit:
Code:
java LameSinglebitEncryption Encrypt lucid2 dreamviews
Encrypting [dreamviews] using key [lucid2]
8-7-6-8-9-68-5-16-20-26
java LameSinglebitEncryption Decrypt lucid2 8-7-6-8-9-68-5-16-20-26
Decrypting [8-7-6-8-9-68-5-16-20-26] using key [lucid2]
dreamviews
This second time around, there's still a repetition (the two 8s), but they don't correspond to the same letter, so whatever. Then you can go nuts.
Code:
Encrypting [farnsworth_fry_leela_bender_zoidberg_amy_scruffy] using key [futurama_rocks_my_sox]
0-20-6-27-1-22-2-19-43-26-48-5-25-10-0-1-28-58-31-14-39-4-16-26-17-23-19-50-27-48-27-11-1-14-1-56-50-24-50-10-48-11-5-7-1-19-20-24
Decrypting [0-20-6-27-1-22-2-19-43-26-48-5-25-10-0-1-28-58-31-14-39-4-16-26-17-23-19-50-27-48-27-11-1-14-1-56-50-24-50-10-48-11-5-7-1-19-20-24] using key [futurama_rocks_my_sox]
farnsworth_fry_leela_bender_zoidberg_amy_scruffy
Also, notice that a key consisting of a single letter (or a string of just the same character over and over) basically degenerates into a basic substitution cipher:
Code:
java LameSinglebitEncryption Encrypt QQ jeepers_creepers
Encrypting [jeepers_creepers] using key [QQ]
59-52-52-33-52-35-34-14-50-35-52-52-33-52-35-34
Look at all those 52s 
Back in 1999, I read somewhere that AIM (you know, AOL's shitty IM) was using this kind of method to store their passwords. Weak, weak, weak... I bet it's still in use all over the place. Right after finding that out, I looked at some encrypted string in a website cookie from a site that was using a popular chat client (I think it was called iChat, and no it's not an apple product), and wondered if they were using that. Sure enough, I created a LONG username, xored it to the cookie string, and then I tried out that key against my regular-length-username cookie string, and there it was. "<username>::<password>::<some_other_crap>" or something like that. So whenever people were having tech troubles with their computers on there, I'd tell them to send me that string (cause... well... "it gives me info about what version of windows you're running" or something), and then I eventually had a huge amount of passwords. It was a dick thing to do (and I never used the passwords for anything), but it was fun and educational. Especially the social engineering. So easy haha.
have fun!
Bookmarks