Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. 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.2 · 3.1 · 3.0