Skip to content
instance method

OpenSSL::Cipher#random_key

() -> ::String
cipher.random_key → key

Generate a random key with OpenSSL::Random.random_bytes and sets it to the cipher, and returns it.

You must call encrypt or decrypt before calling this method.

See also #random_iv #reset #pkcs5_keyivgen #update also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0