0 Members and 1 Guest are viewing this topic.
A simple example program that converts text to ciphertext and back again. Because it uses the rand seed, it's super-secure: unless someone knows it was coded on a calc, they're not getting it decoded.Supports A-Z and spaces. Key can be any number.Optimizations welcome.
:" →Str2:" →Str1:Repeat length(Str2)=7:Repeat Ans>40 and Ans<94 or Ans=102:getKey→K:End:If Ans≠44 and Ans≠45 and Ans<94:Then:Ans-20-5int(.1Ans:Str2+sub("ABC DEFGHIJKLMNOPQRSTUVWXYZ",Ans,1→Str2:Text(26,2,sub(Str2,2,length(Str2)-1:End:If K=45 and length(Str2)>1:Then:sub(Str2,1,length(Str2)-1→Str2:Text(26,1," ":Text(26,1,Str2:End:If K=102:Then:Str2+" →Str2:Text(26,1,Str2:End:End:sub(Str2,2,length(Str2)-1→Str2:Text(26,2,Str2:"TEYGJKMNOQRAUBCIVWDLEFHSZ "→Str3:For(A,1,6:Str1+sub(Str2,7-A,1)→Str1:End:sub(Str1,2,6→Str2:For(A,1,6:inString(Str3,sub(Str2,A,1→B:length(Str3)→D:(C-B)/(B+C)+B*C→C:End