Skip to content
instance method

OpenSSL::Cipher#update

(::String data, ?::String buffer) -> ::String
cipher.update(data [, buffer]) → string or buffer

Encrypts data in a streaming fashion. Hand consecutive blocks of data to the update method in order to encrypt it. Returns the encrypted data chunk. When done, the output of Cipher#final should be additionally added to the result.

If buffer is given, the encryption/decryption result will be written to it. buffer will be resized automatically.

NOTE: When decrypting using an AEAD cipher, the integrity of the output is not verified until final has been called.

See also #reset #random_key also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0