Skip to content

Bcrypt $2y$ Password Hash #43

Closed

Description

@dinkelspiel

Could you please support the Bcrypt $2y$ password hash format. This format is used by PHP in it's password_hash() function which is commonly used in PHP and supporting the format would make migration of data from PHP a whole lot easier.

Activity

  1. mworrell commented on Oct 27, 2026

    @mworrell
    Member

    $2y$ support has been added in #45

    Existing PHP hashes can be passed directly to bcrypt:hashpw/2, which preserves the $2y$ prefix.

    To generate a PHP-compatible hash:

    {ok, Salt} = bcrypt:gen_salt(12, '2y'),
    {ok, Hash} = bcrypt:hashpw(<<"password">>, Salt).

    The resulting hash can be verified with PHP’s password_verify().
    Existing gen_salt/0,1 calls generate $2b$ salts by default.

  2. added this to the 2.0 milestone on Oct 27, 2026
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions