2

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?

Richard JP Le Guen
  • 28,364
  • 7
  • 89
  • 119
Zmoneaux
  • 21
  • 2

2 Answers2

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
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