openwall / openwall/john

Always store a raw hash if possible

Open
#1,469 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C
Stars
13.6k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

Here's an idea from #1463

Any format that isn't using UTF-16 or something like that, and that is raw or "salted raw", could store its hash as raw. On loading pot file, it would then need to look for raw hashes of the correct type, and apply some logic to it.

Here's an example:

$ cat john.pot
$dynamic_0$488911ea30ce711dca20bf7413fc49cc:johnripper
$dynamic_1$488911ea30ce711dca20bf7413fc49cc$ripper:john
$dynamic_1$488911ea30ce711dca20bf7413fc49cc$ipper:johnr
$dynamic_4$488911ea30ce711dca20bf7413fc49cc$john:ripper
$dynamic_4$488911ea30ce711dca20bf7413fc49cc$jo:hnripper

With clever handling (and perhaps a revision of john.pot format) any of the formats would be able to use any one of the lines to produce a correct --show figure from an input hash.

For example, you load the hash $dynamic_1$488911ea30ce711dca20bf7413fc49cc$ripper. The format finds the line $dynamic_4$488911ea30ce711dca20bf7413fc49cc$john:ripper in john.pot and draws the conclusion the proper plaintext for dynamic_1 is "john".

But taking it a step further, all those formats (as well as the thick raw-md5's) should store their hash like this:

$md5$488911ea30ce711dca20bf7413fc49cc:johnripper

And then they'd have to apply logic to it when reading the pot file back. This would be simpler (and more efficient) than trying to parse all other formats.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the related discussion in #1463 and the john.pot examples in this issue, especially the dynamic and raw-md5 formats. The issue names no source file or test; done would require an agreed pot-file representation and matching logic that preserves correct --show results across the listed formats.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
cryptography, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.