Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

OpenSSL::Cipher#encrypt

() -> self
cipher.encrypt → self

Initializes the Cipher for encryption.

Make sure to call either encrypt or decrypt before using the Cipher for any operation or setting any parameters.

Internally calls EVP_CipherInit_ex(ctx, NULL, NULL, NULL, NULL, 1).

See also #decrypt #final #ccm_data_len= #iv= also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0