Are there any implementations of these hashing algorithms in pure lua? I've found a couple for MD5 and SHA1 but none for these two which are the ones I'll be needing for a project. In the interests of portability, I need something in pure lua. Anyone know of anything?
Asked
Active
Viewed 1,125 times
2 Answers
0
Lua's lmd5 library states: A message digest library for Lua based on OpenSSL. It supports MD2, MD4, MD5, SHA1, SHA2, RIPEMD160, MDC2. Though I have never used it. But there are some libraries listed here. You might one of them useful.
Here's another library which might be what you seek.

hjpotter92
- 78,589
- 36
- 144
- 183
-
3If its "based on OpenSSL", then its not in pure lua. (Unless based on means inspired by, or in the style of) – Michael Anderson Jun 23 '12 at 08:29
-
2@MichaelAnderson I think [this one](http://lua-users.org/wiki/SecureHashAlgorithm)'s is pure lua implementation – hjpotter92 Jun 23 '12 at 08:33
0
If you use LuaJIT I have written an implementation of SHA256 here but it uses FFI ctypes: https://github.com/catwell/cw-lua/tree/master/sha256
Otherwise there's one here in pure Lua 5.2 which I have not tested: http://lua-users.org/wiki/SecureHashAlgorithm (already cited by Dream Eater).

catwell
- 6,770
- 1
- 23
- 21