Well, regarding Lua 5.2 compatibility, I'm blocked by LuaSec. I could not found any version for 5.2. LuaSocket is almost there, and LuaCrypto... I found there is a pull request waiting to be merged, adding support for it.
If you are referring to my fork [1], the code from my master branch actually already supports Lua 5.2 (well, I managed to build it in Lua 5.2 and run the following simple test):
$ lua52/bin/lua
Lua 5.2.2 Copyright (C) 1994-2013 Lua.org, PUC-Rio
> crypto = require 'crypto'
> for _, digest in ipairs(crypto.list('digests')) do io.write(digest, ' ') end
DSA DSA-SHA DSA-SHA1 DSA-SHA1-old DSS1 MD4 MD5 RIPEMD160 ...
The pull request is just cosmetic changes, and I am thinking about closing it.