source: wiki/Overview.wiki @ 107

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

.

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