Skip to content

Incorrect treatment of 2a/2y header in equivalency operator #96

Closed

Description

@dwendt
head :006 > BCrypt::Password.create("test")
 => "$2a$10$HOuBG8tzKLUyk1RK18Xz2uFE76ROdT7w92RSAclL1IoyiS56o70bO"
head :007 > tpw = BCrypt::Password.new("$2a$10$HOuBG8tzKLUyk1RK18Xz2uFE76ROdT7w92RSAclL1IoyiS56o70bO")
 => "$2a$10$HOuBG8tzKLUyk1RK18Xz2uFE76ROdT7w92RSAclL1IoyiS56o70bO"
head :008 > tpw == "test"
 => true
head :009 > tpw = BCrypt::Password.new("$2y$10$HOuBG8tzKLUyk1RK18Xz2uFE76ROdT7w92RSAclL1IoyiS56o70bO")
 => "$2y$10$HOuBG8tzKLUyk1RK18Xz2uFE76ROdT7w92RSAclL1IoyiS56o70bO"
head :010 > tpw == "test"
 => false

Expected is true on both. 2a and 2y hashes should be perfectly compatible.

Activity

  1. tjschuck commented on Jun 10, 2014

    @tjschuck
    Collaborator

    Duplicate of #91, with some additional issues linked there. Closing this in favor of those.

    Thanks for reporting!

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