lua-users home
lua-l archive

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


no idea then. seems to be working fine for me here.

From: Valerio Schiavoni <valerio.schiavoni@gmail.com>
To: Lua list <lua@bazar2.conectiva.com.br>
Sent: Mon, June 7, 2010 1:59:29 PM
Subject: Re: lxyssl (AES binding), CFB en

Hello Gary, 

i've tried with the security.lua wrapper, same result:

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")

The result aes_cfb:encrypt is again an empty string.

On Mon, Jun 7, 2010 at 8:30 PM, gary ng <garyng2000@yahoo.com> wrote:
there is a simple wrapper security.lua in the distribution. you may cross check with that. I believe I have test cases against them and were ok at the time of writing.

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