openwall / openwall/john

Toggle shift for single letter and add "keyboard layout" options.

Open
#3,469 5 comments 0 reactions 1 assignee View on GitHub

@magnumripper is already working on this.

Since Nov 22, 2018.

enhancement RFC / discussion
Dominant language
C
Stars
13.6k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

t toggles case (a<->A) for whole word and TN toggles position N only.

S toggles shift (eg. a<->A and 4<->$) for whole word. It's a superset of t. Unfortunately there is no variant similar to TN for a single position.

I experimented with this (nearly identical to the TN code) that implements toggle shift of character at position N as WN, and it has proven useful.

diff --git a/src/rules.c b/src/rules.c
index 0016b97e1..308943779 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -1794,6 +1794,14 @@ char *rules_apply(char *word_in, char *rule, int split, char *last)
                        in[0] = 0;
                        break;
 
+               case 'W':
+                       {
+                               int pos;
+                               POSITION(pos)
+                               in[pos] = conv_shift[ARCH_INDEX(in[pos])];
+                       }
+                       break;
+
                case 'S':
                        CONV(conv_shift);
                        break;

I picked W because it was the first unused one (in qwerty order). @solardiz @jsteube is WN OK or would you prefer some other letter?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.