Skip to content

radare/crypto

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crypto API for luvit

This module provides a wrapper library for openssl. Digest, cryptography and other goods are

TODO

Need more examples Simplify build Create package

Example

#!/usr/bin/env luvit
local FS = require("fs")
local Crypto = require ("crypto")

-- check module --
assert (not _G.openssl)
assert (Crypto.get_cipher)

-- asynchrounous md5 from file --
local md5 = Crypto.get_digest ("md5"):init ()
local stream = FS.create_read_stream ("/bin/ls")
stream:on ("data", function (data) md5:update (data) end)
stream:on ("end", function () print("</bin/ls", Crypto.to_hex(md5:final ())) end)

-- from string --
local md5 = Crypto.get_digest ("md5"):init ()
md5:update ("hello world")
print ("hello world", Crypto.to_hex (md5:final ()))

About

OpenSSL binding for Luvit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%