lua-users home
lua-l archive

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


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.

From: Valerio Schiavoni <valerio.schiavoni@gmail.com>
To: Lua list <lua@bazar2.conectiva.com.br>
Sent: Mon, June 7, 2010 8:49:19 AM
Subject: lxyssl (AES binding), CFB en

Hello,
i've yet another problem with lxyssl. It simply doesn't seem to work:

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

the main problem is: 'e' is empty..

Looking at the implementation of cfb_encrypt, it seems to me that the result is correctly pushed back into the stack..why can't I print it?

Any idea?

(for your curiosity, C implementation is here: http://code.google.com/p/luaxyssl/source/browse/tags/0.2/lxyssl.c#934 )

Thanks,
Valerio