Skip to content

szeist/lua-easy-crypto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lua-easy-crypto

Simple interface for password based AES-256 encryption and decryption using the lua-resty-nettle library.

Usage

local EasyCrypto = require "resty.easy-crypto"

local ecrypto = EasyCrypto:new({ -- Initialize with default values
  saltSize = 12,
  ivSize = 16, -- for CTR mode
  iterationCount = 10000
})

-- local ecrypto = EasyCrypto:new() -- Same as above

local encrypted = ecrypto:encrypt("password", "plain text")
local decrypted = ecrypto:decrypt("password", encrypted)

assert(encrypted == decrypted)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published