Bjornir90

Encryption.lua

Nov 14th, 2012
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.37 KB | None | 0 0
  1. function encrypt(toEncrypt, key)
  2.  local intEncrypt = string.byte(toEncrypt)
  3.  math.randomseed(key)
  4.  local encrypted = math.floor(intEncrypt+math.random())
  5. return encrypted
  6. end
  7.  
  8. function decrypt(toDecrypt, key)
  9.  math.randomseed(key)
  10.  local decrypted = math.floor(toDecrypt-math.random())
  11.  local decryptedS = string.char(decrypted)
  12. return decryptedS
  13. end
Advertisement
Add Comment
Please, Sign In to add comment