Skip to content
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

Bcrypt valid password and hash compare failed #19558

Closed
sibkod opened this issue Oct 12, 2023 · 0 comments
Closed

Bcrypt valid password and hash compare failed #19558

sibkod opened this issue Oct 12, 2023 · 0 comments
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@sibkod
Copy link
Contributor

sibkod commented Oct 12, 2023

Describe the bug

Valid password and hash verification fails.
Also the hash generated by bcrypt.generate_from_password("123456".bytes(), 1)!
does not pass validation on online services

Reproduction Steps

module main

import bcrypt

fn main(){
	p := "123456"
	h := "$2y$13$7j2kgHgrEiI9kYmiXZuiyu3IJFWXEH.sZN6ai82XNCd9SZ7UwdlTW"

	bcrypt.compare_hash_and_password(p.bytes(), h.bytes()) or { panic(err) }
	println("VALID")
}

Expected Behavior

println("VALID")

Current Behavior

V panic: mismatched hash and password

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.2 e0e0987

Environment details (OS name and version, etc.)

Fedora 38

@sibkod sibkod added the Bug This tag is applied to issues which reports bugs. label Oct 12, 2023
@sibkod sibkod changed the title Bcrypt valid password check and hash fail Bcrypt valid password and hash compare failed Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

1 participant