[GH-ISSUE #1503] Document the new self-described dynamic format #974

Closed
opened 2026-10-14 03:30:29 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @magnumripper on GitHub (Jul 6, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1503

Originally assigned to: @jfoug on GitHub.

No hurry, just adding an issue so we don't forget.

We should have a list of all valid "functions" like uc() and sha384(), and "variables/constants" like $p, $u, $c and so on.

Originally created by @magnumripper on GitHub (Jul 6, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1503 Originally assigned to: @jfoug on GitHub. No hurry, just adding an issue so we don't forget. We should have a list of all valid "functions" like uc() and sha384(), and "variables/constants" like $p, $u, $c and so on.
bsakaguchi 2026-10-14 03:30:29 +07:00
Author
Owner

@jfoug commented on GitHub (Jul 7, 2015):

and sha384()

These are growing by about a hundred or so, today, lol. I am in the process of adding ALL haval hashes (5 lengths, with 3 iteration counts, so 15 in total). I am also going through ALL of dynamic, and setting it up using #define macros. So now i do things like this:

#define LEXI_FUNC(N,T,L) \
    static void dynamic_f##N##h()    { dyna_helper_pre(); T##_hex();               dyna_helper_poststr(); } \
    static void dynamic_f##N##H()    { dyna_helper_pre(); T##_hex(); strupr(h);    dyna_helper_poststr(); } \
    static void dynamic_f##N##6()    { dyna_helper_pre(); T##_base64();            dyna_helper_poststr(); } \
    static void dynamic_f##N##c()    { dyna_helper_pre(); T##_base64c();           dyna_helper_poststr(); } \
    static void dynamic_f##N##r()    { dyna_helper_pre(); T##_raw();               dyna_helper_post(L); }
LEXI_FUNC(5,md5,16)       LEXI_FUNC(4,md4,16)          LEXI_FUNC(1,sha1,20)
LEXI_FUNC(224,sha224,28)  LEXI_FUNC(256,sha256,32)     LEXI_FUNC(384,sha384,48)  LEXI_FUNC(512,sha512,64)
LEXI_FUNC(gost,gost,28)   LEXI_FUNC(tig,tiger,24)      LEXI_FUNC(wrlp,whirlpool,64)
LEXI_FUNC(rip128,ripemd128,16) LEXI_FUNC(rip160,ripemd160,20) LEXI_FUNC(rip256,ripemd256,32) LEXI_FUNC(rip320,ripemd320,40)
LEXI_FUNC(hav128_3,haval128_3,16) LEXI_FUNC(hav128_4,haval128_4,16) LEXI_FUNC(hav128_5,haval128_5,16)
LEXI_FUNC(hav160_3,haval160_3,20) LEXI_FUNC(hav160_4,haval160_4,20) LEXI_FUNC(hav160_5,haval160_5,20)
LEXI_FUNC(hav192_3,haval192_3,24) LEXI_FUNC(hav192_4,haval192_4,24) LEXI_FUNC(hav192_5,haval192_5,24)
LEXI_FUNC(hav224_3,haval224_3,28) LEXI_FUNC(hav224_4,haval224_4,28) LEXI_FUNC(hav224_5,haval224_5,28)
LEXI_FUNC(hav256_3,haval256_3,32) LEXI_FUNC(hav256_4,haval256_4,32) LEXI_FUNC(hav256_5,haval256_5,32)

Adding a new hash simply consists of adding a new LEXI_FUNC() with proper items. There are about 6 or 7 of these type things in the compiler, about 6-8 in dynamic_fmt.c, many in the parser, some in dynamic.h and probably MANY in dynamic_preload.c I would REALLY like to clean this up, so that adding a new hash is simply adding a line in about 20 places in the code an rebuilding. I already have that for the big_crypt code. In that code, I add one line to a .sh file, and I get the 'real' file. The others are not the real deal, the CPP will actually generate them. It does not make for easy debugging, BUT once things are worked out, all the macro declarations should be working. IF there is something needing debugged, we can always comment out a macro define, and expand the 'real' code, debug, then when fixed, put the macro back.

I hope to have this checked in tonite. Once that is done, extending dyna should be childs play.

<!-- gh-comment-id:119058034 --> @jfoug commented on GitHub (Jul 7, 2015): > and sha384() These are growing by about a hundred or so, today, lol. I am in the process of adding ALL haval hashes (5 lengths, with 3 iteration counts, so 15 in total). I am also going through ALL of dynamic, and setting it up using #define macros. So now i do things like this: ``` C #define LEXI_FUNC(N,T,L) \ static void dynamic_f##N##h() { dyna_helper_pre(); T##_hex(); dyna_helper_poststr(); } \ static void dynamic_f##N##H() { dyna_helper_pre(); T##_hex(); strupr(h); dyna_helper_poststr(); } \ static void dynamic_f##N##6() { dyna_helper_pre(); T##_base64(); dyna_helper_poststr(); } \ static void dynamic_f##N##c() { dyna_helper_pre(); T##_base64c(); dyna_helper_poststr(); } \ static void dynamic_f##N##r() { dyna_helper_pre(); T##_raw(); dyna_helper_post(L); } LEXI_FUNC(5,md5,16) LEXI_FUNC(4,md4,16) LEXI_FUNC(1,sha1,20) LEXI_FUNC(224,sha224,28) LEXI_FUNC(256,sha256,32) LEXI_FUNC(384,sha384,48) LEXI_FUNC(512,sha512,64) LEXI_FUNC(gost,gost,28) LEXI_FUNC(tig,tiger,24) LEXI_FUNC(wrlp,whirlpool,64) LEXI_FUNC(rip128,ripemd128,16) LEXI_FUNC(rip160,ripemd160,20) LEXI_FUNC(rip256,ripemd256,32) LEXI_FUNC(rip320,ripemd320,40) LEXI_FUNC(hav128_3,haval128_3,16) LEXI_FUNC(hav128_4,haval128_4,16) LEXI_FUNC(hav128_5,haval128_5,16) LEXI_FUNC(hav160_3,haval160_3,20) LEXI_FUNC(hav160_4,haval160_4,20) LEXI_FUNC(hav160_5,haval160_5,20) LEXI_FUNC(hav192_3,haval192_3,24) LEXI_FUNC(hav192_4,haval192_4,24) LEXI_FUNC(hav192_5,haval192_5,24) LEXI_FUNC(hav224_3,haval224_3,28) LEXI_FUNC(hav224_4,haval224_4,28) LEXI_FUNC(hav224_5,haval224_5,28) LEXI_FUNC(hav256_3,haval256_3,32) LEXI_FUNC(hav256_4,haval256_4,32) LEXI_FUNC(hav256_5,haval256_5,32) ``` Adding a new hash simply consists of adding a new LEXI_FUNC() with proper items. There are about 6 or 7 of these type things in the compiler, about 6-8 in dynamic_fmt.c, many in the parser, some in dynamic.h and probably MANY in dynamic_preload.c I would REALLY like to clean this up, so that adding a new hash is simply adding a line in about 20 places in the code an rebuilding. I already have that for the big_crypt code. In that code, I add one line to a .sh file, and I get the 'real' file. The others are not the real deal, the CPP will actually generate them. It does not make for easy debugging, BUT once things are worked out, all the macro declarations should be working. IF there is something needing debugged, we can always comment out a macro define, and expand the 'real' code, debug, then when fixed, put the macro back. I hope to have this checked in tonite. Once that is done, extending dyna should be childs play.
Author
Owner

@jfoug commented on GitHub (Jul 17, 2015):

Should this be a stand alone document (my choice), or tied into the existing DYNAMIC readme files?

<!-- gh-comment-id:122405275 --> @jfoug commented on GitHub (Jul 17, 2015): Should this be a stand alone document (my choice), or tied into the existing DYNAMIC readme files?
Author
Owner

@magnumripper commented on GitHub (Jul 17, 2015):

I agree a stand alone new one is better.

<!-- gh-comment-id:122432399 --> @magnumripper commented on GitHub (Jul 17, 2015): I agree a stand alone new one is better.
Author
Owner

@jfoug commented on GitHub (Nov 24, 2015):

9a93a71

<!-- gh-comment-id:159388974 --> @jfoug commented on GitHub (Nov 24, 2015): 9a93a71
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#974
No description provided.