源码来自 https://github.com/xxtea/xxtea-lua ,根据个人喜好做了一点修改
- make
- copy the created xxtea.so to anywhere your lua code can load it.
- in lua code:
local xxtea = require "xxtea.c"
local encrypted = xxtea.encrypt(data-to-be-encrypted, key)
local decrypted = xxtea.decrypt(data-to-be-decrypted, key)