SHA256 hashing algorithm in pure Lua.
- Inspired from lua-users: Secure Hash Algorithm.
- Lua version: 5.4.x
local SHA256 = require("sha256")
::start::
io.write("Enter your message: ")
local msg = io.read("*l")
print(SHA256(msg))
goto start -- Prompt again unless keyboard-interrupted
Note
Lua is not intended for cryptographic operations. If you want better performance, use LuaJIT or add your own C bindings.