moteus / lua-bgcrypto-aes

Repository from Github https://github.commoteus/lua-bgcrypto-aesRepository from Github https://github.commoteus/lua-bgcrypto-aes

Build Status Build status Coverage Status

Binding to AES encrypt library.

This module has no external dependences. It works on Windows and *nix.

!For now this is development version so i can change public API.!

Usage:

local aes = require "bgcrypto.aes"

-- encrypt key (AES256)
local key = ("1"):rep(32)
-- output file
local out = io.open("test.aes", "wb+")
-- use AES ECB mode
local ecb_encrypt = aes.ecb_encrypt()
-- use callback with context to process encrypted data
ecb_encrypt:set_writer(out.write, out)

ecb_encrypt:open(key)

-- proceed input data stream
while true do 
  local chunk = get_next_chunk()
  if not chunk then break end
  ecb_encrypt:write(chunk)
end

Bitdeli Badge

About

License:BSD 2-Clause "Simplified" License


Languages

Language:C 66.0%Language:Lua 25.5%Language:Batchfile 6.2%Language:C++ 1.4%Language:Shell 0.9%