Advertisement
gpgautier

CC Simple Encryption

Dec 8th, 2012
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.41 KB | None | 0 0
  1. -- Encrypt a value
  2. function encrypt(value)
  3.   local x, encrypted
  4.  
  5.   encrypted = ""
  6.   for x = 1, #value do
  7.     encrypted = encrypted .. string.char(value:byte(x) + 1)
  8.   end
  9.  
  10.   return encrypted
  11. end
  12.  
  13. -- Decrypt a value
  14. function decrypt(value)
  15.   local x, decrypted
  16.  
  17.   decrypted = ""
  18.   for x = 1, #value do
  19.     decrypted = decrypted .. string.char(value:byte(x) - 1)
  20.   end
  21.  
  22.   return decrypted
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement