Sitelet https://github.com/bcrypt-ruby/bcrypt-ruby/issues/82
Skip to content

JRuby and MRI give incompatible results #82

Description

@dgolombek

Running the following code in MRI 1.9.3 and REE 1.8.7 returns true, while running in JRuby (1.6.7.2, 1.7.3, and 1.7.6, in both 1.8 and 1.9 modes) returns false

require 'rubygems'
require 'bcrypt'
require 'base64'
b64h = "BqvyJXQvnL3CKVd6pAv25giyYNEGXg4k5UOwkTeYXZo=\n"
password = "$2a$12$BaVII7NCCtTxF4BKdjPy2.IkvEG4X4/CRhDvmenQKm2r/6pIoW..q"
BCrypt::Password.new(password) == Base64.decode64(b64h)

I've run all the testcases from http://www.mindrot.org/projects/jBCrypt/ and they produce the same results on MRI and JRuby, so this isn't an across-the-board incompatibility, but something about password makes it unhappy. I haven't yet run this in other Bcrypt impls in other languages to see what they return.

Activity

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