somesocks / lua-lockbox

A collection of cryptographic primitives written in pure Lua
MIT License
357 stars 73 forks source link

RSA public key cryptography #12

Open Ranguna opened 8 years ago

Ranguna commented 8 years ago

I'd like to request the option to use RSA public key scheme which would be compatible with python cryptography library. I'm currently developing an app in which the client needs to be programmed in Lua and the server in python, the server is using the cryptography lib and the client needs to safely communicate with the server through RSA scheme.

somesocks commented 8 years ago

RSA is definitely on the wish list, but I'm afraid I'm out of free time for a while. I'll update when I've had a chance to look into it.

Ranguna commented 8 years ago

I'll right, awesome ! I love this library and I hope you keep working on it, you have my full support :+1:

atticus-sullivan commented 2 years ago

Thought about starting to implement RSA today. I think the biggest problem with this is that RSA converts the plaintext to an integer and we'll need bigInts (range of lua's number most probably won't suffice) for that. Not quite sure if implementing bigInts in this lib or using a lua bigInt lib (creating a dependency) is a better choice.

In addition RSA isn't a block chiffre and thus doesn't fit that well into this whole cbc/ctr/... mode framework I think.

Apart from these two issues (and the question whether key generation is in scope of this lib as it is somewhat more special as in the symmetric cases) implementing RSA shouldn't be too hard.