Advertisement
Guest User

Untitled

a guest
May 7th, 2015
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. -- 0123456789abcdefghijklmnopqrstuvwxyz
  2. local cipher = "1234567890qwertyuiopasdfghjklzxcvbnm"
  3.  
  4. local function encrypt(str)
  5. str = str:gsub("%d",function(a) a=a:byte()-47 return cipher:sub(a,a) end)
  6. str = str:gsub("%l",function(a) a=a:byte()-86 return cipher:sub(a,a) end)
  7. return str
  8. end
  9.  
  10. local function decrypt(str)
  11. str = str:gsub("%d",function(a) return string.char(cipher:find(a,nil,true)+47) end)
  12. str = str:gsub("%l",function(a) return string.char(cipher:find(a,nil,true)+86) end)
  13. return str
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement