You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I gave 0.9.0.pre a test run yesterday, and found a change in behavior from 0.8.0 in that it throws an exception when attempting to save an AR object where the crypt_keeper field is nil.
I'd previously noticed a problem with AR objects and empty strings.
Researching AES just a little bit, it seems AES cannot encrypt an empty string. I'm not sure how other projects/libraries handle it (mysql AES encryption for example works on an empty string).
I suggest we modify the AES encryptor to return nils and empty-strings as-is, like so:
# Public: Decrypt a string
#
# Returns a string
def decrypt(value)
return nil if value.nil?
return '' if value == ''
...
end
# Public: Encrypt a string
#
# Returns a string
def encrypt(value)
return nil if value.nil?
return '' if value == ''
...
end
I'm happy to submit a pull request for this if you agree this should happen.
The text was updated successfully, but these errors were encountered:
I gave 0.9.0.pre a test run yesterday, and found a change in behavior from 0.8.0 in that it throws an exception when attempting to save an AR object where the crypt_keeper field is nil.
I'd previously noticed a problem with AR objects and empty strings.
Researching AES just a little bit, it seems AES cannot encrypt an empty string. I'm not sure how other projects/libraries handle it (mysql AES encryption for example works on an empty string).
I suggest we modify the AES encryptor to return nils and empty-strings as-is, like so:
I'm happy to submit a pull request for this if you agree this should happen.
The text was updated successfully, but these errors were encountered: