Hi guys,
I've always been interested in cryptography, the act of coding something into either meaningless or much less revealing phrases or characters to hide the real message. I've decided I'm going to make a few cryptography programs for my calculator but they're proving much more difficult than I expected.
First I chose to do something simple: Input a string and return a string. You input letters or a word and it returns the alphabetical number that corresponds to the letter: A is 1, E is 5, Z is 26, etc. I figured this would be basic enough for a start.
My concept is that you input the string. The code checks the length of the string and starts a For loop: With 1 as the start and the length of the string that was inputted as the end, it stores the value in for A. Then, it runs through the original string with sub( commands to pick each letter out, storing each one as String 0.
This is where I'm stuck. Let's say I have the string "EXAMPLE" as the original string. I can pick the word apart so I have "E" as Str0, then "X" as Str0, and so on to the last "E." But I don't know how to correspond that to the number. Here's my code, maybe that will help!
Program:CRYPT
:ClrHome
:"0102030405060708091011121314151617181920212223242526→Str1
:Input "Str: ",Str2
:length(Str2)→L
:For(A,1,L
:sub(Str2,A,1→Str0
:***Stuff that I'm missing***
:End
So that's as far as I got. I know I have to put something were I have the comment. I don't know what to do… I remember I had it a few days ago but I foolishly deleted it and now I don't remember how I did it.
Any help is appreciated! Thanks!
-Likeawhisper
The man shuddered as the shadow drew a glistening sword from his back. Creeping closer and closer with his pale eyes burning into the man, the shadow slowly raised his blade and before he could thrust it down, the man heard the shadow hiss something.
"The Shadow Clan's presence must be like a whisper. Always felt, but never seen…"