>From 2c6753ac4605578072ff1a00d447db5aa0853b63 Mon Sep 17 00:00:00 2001 From: Frank Dittrich Date: Fri, 20 Jul 2012 19:07:50 +0200 Subject: [PATCH] Add [List.External:Filter_Rot13] --- run/john.conf | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/run/john.conf b/run/john.conf index d9e51c7..4157ce1 100644 --- a/run/john.conf +++ b/run/john.conf @@ -1543,6 +1543,32 @@ void filter() word[i] = map2[(o & 0xfff) + (e >> 12)]; } +# Trivial Rot13 Example +# Words which don't contain any letters (and thus wouldn't be changed +# by Rot13) are skipped, because these unchanged words probably should +# have been tried before trying a mangled version. +[List.External:Filter_Rot13] +void filter() +{ + int i, j, c; + + j = 0; + i = 0; // Convert to uppercase + + while (c = word[i]) { + if ((c >= 'a' && c <= 'm') || c >= 'A' && c <= 'M' ) { + word[i] = c + 13; + j++; + } else if ((c >= 'n' && c <= 'z') || c >= 'N' && c <= 'Z' ) { + word[i] = c - 13; + j++; + } + i++; + } + if (j == 0) + word = 0; +} + # Trivial parallel processing example [List.External_base:Parallel] /* -- 1.7.7.6