mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #599] nWordFileLines (and related line counting vars) should not be unsigned int/long. #269
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#269
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rofl0r on GitHub (May 23, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/599
a file clearly can have more than 2^32 lines.
my preference would be to define those vars as uint64_t, but if there are performance implications on 32bit targets with 32bit off_t (maybe win32 or some embedded platforms), we could use an unsigned type with the sizeof(off_t) instead.
@magnumripper commented on GitHub (May 23, 2014):
Agreed. IMHO they should definitely be
size_twhich would be sensible on both 32 and 64 bit archs.@rofl0r commented on GitHub (May 23, 2014):
not really, size_t is always 32 bit on a 32bit arch, even if they have 64 bit off_t (i.e. everything supporting files > 2GB)
@magnumripper commented on GitHub (May 23, 2014):
That doesn't mean it's sensible. I stick with my opinion about size_t.
@magnumripper commented on GitHub (May 24, 2014):
To reach 4 billion lines without excessive dupes, a file would need to be minimum 21 GB or so. I can see no reasonable use of such a file. What would it contain that rules or a generator mode could not do a whole lot better? Even 'wikipedia wordlist' is less than one gigabyte.
@rofl0r commented on GitHub (May 24, 2014):
i have a file generated from this c code - it is exactly 4 billion lines and 36GB
(ETA code overflows)
@magnumripper commented on GitHub (May 24, 2014):
That is the opposite of reasonable use. Save yourself 36 GB of disk space and use
--mask=0x[0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F].@rofl0r commented on GitHub (May 24, 2014):
there will always be situations when its not clear how to create a certain rule, and its much easier to hack up a program to generate a wordlist. having a temporary wordlist with a couple GB around doesnt hurt, and it can even be quickly consumed given a fast hashtype.
i don't think john developers should discourage users from finding creative usage scenarios, instead of fixing the program so it doesnt break.
@magnumripper commented on GitHub (May 25, 2014):
IMO if you hack up a program or a perl script to generate such a list (which is totally sensible), you'd use the
--stdinor--pipeoption unless you are completely out of your mind or a totally clueless script kiddie.This is yet another moot discussion. Better than continuing this with ridiculous arguments, you could simply:
I assure you that will work a whole lot better. If you can't or do not want to do it, just wait for us to do it at some point in time (might be tomorrow, might be next year). This issue is open.
@rofl0r commented on GitHub (May 25, 2014):
if you really care about 32bit performance (i mean noone but a person "out of its mind or a totally clueless script kiddie" would use a 32bit platform for a serious cracking anyway) just use size_t aka unsigned long so we at least get 64bit on 64bit. i personally dont care an inch about i386 since my computer has more than 4GB RAM (and that's been nearly 10 years).
//edit: for x32 we should use long long tho...
@magnumripper commented on GitHub (May 25, 2014):
Right. The X32 issue is an interesting point. Many functions return
size_tand ftell() returnslong. Both are 32-bit on X32 (the latter is 32-bit on Win64 too butsize_tmust be 64-bit - I assume it'sunsigned long long). I suppose that means X32 will have same limitations as a 32-bit build in this regard unless we do something about it.@magnumripper commented on GitHub (May 25, 2014):
I looked into this. nWordFileLines et al are only used with memory buffering so this issue is moot. You wouldn't want to load a 36 GB file into a static memory buffer and index it with yet another 32 GB, would you?
Here's an actual problem though:
Like I said, @jfoug wants to lift this restriction. I agree but I leave it to him: I don't care much about 32-bit.
@magnumripper commented on GitHub (May 25, 2014):
Oh BTW you could argue that rec_line and other variables should be
long longorsize_tand I would agree. It's just that changing that would break session file compatibility with core. That's a no-no. So you'll have to convince Solar to fix core John first.