| Class | OpenSSL::Cipher |
| In: |
ext/openssl/ossl.c
|
| Parent: | Object |
let rdoc know about mOSSL
The string must contain a valid cipher name like “AES-128-CBC” or “3DES”.
A list of cipher names is available by calling OpenSSL::Cipher.ciphers.
Make sure to call .encrypt or .decrypt before using any of the following methods:
Internally calls EVP_CipherInit_ex(ctx, NULL, NULL, NULL, NULL, 0).
Make sure to call .encrypt or .decrypt before using any of the following methods:
Internally calls EVP_CipherInit_ex(ctx, NULL, NULL, NULL, NULL, 1).
Returns the remaining data held in the cipher object. Further calls to update() or final() will return garbage.
See EVP_CipherFinal_ex for further information.
Sets the key length of the cipher. If the cipher is a fixed length cipher then attempting to set the key length to any value other than the fixed value is an error.
Under normal circumstances you do not need to call this method (and probably shouldn’t).
See EVP_CIPHER_CTX_set_key_length for further information.
Enables or disables padding. By default encryption operations are padded using standard block padding and the padding is checked and removed when decrypting. If the pad parameter is zero then no padding is performed, the total amount of data encrypted or decrypted must then be a multiple of the block size or an error will occur.
See EVP_CIPHER_CTX_set_padding for further information.
Generates and sets the key/iv based on a password.
WARNING: This method is only PKCS5 v1.5 compliant when using RC2, RC4-40, or DES with MD5 or SHA1. Using anything else (like AES) will generate the key/iv using an OpenSSL specific method. Use a PKCS5 v2 key generation method instead.
salt must be an 8 byte string if provided. iterations is a integer with a default of 2048. digest is a Digest object that defaults to ‘MD5’
A minimum of 1000 iterations is recommended.
ruby-doc.org is a service of James Britt and Neurogami, a Ruby application development company in Phoenix, AZ.
Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.
For more information on the Ruby programming language, visit ruby-lang.org.
Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.