Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function encrypt(txt, key)
- enc = ""
- len = string.len(txt, key)
- for i = 1,len do
- char = string.sub(txt, i, i)
- byte = string.byte(char)
- byte2 = byte+key
- char2 = string.char(byte2)
- enc = enc..char2
- end
- end
- function decrypt(txt, key)
- dec = ""
- len = string.len(txt)
- for i = 1,len do
- char = string.sub(txt, i, i)
- byte = string.byte(char)
- byte2 = byte-key
- char2 = string.char(byte2)
- dec = dec..char2
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment