So im trying to make an encrypt/decrypt program from text to ASCII and vice versa. The text to ASCII works fine but the ASCII to text wont work any ideas?
var phrase, choice, store : string
store := ""
put "Do you want to encrypt or decrypt [e/d] "..
get choice
if choice = "e" or choice = "E" then
put "Enter a phrase: "..
get phrase
for i: 1.. length(phrase)
store += chr(ord(phrase(i)) mod 26 + 97)
end for
put store
elsif choice = "d" or choice = "D" then
put "Enter a phrase: "..
get phrase
for i: 1.. length(phrase)
store += chr(ord(phrase(i)) )
end for
put store
end if
Comments
Post a Comment