evo-lua / evo-luvi

[Obsolete] Experimental Lua runtime environment built on Luvi (libuv + LuaJIT)
https://evo-lua.github.io
Apache License 2.0
1 stars 0 forks source link

Add ``argon2`` primitive (for password hashing and verification) (?) #17

Open rdw-software opened 3 years ago

rdw-software commented 3 years ago

There's FFI bindings for it here: https://github.com/thibaultCha/lua-argon2-ffi C source (reference code) here: https://github.com/P-H-C/phc-winner-argon2 RFC: https://www.rfc-editor.org/rfc/rfc9106.txt

I've built this before on Windows, so hopefully the results of that experiment will be useful. They're still somewhere in a private repo, and include a GitHub Actions workflow to build it.

Should probably be exposed in a crypto library later, but I don't dare venturing there just yet.

Other Considerations:

rdw-software commented 3 years ago

The license is Apache2, so that's not a problem. However, it looks like parallel computation is effectively required (else using it would be useless):

For efficient computation of Argon2, the ability to run concurrent code is necessary

That might turn out to be a bit more complex than I'd like, but we'll see.

rdw-software commented 3 years ago

Some other ideas:

Also TBD: Will LuaJIT optimize even ffi'ed code? If yes, would this introduce possible attack vectors, e.g. for side channel attacks?

There's probably no point in adding anything if OpenSSL should be used, except maybe some version of node's crypto library on top.

rdw-software commented 3 years ago

This has too many potential issues; needs more thought to figure out the details.