I have a cipher I made that I think is pretty good considering my limited knowledge on cryptology, but right now I can only use it to encrypt stuff by hand. I was just wondering what types of coding I will need to learn to make this, keeping in mind that this is just for fun, not for serious encryption....
An example of how the cipher works is this: If "a" is in 1st, 4th, or 7th position, a=11, if "a" is in the 2nd, 5th, or 8th position, a=34, and it goes like that until it gets to the 9th position, then starts over at 1. I hope that makes sense.... Also, I treat the spaces between words as a character, making it harder to decrypt, hopefully......
Edit: Maybe this example will explain it better:
Let's take these words: "Aardvark poop". This is what they look like when encrypted with my "Rotary code" cipher: "112814217016355866331825". Since I used random two digits when I created my cipher, the enciphered text looks like nonsense, but let me break it down. Since the first "A" in "aardvark" is in the first position, it becomes "11", and since the second "a" is in second position, it becomes "28", and so on. This continues until you reach the character in the 9th position, which happens to be a space, which becomes "66". Then it starts over, with the first "p" in "poop" being in the first position, it becomes "33". The "OO" is treated as one character to make it harder to decipher, and since it's in the second position, it becomes "18".
Hopefully that explains how my cipher works without adding too much confusion, and I ask again: What kind of coding will I need to learn to make this simple cipher into a usable program?
you'll probably make heavy use of charAt
Another way to do this is with arrays, each character being an element.
What rule are you following to get the numbers 11 for 1st 4th and 7th and 34 for 2nd 5th and 8th?
Thanks, I'll check that out. The numbers I used to replace each character are random ones I selected, so it's not really following a rule.
I suggest you learn Python, because of how simple it is to write and read. Plus, it's a fantastic starter language- I assume you'll want to move on to something more advanced eventually, yes? However, just about any (decent) programming language ill do you fine.
Perl is fun for simple ciphers because it has them powerful regular expressions. Python also has these, but they are mostly borrowed from Perl's. :P
I really do suggest you use Python.
Perl can be made unreadable, especially when trying to make a program as short as possible. Example: The RSA algorithm in 3 lines of Perl. This piece of code was infamous in the nineties, because at the time it was illegal to export strong encryption algorithms, and someone decided to put it on a t-shirt to make a statement. Some people actually have tattoos. Here it is (Warning: Line noise!):
For a complex algorithm like RSA, 3 lines is really an accomplishment.
Since you're interested in cryptography, you should take a look at Vernam ciphers and the One-Time Pad if you haven't already. The latter is theoretically unbreakable mathematically, and also in practice so long as both copies of the pad are kept secure and no portion of the pad is ever reused for encryption.
Holy fuck, 3 lines. I could never do that!
Meh that would take the fun out of making it myself, I want to figure it out on my own, I just needed a push in the right direction.
Edit: I'm still not sure what he means, but maybe this will work:
If "a" is in 1st, 4th, or 7th position, "a"=11. If "a" is in 2nd, 5th, or 8th position, "a"=28. If "a" is in 3rd, 6th, or 9th position, "a"=16. If "b" is in 1st, 4th, or 7th position, "b"=26. If "b" is in 2nd, 5th, or 8th position, "b"=35. If "b" is in 3rd, 6th, or 9th position, "b"=38. If "c" is in 1st, 4th, or 7th position, "c"=32. If "c" is in 2nd, 5th, or 8th position, "c"=81. If "c" is in 3rd, 6th, or 9th position, "c"=58.
So using that, if we take "abccba", it becomes "113558323516".
Hopefully that makes sense....