lib/symmetric_encryption/cipher.rb in symmetric-encryption-4.2.1 vs lib/symmetric_encryption/cipher.rb in symmetric-encryption-4.3.0
- old
+ new
@@ -56,11 +56,11 @@
# Return as a Hex encoded string
# :none
# Return as raw binary data string. Note: String can contain embedded nulls
# Default: :base64strict
#
- # version [Fixnum]
+ # version [Integer]
# Optional. The version number of this encryption key
# Used by SymmetricEncryption to select the correct key when decrypting data
# Valid Range: 0..255
# Default: 1
#
@@ -129,11 +129,11 @@
# Default: false
# Notes:
# * Should only be used for large strings since compression overhead and
# the overhead of adding the encryption header may exceed any benefits of
# compression
- def encrypt(str, random_iv: false, compress: false, header: always_add_header)
+ def encrypt(str, random_iv: SymmetricEncryption.randomize_iv?, compress: false, header: always_add_header)
return if str.nil?
str = str.to_s
return str if str.empty?
@@ -244,10 +244,10 @@
# header [true|false]
# Whether to add a header to the encrypted string.
# Default: `always_add_header`
#
# See #encrypt to encrypt and encode the result as a string.
- def binary_encrypt(str, random_iv: false, compress: false, header: always_add_header)
+ def binary_encrypt(str, random_iv: SymmetricEncryption.randomize_iv?, compress: false, header: always_add_header)
return if str.nil?
string = str.to_s
return string if string.empty?