Skip to content

Commit 2024c1d

Browse files
bug fix for run_format_raw.sh ; various changes to README.md
1 parent 7d435e1 commit 2024c1d

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

README.md

+31-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ There is no documentation for dsl and bytecode. It is not obvious how many times
1414

1515
There is a draft of hash parsing library by Alexander Cherepanov. It is not finished (and works by pure luck). It is included into john-devkit but it will be removed when the library become a persistent part of John the Ripper.
1616

17-
7 "raw" formats were implemented: raw-sha256, raw-sha224, raw-sha512, raw-sha384, raw-md4, raw-md5, raw-sha1. SHA-2 family got speed up (~20% for SHA-256, ~5% for SHA-512). md5, md4 and sha1 got noticable slowdown (it needs investigation). (Such speed up for raw-sha256 may be caused by changes in test vector. Accurate benchmarks are needed.)
17+
7 "raw" formats were implemented: raw-sha256, raw-sha224, raw-sha512, raw-sha384, raw-md4, raw-md5, raw-sha1. SHA-2 family got speed up (~12% for SHA-256, ~5% for SHA-512). md5, md4 and sha1 got noticable slowdown (it needs investigation). (Such speed up for raw-sha256 may be caused by changes in test vector. Accurate benchmarks are needed.)
1818

1919
raw-sha256 lost cisco hashes (base64 encoded) so benchmarks differ from John the Ripper not only due to optimizations.
2020

@@ -54,20 +54,48 @@ Then the following will work:
5454

5555
After the first run (for each format), you need to cd into JohnTheRipper/src/ , rerun ./configure script (otherwise you'll get "Unknown ciphertext format name requested") and rerun the command.
5656

57+
## Files layout
58+
59+
`algo_*.py` are abstract definitions of crypto primitives written in DSL.
60+
61+
`bytecode_main.py` is the main library to transform intermediate representation.
62+
63+
`format_john_*.py` are config files to output certain formats for john.
64+
65+
`lang_main.py` and `lang_spec.py` contain support code for DSL.
66+
67+
`LICENSE.jtr` contains license agreement of John the Ripper (`doc/LICENSE` from John the Ripper).
68+
69+
`output_c.py` is the main library to output C code.
70+
71+
`parsing.h` and `parsing_plug.c` are a draft of library to parse hashes by Alexander Cherepanov.
72+
73+
`README.md` is this readme file.
74+
75+
`run_format_raw.sh` is a script to call `format_john_*.py` quickly for "raw" formats, call disassembler and count instructions/size of crypt_all() method.
76+
77+
`slides_2015-05-26_phdays_v.src.org` is a textual source of slides for PHDays V. See below.
78+
79+
`t_raw.c` is a C template for "raw" formats. It contains padding and byteswap for endianity fix. It is derived from code of John the Ripper. See below about its license.
80+
81+
`util_ui.py` is a miscellaneous library.
82+
5783
## Slides for PHDays V
5884

85+
Benchmarks demonstrated at PHDays V are quite inaccurate: raw-sha256 and raw-sha224 are more likely to be only 12% over John the Ripper's speed.
86+
5987
Source file of slides for talk about john-devkit at PHDays V is in
6088
`slides_2015-05-26_phdays_v.src.org`
6189

62-
The slides contain code example from Keccak (from [JohnTheRipper/src/KeccakF-1600-unrolling.macros](https://github.com/magnumripper/JohnTheRipper/blob/bleeding-jumbo/src/KeccakF-1600-unrolling.macros) ) and code example from NetBSD's libcrypt (from [here](https://github.com/rumpkernel/netbsd-userspace-src/blob/3280867f12bbd346f39d5a4efb41fcf9b087bf33/lib/libcrypt/hmac_sha1.c) ). Everything else is under the following license:
90+
The slides contain code example from Keccak (from [JohnTheRipper/src/KeccakF-1600-unrolling.macros](https://github.com/magnumripper/JohnTheRipper/blob/bleeding-jumbo/src/KeccakF-1600-unrolling.macros)) and code example from NetBSD's libcrypt (from [here](https://github.com/rumpkernel/netbsd-userspace-src/blob/3280867f12bbd346f39d5a4efb41fcf9b087bf33/lib/libcrypt/hmac_sha1.c)). Everything else is under the following license:
6391

6492
`Copyright © 2015 Aleksey Cherepanov <[email protected]>`
6593

6694
`Redistribution and use in source and binary forms, with or without modification, are permitted.`
6795

6896
Code examples are between `>>>>` and `<<<<` . `#` in text is quoted with `\`: so `\#include` is for plain `#include`.
6997

70-
TODO: link to .pdf file, the script to compile slides.
98+
TODO: a link to .pdf file, a script to compile slides.
7199

72100
## Usage without John the Ripper
73101

run_format_raw.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Redistribution and use in source and binary forms, with or without
77
# modification, are permitted.
88

9-
M=sha256
9+
M="$1"
1010
F="raw-$M-dk"
1111
N=raw"`printf %s "$M" | sed -e 's/.*/\U&/'`"_my_fmt_plug
1212

@@ -29,6 +29,6 @@ echo "Writing..."
2929
echo "Format: $F"
3030
echo "File: $N"
3131

32-
python ../john-devkit-dirty/format_john_$M.py "" "" > JohnTheRipper/src/$N.c && (cd JohnTheRipper/src/ && RELEASE_BLD="-Wfatal-errors -g" make -s && ../run/john --test=5 --format=$F)
32+
python "../john-devkit-dirty/format_john_$M.py" "" "" > "JohnTheRipper/src/$N.c" && (cd JohnTheRipper/src/ && RELEASE_BLD="-Wfatal-errors -g" make -s && ../run/john --test=5 "--format=$F")
3333

34-
objdump -d JohnTheRipper/src/$N.o | sed -ne '/<crypt_all>/,/^$/ p' > asm && wc -l asm; perl -pe 's/[^\t]*\t//; s/\t.*//' asm | tail -n +2 | perl -pe 's/\s+//g' | perl -lne 'print(length($_) / 2, " bytes of code")'
34+
objdump -d "JohnTheRipper/src/$N.o" | sed -ne '/<crypt_all>/,/^$/ p' > asm && wc -l asm; perl -pe 's/[^\t]*\t//; s/\t.*//' asm | tail -n +2 | perl -pe 's/\s+//g' | perl -lne 'print(length($_) / 2, " bytes of code")'

0 commit comments

Comments
 (0)