decrypt -d <dictionary file> <phrase>
This is decrypt v0.2, a CLI PHP script that can help decrypting
phrases encrypted with any algorithm producing an encrypted phrase where each
symbol always replaces the same, different symbol from the clear text one.
COMMAND LINE OPTIONS
-d, --dictfp <dictionary file>
Load a dictionary file. It has to be a simple text file with one word on each
line. You have to specify at least one, and you can specify more than one
prepending «-d» or «--dictfp» to each file path.
Currently decrypt comes with two xz compressed dictionary files:
«english.txt.xz» and «italiano.txt.xz». To use any of them, you have to
decompress it with the xz program. They both are dumps from the corresponding
aspell dictionaries, with each lemma declined in all its forms. You can
get dumps for other languages with something like this:
aspell -d <lang code> dump master | aspell -l <lang code> expand 4
(You may need to further process the above command output with tr, grep, sed
and the likes, in order to have a functional dictionary file).
“Normalize” each dictionar(y|ies) entry replacing every accented or otherwise
“signed” character with its “plain” form, and removing possible duplicated
entries. For example, this will substitute every “è” character with “e”.
Encrypt the given phrase. Useful for testing purposes. By default, or when
«-m» or «--method» is set to «0», it encrypts the phrase by simply switching
every source character with its subsequent character in the UTF-8 table. With
«-m» or «--method» set to «1», it encrypts the phrase using a random
-m, --method <0|1>
Choose a method for encryption when «-e» or «--encrypt» is specified (see
previous option description). It defaults to “0”.
-p, --progress <0|1|2>
With «0», show no progress during script execution. With «1», show bare
minimum progress. With «2», show detailed progress (this consumes more CPU
and RAM). Defaults to «0».
Write any substition table decrypt may find into a «substable.txt»
file and any solution decrypt may find into a «solutions.txt» file.
Both files will be written in current working directory. Note that possible
existing files with the same name will be overwritten.
Show this help text and exit.
decrypt "ipx nvdi xppe xpvme b xppedivdl divdl?" -d english.txt -p 1 -w
With the bundled «english.txt» dictionary, this will produce 68 possible
solutions, with «how much wood would a woodchuck chuck?» being one of them,
showing bare minimum progress during the execution, writing substitution
tables into «substable.txt» and solutions into «solutions.txt» within
current working directory.
DISCLAIMER AND LICENSE
This program comes with ABSOLUTELY NO WARRANTY; for details see the source.
This is free software, and you are welcome to redistribute it under certain
conditions; see <http://www.gnu.org/licenses/> for details.