-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Add 1 new rule op, "insert every" #4552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| #define RULE_OP_MANGLE_TITLE 'E' | ||
| #define RULE_OP_MANGLE_TO_HEX_LOWER 'h' | ||
| #define RULE_OP_MANGLE_TO_HEX_UPPER 'H' | ||
| #define RULE_OP_MANGLE_INSERT_EVERY 'v' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you check JtR compatibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, v is currently unused by JTR. I would have preferred to use I but JTR implements it as adding ing to the end of the password. No other tools use v or I.
|
Could this rule op also insert the byte at the beginning? It's easier to truncate than to prepend the same byte.
|
I had considered this but it doesn't fit the operational definition of how I intended for the rule to work. I'm inserting a character "every N characters from the start of the string". Which is just a bit different from "interleave X character every N bytes" in my opinion. |
Having thought about this some more, I think I may actually be coming around to the idea of changing the behavior to include the preceding position. It's not how I had intended the rule originally, but I think it may be more useful as in your example, a value agnostic |
|
As the author of a Markov rule generator, I think it would be more useful. |
|
In a small survey I ran, 6 people voted for the original behavior and 1 for the change. |
To clarify, original behavior is how it is in the PR now, and change is including the character in the first index (0)? |
|
Yes. |
|
In that case, I will leave it as it is and have it merged. Thanks for the input :) |
|
There are conflicts currently that prevent merging. |
This new rule inserts the desired byte X every N bytes in the password buffer.
The rule is written
vNXwherevis our operator,Nis how many bytes between insertions, andXis the byte to insert.The behavior of the rule is such that if the last position in the buffer is equal to N bytes after the previous insertion, X will be inserted at the end as well. If the value of N is 0, this rule cannot operate and returns the initial buffer. If the value of N is larger than the length of the original buffer, again we cannot operate and must return the original buffer.