source: wiki/Overview.wiki @ 106

Last change on this file since 106 was 106, checked in by tim, 8 years ago

.

File size: 5.7 KB
Line 
1Here you will find a brief overview of the tools and libraries provided by Bletchley.  For further details, see the individual tool usage statements, pydoc documentation, and of course the <a href="https://github.com/ecbftw/bletchley">source code</a>.
2
3<h1>Installation</h1>
4See: <a href="https://github.com/ecbftw/bletchley/blob/master/trunk/INSTALL">INSTALL</a>
5
6<h1>Command Line Tools</h1>
7
8<h2> bletchley-analyze </h2>
9<p>
10Analyzes samples of encrypted data in an attempt to decode samples to
11binary and identify patterns useful in cryptanalysis.  The purpose of
12the tool is to provide an cryptanalyst with a variety of information
13that is useful in determining how a token is encoded, encrypted and
14formatted.
15</p>
16<p>
17bletchley-analyze currently performs two primary functions: iterative
18encoding detection and ciphertext-only block analysis.  Encrypted tokens
19are processed in multiple rounds. Within each round, the following
20occurs:
21</p>
22<p>
23<ul>
24 <li>Token length analysis is performed to attempt to determine possible
25 ciphertext block sizes, where applicable</li>
26 <li>The tokens are analyzed for blocks of data that are repeated
27 throughout any of the tokens</li>
28 <li>A hexadecimal dump and escaped binary/ascii string is printed for
29 each token with repeated blocks highlighted</li>
30 <li>The full set of all known and possible data encodings is
31 determined<sup>1</sup></li>
32 <li>An educated guess is made as to the most likely encoding is</li>
33 <li>All tokens are decoded using the most likely encoding, and then the
34 process is repeated until no further encodings are detected</li>
35</ul>
36</p>
37<p>
38<code>bletchley-analyze</code> can read from stdin or from a file.  Tokens are
39delimited with newlines.  Various options are provided to give the
40analyst control over the block sizes and encoding used during analysis.
41See the tool's usage statement for more information.
42</p>
43<p>
44As an example, several tokens were encrypted using ECB mode and encoded
45using base64, and then percent (URL) encoded:
46</p>
47<pre>
48zRW5bHxcRYHHqi0nriqOzg%3D%3D
49meU8SyxVHE3Hqi0nriqOzg%3D%3D
50vTA9eA4hhbFlktsbYI4hIg%3D%3D
51meU8SyxVHE1lktsbYI4hIg%3D%3D
52</pre>
53<p>
54These tokens were then fed to <code>bletchley-analyze</code>:
55</p>
56<p><img src="https://code.blindspotsecurity.com/trac/bletchley/export/head/wiki/images/bletchley-analyze.png" /></p>
57<p>
581. <i>Bletchley's blobtools module currently supports 36 encoding variants,
59including various forms of hexadecimal, base32, base64, and percent
60encodings. Try '<code>-e ?</code>' to list them.</i>
61</p>
62
63<h2> bletchley-encode </h2>
64<p>
65A simple tool to encode arbitrary data using a specified encoding chain.
66See the usage statement for more information.  A quick example:
67</p>
68<p>
69<pre>
70$ echo 'Mallory Is My Friend.' | bletchley-encode -e percent/upper-plus,base64/rfc3548
71TWFsbG9yeSBJcyBNeSBGcmllbmQuCg%3D%3D
72</pre>
73</p>
74<p>
75NOTE: The encoding chain is applied from right to left in order to be consistent with other tools. 
76That is, one can use the same encoding chain ordering for
77<code>bletchley-encode</code>, <code>bletchley-decode</code>, and <code>bletchley-analyze</code>.
78</p>
79
80<h2> bletchley-decode </h2>
81<p>
82A simple tool to decode data using a specified encoding chain.  See the
83usage statement for more information.  A quick example:
84</p>
85<p>
86<pre>
87$ echo 'TWFsbG9yeSBJcyBNeSBGcmllbmQuCg%3D%3D' | bletchley-decode -e percent/upper-plus,base64/rfc3548
88Mallory Is My Friend.
89</pre>
90</p>
91
92<h2> bletchley-http2py </h2>
93<p>
94This script parses an HTTP request (provided via stdin or as a text
95file) and generates a Python script that sends (approximately) the same
96request.  This is useful when one wants to repeatedly send variations of
97a request that was observed to be sent by an application or web
98browser.  For more information, see the script's usage statement.
99</p>
100
101<h2> bletchley-nextrand </h2>
102<p>A simple program which computes the state of a Java Random class
103instance given two sequential outputs of
104<a href="http://docs.oracle.com/javase/6/docs/api/java/util/Random.html#nextInt()"><code>nextInt()</code></a>.
105For more information, see the usage statement.
106</p>
107
108<h1>Libraries</h1>
109<p>
110Start with '<code>pydoc3 bletchley</code>'.  The following provides a brief overview of what each module is for.
111</p>
112
113<h2> blobtools </h2>
114
115<p>This module contains the code which handles base analysis of encrypted
116token encodings.  It can be used to automatically detect the most likely
117encoding variant ("dialect") as well as to quickly encode or decode data
118which is wrapped in multiple levels of encodings.
119</p>
120
121<h2> buffertools </h2>
122<p>
123This module contains a collection of tools mean to help one manipulate
124binary buffers of ciphertext.
125</p>
126
127<h2> CBC </h2>
128<p>
129The CBC module contains various tools for attacking CBC encrypted data.
130In particular, it contains the POA class which automates padding oracle
131attacks.  To use the POA class, one simply needs to implement a function
132in Python 3 which submits a request to an oracle and returns True if the
133padding check was successful and False otherwise.  See
134'<code>pydoc3 bletchley.CBC.POA</code>' for more details.
135</p>
136
137<h1>Support</h1>
138<p>
139Having trouble?  Submit an issue <a href="/trac/bletchley/newticket">here</a>, or
140ask on the <a href="https://groups.google.com/d/forum/bletchley-devel">email list</a>.
141</p>
142
143<h1>Contributing</h1>
144<p>
145We welcome any kind of help with the project, from new tools to bug
146fixes and documentation.  You might want to start with our <a href="/trunk/doc/TODO">TODO</a>
147list.  Note that the GitHub repository is currently just a static mirror, so please don't submit pull requests.
148To submit a patch, please post an issue or submit it to the <a href="https://groups.google.com/d/forum/bletchley-devel">email list</a> and we'll merge it.
149</p>
Note: See TracBrowser for help on using the repository browser.