[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: lxyssl, aes and rsa questions
- From: Valerio Schiavoni <valerio.schiavoni@...>
- Date: Thu, 3 Jun 2010 11:25:23 +0200
thanks for the info.
Indeed i was able to use that variant to encrypt blocks of anysize. Now, there's something very strange happening, regarding key length.
I have this code right now which works fine when the keylength is exactly 16 chars (i guess it's for aes128):
Now, if I change to any other value the keylenght (line 35), I get this error:
xyssl.aes: key not long enough for selected bits length
How do you get around this?
On Thu, May 27, 2010 at 4:19 PM, gary ng <email@example.com>
|I haven't used it for a while but the raw encryption does need 16 bytes block. A better choice for aes is the cbc and cfb variant which is also more secure.|
--- On Thu, 5/27/10, Valerio Schiavoni <firstname.lastname@example.org> wrote:
From: Valerio Schiavoni <email@example.com>
Subject: lxyssl, aes and rsa questions
To: "Lua list" <firstname.lastname@example.org>
Date: Thursday, May 27, 2010, 5:20 PM
i'm using the Lua bindings for the xyssl (polarssl) for aes and rsa.
i'm getting this error:
xyssl.aes: data must be in 16 byte multiple
local aes_key = 'abcdabcdabcdabcd"
local aes_crypted_vote = lxyssl.aes(aes_key):encrypt(vote)
i don't understand why. Ideas? Is the library supposed to work for any input data? Should I handle padding myself?
the code snippet shows some RSA related code:
I don't get how this is meant to be used with private/public key pairs generated locally, by openssl.
Currently I've implemented by own RSA code, handling the parsing of keys, exponents, padding and etc. But, I'd more than happy to re-use something that is probably less error-prone.
Thanks for any suggestion.