[GH-ISSUE #1019] PRINCE mode enhancements #621

Closed
opened 2026-10-14 03:15:32 +07:00 by bsakaguchi · 12 comments
Owner

Originally created by @magnumripper on GitHub (Jan 11, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1019

If we can fix any of these we should submit upstream:

  • Improve performance. What makes it so slow?!
  • Resuming takes forever (it uses the --skip option of pp64, and the original code has this problem)
  • Add dupe suppression support? Exists in wordlist.c.

These will be JtR-specific:

  • Add encoding support. This is trivial and will not affect performance in this case.
  • Add --prince-loopback support? Exists in wordlist.c.
  • Add rules support! This should actually be pretty trivial.
Originally created by @magnumripper on GitHub (Jan 11, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1019 If we can fix any of these we should submit [upstream](https://github.com/jsteube/princeprocessor): - [x] Improve performance. What makes it so slow?! - [x] Resuming takes forever (it uses the --skip option of pp64, and the original code has this problem) - [x] Add dupe suppression support? Exists in wordlist.c. These will be JtR-specific: - [x] Add encoding support. This is trivial and will not affect performance in this case. - [x] Add --prince-loopback support? Exists in wordlist.c. - [x] Add rules support! This should actually be pretty trivial.
bsakaguchi 2026-10-14 03:15:32 +07:00
Author
Owner

@magnumripper commented on GitHub (Jan 11, 2015):

Resuming takes forever (it uses the --skip option of pp64, and the original code has this problem)

Apparently it does NOT have this problem. So why is it slow in JtR, doing the exact same thing?!

$ time pp64 <rockyou.lst --skip $((2^64)) | head
<!-- gh-comment-id:69514181 --> @magnumripper commented on GitHub (Jan 11, 2015): > Resuming takes forever (it uses the --skip option of pp64, and the original code has this problem) ~~Apparently it does NOT have this problem. So why is it slow in JtR, doing the exact same thing?!~~ ``` $ time pp64 <rockyou.lst --skip $((2^64)) | head ```
Author
Owner

@magnumripper commented on GitHub (Jan 11, 2015):

LOL, that because $((2^64)) does not work in the shell. Here's a valid test:

$ time pp64 <rockyou.lst --skip $((1<<32)) | head -1
ehd8694

real    1m2.629s
user    1m1.803s
sys     0m0.811s


$ time pp64 <rockyou.lst --skip $((1<<33)) | head -1
kgitbB

real    2m0.408s
user    1m59.581s
sys     0m0.821s
<!-- gh-comment-id:69514440 --> @magnumripper commented on GitHub (Jan 11, 2015): LOL, that because `$((2^64))` does not work in the shell. Here's a valid test: ``` $ time pp64 <rockyou.lst --skip $((1<<32)) | head -1 ehd8694 real 1m2.629s user 1m1.803s sys 0m0.811s $ time pp64 <rockyou.lst --skip $((1<<33)) | head -1 kgitbB real 2m0.408s user 1m59.581s sys 0m0.821s ```
Author
Owner

@magnumripper commented on GitHub (Jan 12, 2015):

@Sk00bz seems to be fixing the performance issues for us 😄
https://github.com/jsteube/princeprocessor/pull/9

<!-- gh-comment-id:69612432 --> @magnumripper commented on GitHub (Jan 12, 2015): [@Sk00bz](https://github.com/Sc00bz) seems to be fixing the performance issues for us :smile: https://github.com/jsteube/princeprocessor/pull/9
Author
Owner

@magnumripper commented on GitHub (Jan 12, 2015):

Upstream changes committed in 6fd398c2e and a major improvement of node/fork speed (which relied on the former) in 5a79845e.

<!-- gh-comment-id:69662313 --> @magnumripper commented on GitHub (Jan 12, 2015): Upstream changes committed in 6fd398c2e and a major improvement of node/fork speed (which relied on the former) in 5a79845e.
Author
Owner

@magnumripper commented on GitHub (Jan 14, 2015):

128-bit integers are now used instead of GMP, if available. 45% speed boost. This is currently not in upstream, only our version. Hopefully Atom can speed up things in other ways as well.

<!-- gh-comment-id:69864601 --> @magnumripper commented on GitHub (Jan 14, 2015): 128-bit integers are now used instead of GMP, if available. 45% speed boost. This is currently not in upstream, only our version. Hopefully Atom can speed up things in other ways as well.
Author
Owner

@magnumripper commented on GitHub (Jan 15, 2015):

540% boost by @Sk00bz now, in c49ba35. I had to drop the int128 version for now because it's too hard to maintain. I'm working on some macros that replace integer GMP with int128's just by replacing the header. That will be cool, just a few bugs left to squash.

<!-- gh-comment-id:70171362 --> @magnumripper commented on GitHub (Jan 15, 2015): 540% boost by @Sk00bz now, in c49ba35. I had to drop the int128 version for now because it's too hard to maintain. I'm working on some macros that replace integer GMP with int128's just by replacing the header. That will be cool, just a few bugs left to squash.
Author
Owner

@magnumripper commented on GitHub (Jan 16, 2015):

9ae2889e re-implements the int128 alternative in a nefarious way. After recent speedup upstream, this is only 15% faster than with GMP but we also want it just for not depending on GMP.

<!-- gh-comment-id:70196590 --> @magnumripper commented on GitHub (Jan 16, 2015): 9ae2889e re-implements the int128 alternative in a nefarious way. After recent speedup upstream, this is only 15% faster than with GMP but we also want it just for not depending on GMP.
Author
Owner

@magnumripper commented on GitHub (Jan 23, 2015):

Encoding support added in 8055c21

<!-- gh-comment-id:71218342 --> @magnumripper commented on GitHub (Jan 23, 2015): Encoding support added in 8055c21
Author
Owner

@magnumripper commented on GitHub (Jan 23, 2015):

Loopback mode added in d9dd1f2. We still lack dupe suppression, which is almost a must for loopback.

<!-- gh-comment-id:71225786 --> @magnumripper commented on GitHub (Jan 23, 2015): Loopback mode added in d9dd1f2. We still lack dupe suppression, which is almost a must for loopback.
Author
Owner

@magnumripper commented on GitHub (Jan 24, 2015):

Optional dupe-suppression added in 8b21116. It's always active in -prince-loopback mode.

<!-- gh-comment-id:71314416 --> @magnumripper commented on GitHub (Jan 24, 2015): Optional dupe-suppression added in 8b21116. It's always active in -prince-loopback mode.
Author
Owner

@magnumripper commented on GitHub (Jan 27, 2015):

I also added optional mmap() support in a54c2ec2. Handy for huge files and fork (or concurrent sessions using same wordlist). This is a JtR-only feature - the upstream princeprocessor only reads stdin anyway.

<!-- gh-comment-id:71753953 --> @magnumripper commented on GitHub (Jan 27, 2015): I also added optional mmap() support in a54c2ec2. Handy for huge files and fork (or concurrent sessions using same wordlist). This is a JtR-only feature - the upstream princeprocessor only reads stdin anyway.
Author
Owner

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

For various reasons we will have to run each word through all rules, instead of the usual other-way-around. This is probably pretty slow but may be useful enough anyway.

<!-- gh-comment-id:71935586 --> @magnumripper commented on GitHub (Jan 28, 2015): For various reasons we will have to run each word through all rules, instead of the usual other-way-around. This is probably pretty slow but may be useful enough anyway.
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#621
No description provided.