lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,
just to be clear: are you saying that one of the 2 code snippets I've posted is working on your machine? 

Or, you're saying that you have some other variant of this same functionality that is working fine for you? If so, I'd be very curious to see it. 

require"security"
data="">
k = security.hash.engine('md5'):digest('abcd')
aes_cfb = security.crypto.engine('aes_cfb', k, k)
e=aes_cfb:encrypt(data.."a")
d=aes_cfb:decrypt(e)
assert(d==data.."a")

function ex2()
key='abcdabcdabcdabcd'
data="">
iv=lxyssl.hash('md5'):digest(key)
e=lxyssl.aes(key):cfb_encrypt(data .. "a",iv)
d=lxyssl.aes(key):cfb_decrypt(e,iv)
assert(d==data .."a")
end