Registry Mirror
Skip to content

OpenSSL::Cipher::CipherError after upgrade to v3.0 #207

Closed

Description

@Ewg777
OpenSSL::Cipher::CipherError - :
  encryptor (3.0.0) lib/encryptor.rb:98:in `crypt'
  encryptor (3.0.0) lib/encryptor.rb:49:in `decrypt'
  attr_encrypted (3.0.0) lib/attr_encrypted.rb:233:in `decrypt'
  attr_encrypted (3.0.0) lib/attr_encrypted.rb:317:in `decrypt'
  attr_encrypted (3.0.0) lib/attr_encrypted.rb:155:in `block (2 levels) in attr_encrypted'

My model

  attr_encrypted :country, :key => :encryption_key, :encode => true, :type => :string

wft?!

Activity

  1. saghaulor commented on Mar 30, 2016

    @saghaulor
    Contributor

    @Ewg777 Did you just start using attr_encrypted or did you just recently upgrade?

  2. Ewg777 commented on Mar 30, 2016

    @Ewg777
    Author

    @saghaulor just upgraded from v2.0.
    Your lib always breaks my app.

  3. saghaulor commented on Mar 30, 2016

    @saghaulor
    Contributor

    @Ewg777 There were breaking changes between the major releases, hence the major version bumps. You're welcome to use a different lib. Additionally, you're welcome to read the readme. Let me help you: https://github.com/attr-encrypted/attr_encrypted#upgrading-from-attr_encrypted-v2x-to-v3x

  4. Ewg777 commented on Mar 30, 2016

    @Ewg777
    Author

    @saghaulor it'll be great to add this to release notes. Thanks

  5. theleanoptimizer commented on Apr 1, 2017

    @theleanoptimizer

    @saghaulor I've just started a new project with attr_encrypted version 3 and I've received the same error at the very top of this thread.

    I'm using this with active record. I had an issue before where it said it needed an IV as well but the issue is a pretty simple fix. Like it says in the notes you need a 256 bit secret key! :-)

    Here's an example I found on creating one:

    secret_key = Digest::SHA256.hexdigest('a secret key')

    Perhaps you could add an example in the notes on creating the 256 bit secret key?

  6. szymonbaranowski commented on Jun 5, 2018

    @szymonbaranowski

    @ryanj77 Im afraid such secret key will cause ArgumentError: key must be 32 bytes in the Ruby 2.4

  7. gbuchanan-snap commented on Aug 21, 2018

    @gbuchanan-snap

    Maybe we need to do a little Lunch 'n Learn session here:

    Semantic Versioning gives a developer enough context to know when a version bump is probably going to break your app.

  8. Ewg777 commented on Aug 22, 2018

    @Ewg777
    Author

    @gbuchanan-snap a version bump shouldn't break the data of the app, should it?

  9. gbuchanan-snap commented on Aug 22, 2018

    @gbuchanan-snap

    It could. You didn't have to upgrade to the new version of the gem if the repercussions of the bump weren't worth addressing. You can lock a version of the gem to a specific major version in your gemfile.
    It is not up to the developer of the gem to account for the almost infinite edge cases that invariably arise.

  10. mPanasiewicz commented on Apr 23, 2019

    @mPanasiewicz

    In my case, the same error when scret_key_base was damaged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions