The algorithm is set upon Cipher object construction, see Cipher.constructor().
Cipher.algorithm readonly property
The Cipher.algorithm property gets the current algorithm used for encryption/decryption.
Example
local crypto = require "crypto"
local console = require "console"
-- randomly generate a secret key (16 bytes long)
local key = crypto.generate(16)
-- create a cipher using AES128 algorithm and the generated key
local cipher = crypto.Cipher("aes128", key)
console.write("Encryption/Decryption algorithm : ")
-- prints the cipher algorithm
console.writecolor("lightgreen", cipher.algorithm, "\n")