Skip to main content
Version: 3.14.x.x LTS

Cipher object methods

MethodDescriptionSample
encryptedBuf = crypto:update(data)For the streaming encryption, there is an update function that can be called many times. The cryptoBuf can be nil if using a block cipher and if there is not yet enough data to fill it up. The last call must be crpyto:doFinal(data), see later.data = encrypt:update("hello world")
encryptedBuf = crypto:doFinal(data)To encrypt a single string (not streaming) or terminate a sequence of update calls, use doFinal. doFinal can also be called without an argument.data = encrypt:doFinal("hello world")