[GH-ISSUE #2006] Incorporate AxCrypt-SHA1 into raw SHA-1 source file. #1346

Open
opened 2026-10-14 03:45:07 +07:00 by bsakaguchi · 16 comments
Owner

Originally created by @magnumripper on GitHub (Jan 25, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2006

github.com/magnumripper/JohnTheRipper@9c6373b020 (commitcomment-15601450)

01e053b

Originally created by @magnumripper on GitHub (Jan 25, 2016). Original GitHub issue: https://github.com/openwall/john/issues/2006 https://github.com/magnumripper/JohnTheRipper/commit/9c6373b020fe92e4210777962505bee33701ef1b#commitcomment-15601450 01e053b
Author
Owner

@magnumripper commented on GitHub (Jan 25, 2016):

That commit doesn't work for me

$ ../run/john -test -form:raw-sha1-axcrypt 
Benchmarking: Raw-SHA1-AxCrypt [SHA1 128/128 AVX 4x]... FAILED (source)

Probably trivial problem though.

<!-- gh-comment-id:174467814 --> @magnumripper commented on GitHub (Jan 25, 2016): That commit doesn't work for me ``` $ ../run/john -test -form:raw-sha1-axcrypt Benchmarking: Raw-SHA1-AxCrypt [SHA1 128/128 AVX 4x]... FAILED (source) ``` Probably trivial problem though.
Author
Owner

@ghost commented on GitHub (Jan 25, 2016):

Have you enabled any of the two tests?

    //{"{SHA}VaiuD3vBn9alvHyZcuPY0/UulBo=", "base64test"},
    //{"{SHA}COqO1HN3nVE2Fh45LQs05wAAAAA=", "base64test0truncated"},

If so, they will work fine if you try to crack them in a real run. I tested this here and on super.


This error means self test ciphertext() != source(). I havent fixed it because I'm not sure which one is the correct. Basically:

  • it cracks them (real run and self test). The problem happens only in the check shown above.
  • I don't know what is the canonical form the format should have (is there one?).
  • E.g., is this 'wAAAAA=' correct? Is '3dhUj0=' correct? Any value is acceptable (since last N bytes are ignored).
<!-- gh-comment-id:174534183 --> @ghost commented on GitHub (Jan 25, 2016): Have you enabled any of the two tests? ``` //{"{SHA}VaiuD3vBn9alvHyZcuPY0/UulBo=", "base64test"}, //{"{SHA}COqO1HN3nVE2Fh45LQs05wAAAAA=", "base64test0truncated"}, ``` If so, they will work fine if you try to crack them in a real run. I tested this here and on super. --- This error means self test ciphertext() != source(). I havent fixed it because I'm not sure which one is the correct. Basically: - it cracks them (real run and self test). The problem happens only in the check shown above. - I don't know what is the canonical form the format should have (is there one?). - E.g., is this 'wAAAAA=' correct? Is '3dhUj0=' correct? Any value is acceptable (since last N bytes are ignored).
Author
Owner

@ghost commented on GitHub (Jan 25, 2016):

If you have not commented these tests. Please, can you answer?:

  • is there a canonical?
  • why I haven't seen the error you are seeing?
<!-- gh-comment-id:174535499 --> @ghost commented on GitHub (Jan 25, 2016): If you have not commented these tests. Please, can you answer?: - is there a canonical? - why I haven't seen the error you are seeing?
Author
Owner

@magnumripper commented on GitHub (Jan 25, 2016):

I did not look at (or change) the code at all yet, just built and tried to run it as-is. But I think I see the main problem. The self-test requires (off the top of my head) that the output of source() exactly matches the original ciphertext as it looked after split().

I need to look closer to this but in the end it's very trivial and, like you said, mostly about deciding what to do.

<!-- gh-comment-id:174556681 --> @magnumripper commented on GitHub (Jan 25, 2016): I did not look at (or change) the code at all yet, just built and tried to run it as-is. But I think I see the main problem. The self-test requires (off the top of my head) that the output of source() exactly matches the original ciphertext as it looked after split(). I need to look closer to this but in the end it's very trivial and, like you said, mostly about deciding what to do.
Author
Owner

@ghost commented on GitHub (Jan 25, 2016):

Ok, I decided that the last 32 bits are alwas zero (in source and self text cipher text).
e91b81ebe143a98e69f90b2db92e67e3a48ffe58

Does it work to you? It does here, on super and well.

<!-- gh-comment-id:174586553 --> @ghost commented on GitHub (Jan 25, 2016): Ok, I decided that the last 32 bits are alwas zero (in source and self text cipher text). e91b81ebe143a98e69f90b2db92e67e3a48ffe58 Does it work to you? It does here, on super and well.
Author
Owner

@magnumripper commented on GitHub (Jan 26, 2016):

That works. But I suppose it now needs input hashes padded with zeros? That is inconvenient for user. I presume the native format is simply 32 characters of hex.

<!-- gh-comment-id:174860889 --> @magnumripper commented on GitHub (Jan 26, 2016): That works. But I suppose it now needs input hashes padded with zeros? That is inconvenient for user. I presume the native format is simply 32 characters of hex.
Author
Owner

@magnumripper commented on GitHub (Jan 26, 2016):

OTOH the currently committed format has the same padding..

<!-- gh-comment-id:174861010 --> @magnumripper commented on GitHub (Jan 26, 2016): OTOH the currently committed format has the same padding..
Author
Owner

@magnumripper commented on GitHub (Jan 26, 2016):

I committed it (bleeding dubbed it c5d7b91 but it's the same commit). We'll see what to do with that padding in the end.

<!-- gh-comment-id:174861551 --> @magnumripper commented on GitHub (Jan 26, 2016): I committed it (bleeding dubbed it c5d7b91 but it's the same commit). We'll see what to do with that padding in the end.
Author
Owner

@ghost commented on GitHub (Jan 26, 2016):

I suppose it now needs input hashes padded with zeros?

No, it doesn't. You can crack a pure RAW1 hash using AxCrypt. Only self test hashes have to be padded.

<!-- gh-comment-id:175065771 --> @ghost commented on GitHub (Jan 26, 2016): > I suppose it now needs input hashes padded with zeros? No, it doesn't. You can crack a pure RAW1 hash using AxCrypt. Only self test hashes have to be padded.
Author
Owner

@magnumripper commented on GitHub (Jan 26, 2016):

Yes but I meant just 128 bits of input, as in 145595ef8b1d96d7bd9c5ea1c6d28766 as opposed to anything longer. I actually have no idea but I presume that's how these hashes look straight from their "source".

<!-- gh-comment-id:175132559 --> @magnumripper commented on GitHub (Jan 26, 2016): Yes but I meant just 128 bits of input, as in `145595ef8b1d96d7bd9c5ea1c6d28766` as opposed to anything longer. I actually have no idea but I _presume_ that's how these hashes look straight from their "source".
Author
Owner

@jfoug commented on GitHub (Jan 26, 2016):

a5b6a9b

We probably should 'fail' in valid for hashes that are 40 byte hex, and top 8 bytes are NOT 0.

<!-- gh-comment-id:175148377 --> @jfoug commented on GitHub (Jan 26, 2016): a5b6a9b We probably should 'fail' in valid for hashes that are 40 byte hex, and top 8 bytes are NOT 0.
Author
Owner

@magnumripper commented on GitHub (Jan 28, 2016):

Unless zero-padded 40-byte ones are seen in the wild, we shouldn't support them at all. Only 32-byte truncated ones.

<!-- gh-comment-id:176045356 --> @magnumripper commented on GitHub (Jan 28, 2016): Unless zero-padded 40-byte ones are seen in the wild, we shouldn't support them at all. Only 32-byte truncated ones.
Author
Owner

@jfoug commented on GitHub (Jan 28, 2016):

The original 'how to' page listed to append 0 bytes to the 32 byte hex. Who knows what will be seen ITW

<!-- gh-comment-id:176208173 --> @jfoug commented on GitHub (Jan 28, 2016): The original 'how to' page listed to append 0 bytes to the 32 byte hex. Who knows what will be seen ITW
Author
Owner

@magnumripper commented on GitHub (Jan 28, 2016):

I would say that clearly indicates they come as 32 byte hex.

<!-- gh-comment-id:176422380 --> @magnumripper commented on GitHub (Jan 28, 2016): I would say that clearly indicates they come as 32 byte hex.
Author
Owner

@Fist0urs commented on GitHub (Jan 29, 2016):

Hi, sorry for the delay

@claudioandre

No, it doesn't. You can crack a pure RAW1 hash using AxCrypt. Only self test hashes have to be padded.

you are right, but "original" axcrypt-sha1 should be padded (see below)

@magnumripper

I would say that clearly indicates they come as 32 byte hex.

Yes, they are 32 bytes hex hashes, as found in memory, but I had to pad to 40 bytes to fit raw-sha1 default implementation

@jfoug

We probably should 'fail' in valid for hashes that are 40 byte hex, and top 8 bytes are NOT 0.

That could be an option yes, but I think it should be better to only check the first 32 hex bytes (eg: you've already cracked a raw-sha1 and this one is present in your .pot, then we should be able to say "ok this one is already cracked and is the same as the 32 hex bytes axcrypt one I try to crack" to shorten crack tests)

<!-- gh-comment-id:176803119 --> @Fist0urs commented on GitHub (Jan 29, 2016): Hi, sorry for the delay @claudioandre > No, it doesn't. You can crack a pure RAW1 hash using AxCrypt. Only self test hashes have to be padded. you are right, but "original" axcrypt-sha1 should be padded (see below) @magnumripper > I would say that clearly indicates they come as 32 byte hex. Yes, they are 32 bytes hex hashes, as found in memory, but I had to pad to 40 bytes to fit raw-sha1 default implementation @jfoug > We probably should 'fail' in valid for hashes that are 40 byte hex, and top 8 bytes are NOT 0. That could be an option yes, but I think it should be better to only check the first 32 hex bytes (eg: you've already cracked a raw-sha1 and this one is present in your .pot, then we should be able to say "ok this one is already cracked and is the same as the 32 hex bytes axcrypt one I try to crack" to shorten crack tests)
Author
Owner

@jfoug commented on GitHub (Jan 31, 2016):

Could we add linked-in raw-sha1 to the raw-sha1 format, OR would the reverse steps be a problem since we have to check the 2nd 4 byte value ? I think the split/prepare/valid should be easy. The source would likely simply copy over from the current format. But it is the hash and cmp_*() functions which I question if we can do easily.

<!-- gh-comment-id:177370985 --> @jfoug commented on GitHub (Jan 31, 2016): Could we add linked-in raw-sha1 to the raw-sha1 format, OR would the reverse steps be a problem since we have to check the 2nd 4 byte value ? I think the split/prepare/valid should be easy. The source would likely simply copy over from the current format. But it is the hash and cmp_*() functions which I question if we can do easily.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#1346
No description provided.