[GH-ISSUE #1628] Add Unicode support to rules #1075

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

Originally created by @jfoug on GitHub (Aug 9, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1628

This one will also likely sit a while, but lets get it documented here.

We may want to completely replicate the rules engine for utf-8 (or possibly compile it twice, like we do for dynamic_big_crypt), because it is very likely that adding MBCS to rules will greatly slow it down overall.

Originally created by @jfoug on GitHub (Aug 9, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1628 This one will also likely sit a while, but lets get it documented here. We may want to completely replicate the rules engine for utf-8 (or possibly compile it twice, like we do for dynamic_big_crypt), because it is very likely that adding MBCS to rules will greatly slow it down overall.
Author
Owner

@magnumripper commented on GitHub (Aug 9, 2015):

This is a dupe of #509 ;-)

We should definitely just convert the rules engine to UTF-32. That's basically trivial.

<!-- gh-comment-id:129255695 --> @magnumripper commented on GitHub (Aug 9, 2015): This is a dupe of #509 ;-) We should definitely just convert the rules engine to UTF-32. That's basically trivial.
Author
Owner

@magnumripper commented on GitHub (Aug 9, 2015):

I now closed #509 in favor of this fresh one.

<!-- gh-comment-id:129256127 --> @magnumripper commented on GitHub (Aug 9, 2015): I now closed #509 in favor of this fresh one.
Author
Owner

@magnumripper commented on GitHub (Aug 9, 2015):

See #1631 and discussion on ML: http://www.openwall.com/lists/john-dev/2015/08/09/4

<!-- gh-comment-id:129256874 --> @magnumripper commented on GitHub (Aug 9, 2015): See #1631 and discussion on ML: http://www.openwall.com/lists/john-dev/2015/08/09/4
Author
Owner

@jfoug commented on GitHub (Aug 15, 2015):

That brings up a really interesting question. How will we make classes for things like u/l/s/d ?

I want to make sure that question does not get lost in the shuffle.

How are we going to handle things like ?d, ?l, ?U, etc? Are we going to still have to revert this to code page logic? I certainly think that handling ?l in unicode is wrong. Yes, it will be all lower cased letters, BUT there will be 100's or 1000's and almost all will NOT be valid for a search someone is performing.

<!-- gh-comment-id:131271657 --> @jfoug commented on GitHub (Aug 15, 2015): > That brings up a really interesting question. How will we make classes for things like u/l/s/d ? I want to make sure that question does not get lost in the shuffle. How are we going to handle things like ?d, ?l, ?U, etc? Are we going to still have to revert this to code page logic? I certainly think that handling ?l in unicode is wrong. Yes, it will be all lower cased letters, BUT there will be 100's or 1000's and almost all will NOT be valid for a search someone is performing.
Author
Owner

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

I certainly think that handling ?l in unicode is wrong.

Why? I think ?l should mean any lowercase Unicode character, and so on. There are also a lot of case-less characters, which should neither hit ?u nor ?l, I think.

<!-- gh-comment-id:131323139 --> @magnumripper commented on GitHub (Aug 15, 2015): > I certainly think that handling ?l in unicode is wrong. Why? I think `?l` should mean any lowercase Unicode character, and so on. There are also a lot of case-less characters, which should neither hit `?u` nor `?l`, I think.
Author
Owner

@frank-dittrich commented on GitHub (Aug 15, 2015):

I think if you want ?l to mean just lower case ascii, you should be able to get this by using --encoding=ascii.

<!-- gh-comment-id:131323484 --> @frank-dittrich commented on GitHub (Aug 15, 2015): I think if you want ?l to mean just lower case ascii, you should be able to get this by using --encoding=ascii.
Author
Owner

@frank-dittrich commented on GitHub (Aug 15, 2015):

But I doubt that ?d should match ¹, ², ³ or even ¼ etc.

<!-- gh-comment-id:131323529 --> @frank-dittrich commented on GitHub (Aug 15, 2015): But I doubt that ?d should match ¹, ², ³ or even ¼ etc.
Author
Owner

@jfoug commented on GitHub (Aug 15, 2015):

think if you want ?l to mean just lower case ascii, you should be able to get this by using --encoding=ascii.

That was my point @frank-dittrich It means we will still need to keep a large part of the character set information available. Yes, code pages are a bit of a dinosaur, but in large part, they make sense, ITRW. Someone using Russian, is usually going to enter passwords in russian. Not a mix of Russian, chinese, Polish, Icelandic, etc.

So if you take ?l from the 26 chars, and move it to mean all unicode, which is 100's if not 1000's of lower case chars, you may pick up another word here and there, but what you have done is gone from a workable set, to something many orders of magnitude slower, and for almost no gain.

That was my point that assuming unicode for ?l (?d ?u or worse yet ?L, ?U) is almost certainly a 'bad idea'.

<!-- gh-comment-id:131390076 --> @jfoug commented on GitHub (Aug 15, 2015): > think if you want ?l to mean just lower case ascii, you should be able to get this by using --encoding=ascii. That was my point @frank-dittrich It means we will still need to keep a large part of the character set information available. Yes, code pages are a bit of a dinosaur, but in large part, they make sense, ITRW. Someone using Russian, is usually going to enter passwords in russian. Not a mix of Russian, chinese, Polish, Icelandic, etc. So if you take ?l from the 26 chars, and move it to mean all unicode, which is 100's if not 1000's of lower case chars, you may pick up another word here and there, but what you have done is gone from a workable set, to something many orders of magnitude slower, and for almost no gain. That was my point that assuming unicode for ?l (?d ?u or worse yet ?L, ?U) is almost certainly a 'bad idea'.
Author
Owner

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

So it should work like it already does, using --internal-enc. What would be the point of all this then?

<!-- gh-comment-id:131496138 --> @magnumripper commented on GitHub (Aug 16, 2015): So it should work like it already does, using --internal-enc. What would be the point of all this then?
Author
Owner

@magnumripper commented on GitHub (Dec 15, 2018):

See #3510

<!-- gh-comment-id:447573591 --> @magnumripper commented on GitHub (Dec 15, 2018): See #3510
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#1075
No description provided.