Advertisement
Guest User

anoncipher

a guest
Aug 1st, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. s="MY super SECRET messAGE"
  2. shift = -10     --choose any number between [-32,128]for shift.
  3. length = string.len(s)  --gets string length (#of characters)
  4. for i=1, length, 1 do   --Runs the code between do and end
  5.     c=string.sub(s,i,i) --length #of times. length = #of char
  6.             --string.sub() gets a substring
  7.             --from index i, to index i.
  8.     s=string.sub(s,1,i-1)..string.char(string.byte(c)+shift))..string.sub(s,i+1,string.len(s))
  9.             --string.gsub() substitutes any
  10.             --character in s matching c with
  11.             --string.char(…)
  12.     print(s)        --prints the new string s
  13. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement