Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

OpenSSL::Cipher#update

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.

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