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

Add regex and test for yescrypt #139

Merged
merged 1 commit into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions name_that_hash/hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,18 @@ class HashInfo:
HashInfo(name="bcrypt", hashcat=3200, john="bcrypt", extended=False),
],
),
Prototype(
regex=re.compile(r"^\$y\$[.\/A-Za-z0-9]+\$[.\/a-zA-Z0-9]+\$[.\/A-Za-z0-9]{43}$", re.IGNORECASE),
modes=[
HashInfo(
name="yescrypt",
hashcat="Not yet supported, see notes in summary.",
john="On systems that use libxcrypt, you may use --format=crypt to use JtR in passthrough mode which uses the system's crypt function.",
extended=False,
description="Can be used in Linux Shadow Files in modern Linux distributions like Ubuntu 22.04, Debian 11, Fedora 35. On hashcat this is not yet implemented, please vote (👍 \"thumbs up\") on this issue: https://github.com/hashcat/hashcat/issues/2816."
)
],
),
Prototype(
regex=re.compile(r"^[a-f0-9]{40}:[a-f0-9]{16}$", re.IGNORECASE),
modes=[HashInfo(name="Android PIN", hashcat=5800, john=None, extended=False)],
Expand Down
9 changes: 9 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,3 +372,12 @@ def test_argon2d():

x = runner.api_return_hashes_as_json(hashes)
assert "Argon2d" in x


def test_yescrypt():
hashes = [
"$y$j9T$.9s2wZRY3hcP/udKIFher1$sIBIYsiMmFlXhKOO4ZDJDXo54byuq7a4xAD0k9jw2m4"
]

x = runner.api_return_hashes_as_json(hashes)
assert "yescrypt" in x