Hi, awkaw. It’s undocumented, but it’s there. Here’s a snippet from a project that uses encryption to talk to web services - just add an iv parameter…
local key = "xxx" local \_cipher = ssl.get\_cipher('aes-256-cbc') function cipher.encrypt(data) -- generate random iv local iv = "" for i = 1, 16 do iv = iv .. string.char(math.random(0, 255)) end return mime.b64(iv .. \_cipher:encrypt(data, key, iv)) end
Hi, awkaw. It’s undocumented, but it’s there. Here’s a snippet from a project that uses encryption to talk to web services - just add an iv parameter…
local key = "xxx" local \_cipher = ssl.get\_cipher('aes-256-cbc') function cipher.encrypt(data) -- generate random iv local iv = "" for i = 1, 16 do iv = iv .. string.char(math.random(0, 255)) end return mime.b64(iv .. \_cipher:encrypt(data, key, iv)) end