One more question, though. Right now I have this line in scrypt.lua:local scrypt = ffi.load("/usr/local/openresty/lualib/scrypt.so")
Overall, I think that lua-resty-random could be merged into lua-resty-string, but I do have two questions first:For your bytes function, I noticed that it only uses OpenSSL's RAND_psuedo_bytes if native pseudo-random
sources are unable to be read. Is this due to a noticeable performance hit when using OpenSSL's method?
What is the purpose of the token function? It seems fairly context-specific, as it seems to generate a string of varying length with characters matching [0-9A-Za-z]. Perhaps making it accept character ranges would be more suitable for the purposes of others.
Actually I'm thinking about setting out a centralized package
management web site and related toolchain for 3rd-party libraries for
ngx_lua/openresty. Kinda like CPAN and LuaRocks. So that everyone can
publish their libraries and everyone can install the libraries with a
single command, like
$ lresty resty.scrypt
I hope you can create a test suite for your libraries based on my
Test::Nginx test scaffold. You can take a look at my existing
lua-resty-* libraries for examples, like lua-resty-redis.
> On Thu, Dec 19, 2013 at 5:12 AM, Aapo Talvensaari wrote:
> That's a really good idea. I'm all in. Kinda like a npm for node, except
t> hat resty is more like a web framework than a general purpose system.
I'll try to set up something here soon :)
On 20 Dec 2013 17:31, "Brian Akins" <br...@akins.org> wrote:
>
> The package management is one reason it's been so hard for me to get others at $DAYJOB to look at openresty. I'm not a big fan of luarocks. I really, really like npm, so something like that would be awesome - package.json in the app root, etc.
The advantage of luarocks is that it already exists and it should not require a lot of work to just tweak and set up a new repo... I would hope that there might be enough citation that per app packages might not be necessary.
> --
> You received this message because you are subscribed to the Google Groups "openresty-en" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to openresty-en...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
Hi Jeremy,
It is a small wrapper for scrypt c-lib, so I think it is ready for a production use (mainly for password hashing).
If you need more crypto functionality (say pbkdf2), I have also been creating LuaJIT bindings for Nettle:
https://github.com/bungle/lua-resty-nettle/tree/master/lib/resty/nettle
I will document and release the first version of it in following weeks. Almost all the bindings are done, but public key crypto is still work in progress (pubkey crypto adds dependency to gmp - others work without it).
Regards
Aapo
Hello
Is lua-resty-scrypt considered production ready?
--
You received this message because you are subscribed to a topic in the Google Groups "openresty-en" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openresty-en/7wrsSHiP72A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openresty-en...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I think this was interesting task to do, and I'm looking forward to make more libraries. Currently I'm thinking about implementing lua-resty-session (both stateless, and statefull), lua-resty-cookie (cookie helper lib), lua-resty-auth (usename/password, and maybe oauth, openid, facebook login etc. support), and some others (libxl, and maybe some pdf-lib too). But as this is rather new to me, I would like to get some feedback about those that I have already done.
Actually I'm thinking about setting out a centralized package
management web site and related toolchain for 3rd-party libraries for
ngx_lua/openresty. Kinda like CPAN and LuaRocks. So that everyone can
publish their libraries and everyone can install the libraries with a
single command, like
$ lresty resty.scrypt
$ lresty resty.scryptThat's a really good idea. I'm all in. Kinda like a npm for node, except that resty ismore like a web framework than a general purpose system. But yes, Ithink package management is a good idea since many packages will depend on ngx.*anyway, and they are not really usable elsewhere.
local scrypt = require"scrypt" local hash = scrypt.crypt("My Secret")
Or should I configure some parameters before using it?
Jérôme
Thanks a lot!Can I use it easily with the default parameters:local scrypt = require"scrypt" local hash = scrypt.crypt("My Secret")Or should I configure some parameters before using it?