lib/symmetric_encryption/symmetric_encryption.rb in symmetric-encryption-0.5.2 vs lib/symmetric_encryption/symmetric_encryption.rb in symmetric-encryption-0.6.0

- old
+ new

@@ -19,12 +19,12 @@ end # Returns the Primary Symmetric Cipher being used # If a version is supplied, then the cipher matching that version will be # returned or nil if no match was found - def self.cipher(version = nil) - return @@cipher if version.nil? || (@@cipher.version == version) + def self.cipher(version = 0) + return @@cipher if version.nil? || (version == 0) || (@@cipher.version == version) secondary_ciphers.find {|c| c.version == version} end # Set the Secondary Symmetric Ciphers Array to be used def self.secondary_ciphers=(secondary_ciphers) @@ -188,10 +188,10 @@ # Binary encrypted data includes this magic header so that we can quickly # identify binary data versus base64 encoded data that does not have this header unless defined? MAGIC_HEADER MAGIC_HEADER = '@EnC' MAGIC_HEADER_SIZE = MAGIC_HEADER.size - MAGIC_HEADER_UNPACK = "A#{MAGIC_HEADER_SIZE}v" + MAGIC_HEADER_UNPACK = "a#{MAGIC_HEADER_SIZE}v" end protected # Returns the Encryption Configuration \ No newline at end of file