-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recommended way to update keys? #259
Comments
@lcpriest If you're using Ruby 2.4.x, it now requires keys to be the same bit length as the cipher used. However, as documented in attr-encrypted/encryptor#26, previous versions of Ruby actually didn't use the extra bits, rather, it simply ignored them. You should be able to just use the first 32 bytes and everything should continue to work. As such, I don't believe you need to migrate. |
Are you still concerned with updating keys? If not I would like to close this issue. |
Please feel free to close it, thanks for your clear answer
On Mar 11, 2017 at 1:22 AM, <Stephen Aghaulor ***@***.***)> wrote:
Are you still concerned with updating keys? If not I would like to close this issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (#259 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/AAs5aUcBE-WMMHNhrEoM0qHjMnVFY_Ynks5rkYbXgaJpZM4MZFT1).
]]>
|
Yes, only is cut to 32bits your key cut to d22e8ad01da954c2950fffdbef801621 --> 32 bits that's works for me. |
Context: I am currently updating my Gemfile to a later version of this gem; my keys are currently throwing 'key must be 32 bytes' errors; my current keys are longer than this.
Is there a recommended way to deserialize encrypted attrs and re-encrypt them with a new key?
My base assumption would just be to add a new column using a 32 byte key and them decrypt -> re-encrypt in the new column, then migrate to the new version of the gem.
Alternatively, is there a way to allow longer keys?
The text was updated successfully, but these errors were encountered: