This repository has been archived by the owner on Apr 5, 2022. It is now read-only.
forked from wmoss/haskell-Crypto
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ReadMe.tex
374 lines (323 loc) · 10.6 KB
/
ReadMe.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
\documentclass{article}
\usepackage{listings}
\usepackage{a4}
\usepackage{courier}
\usepackage{hyperref}
\usepackage{html}
\lstdefinelanguage{ASN1} {
morekeywords={},
sensitive=false,
morecomment=[s]{(--}{--)}
}
\lstdefinelanguage{shell} {
sensitive=true
}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\title{Haskell Cryptographic Library 4.2.0}
\author{Dominic Steinitz}
\begin{document}
\maketitle
The
\htmladdnormallinkfoot
{Haskell Cryptographic Library 4.2.0}
{http://www.haskell.org/crypto}
collects together existing Haskell cryptographic
functions into one cabalized package, together with HUnit tests,
QuickCheck property tests and examples. It is a significant
change from previous versions and now only contains cryptographic
functions; the functions for dealing with ASN.1, X.509 certificates
and PKCS\#8 will be provided by an entirely separate library reducing
the number of dependencies.
This release contains:
\begin{itemize}
\item DES
\item Blowfish
\item AES
\item TEA
\item Cipher Block Chaining (CBC)
\item PKCS\#5 and nulls padding
\item SHA-1
\item MD5
\item RSA
\end{itemize}
Haddock documentation for the library is available
\htmladdnormallinkfoot
{here}
{http://www.haskell.org/crypto/doc/html}
.
\section{System Requirements}
\begin{itemize}
\item
The code has been tested on GHC 6.6 and Hugs Version September 2006.
It does not currently work with YHC because of the lack of {\tt Data.Word}
and {\tt Data.Bits}.
\item
It {\em no longer} requires the use of
{\tt NewBinary.Binary}.
\end{itemize}
\section{Installation Instructions}
Get the sources:
\lstset{language=shell,basicstyle=\ttfamily\small}
\begin{lstlisting}[frame=single]
darcs get --tag "4.2.0" http://code.haskell.org/crypto
\end{lstlisting}
Build and install ready for testing:
\begin{lstlisting}[frame=single]
ghc -o Setup Setup.hs -package Cabal
./Setup configure --prefix=/my/chosen/dir
./Setup build
./Setup install --user
\end{lstlisting}
Run the tests.
\begin{lstlisting}[frame=single]
cd /my/chosen/dir/bin
./RSATest
./SymmetricTest
./QuickTest
\end{lstlisting}
You can now run the examples to confirm further that everything
is working satisfactorily.
When you are happy, build and install them in
their final destination:
\begin{lstlisting}[frame=single]
./Setup unregister --user
./Setup clean
./Setup configure
./Setup build
./Setup install
\end{lstlisting}
\section{To Do}
In no particular order:
\begin{itemize}
\item
Incorporate other symmetric key algorithms already coded in Haskell.
\item
Performance analysis as Blowfish ought to run more quickly than DES.
\item
Other modes / padding schemes.
\item
Extend typechecking to ensure that only the appropriate key sizes are used
for a given algorithm.
\item
Improve performance, for example, for SHA1. This
\htmladdnormallinkfoot
{code}
{http://www.abridgegame.org/repos/darcs-unstable}
runs an order of magnitude faster but, with respect to the authors, doesn't
feel that functional.
\item
Get rid of the GPL code.
\end{itemize}
\section{Contact}
All questions, comments, bug reports, flames, requests for
updates / changes and suggestions should be directed to Dominic Steinitz and
logged
\htmladdnormallinkfoot
{here}
{http://hackage.haskell.org/trac/crypto}
.
\section{Licensing}
The modules in the library come from different authors and have been
released under different licences.
\subsection{Contributors}
\subsubsection{Codec.Binary}
\begin{tabular}{|p{6cm}|p{3cm}|p{3cm}|p{1cm}|}
\hline\hline
Codec.Binary.BubbleBabble & John Meacham &
Copyright \copyright\ 2008, All rights reserved & BSD \\
\hline\hline
\end{tabular}
\subsubsection{Codec.Text}
\begin{tabular}{|p{6cm}|p{3cm}|p{3cm}|p{1cm}|}
\hline\hline
Codec.Text.Raw & Dominic Steinitz &
Copyright \copyright\ 2006, All rights reserved & BSD \\
\hline\hline
\end{tabular}
\subsubsection{Codec.Encryption}
\begin{tabular}{|p{6cm}|p{3cm}|p{3cm}|p{1cm}|}
\hline\hline
Codec.Encryption.AES & Lukasz Anforowicz &
Copyright \copyright\ 2005, All rights reserved & BSD \\
\hline
Codec.Encryption.AESAux & Dominic Steinitz &
Copyright \copyright\ 2005, All rights reserved & BSD \\
\hline
Codec.Encryption.Blowfish & Doug Hoyte &
Copyright \copyright\ 2005, All rights reserved & BSD \\
\hline
Codec.Encryption.BlowfishAux & Dominic Steinitz &
Copyright \copyright\ 2005, All rights reserved & BSD \\
\hline
Codec.Encryption.TEA & John Meacham &
Copyright \copyright\ 2008, All rights reserved & BSD \\
\hline
Codec.Encryption.DES & Ian Lynagh &
Copyright \copyright\ 2005, All rights reserved & BSD \\
\hline
Codec.Encryption.DESAux & Dominic Steinitz &
Copyright \copyright\ 2005, All rights reserved & BSD \\
\hline
Codec.Encryption.Modes & Dominic Steinitz &
Copyright \copyright\ 2005, All rights reserved & BSD \\
\hline
Codec.Encryption.Padding & Dominic Steinitz &
Copyright \copyright\ 2005, All rights reserved & BSD \\
\hline
Codec.Encryption.RSA & David Sankel &
Copyright \copyright\ 2005, All rights reserved & GPL \\
\hline
Codec.Encryption.RSA.EMEOAEP & David Sankel &
Copyright \copyright\ 2005, All rights reserved & GPL \\
\hline
Codec.Encryption.RSA.MGF & Dominic Steinitz &
Copyright \copyright\ 2005, All rights reserved & BSD \\
\hline
Codec.Encryption.RSA.NumberTheory & David Sankel &
Copyright \copyright\ 2005, All rights reserved & GPL \\
\hline\hline
\end{tabular}
\subsubsection{Codec}
\begin{tabular}{|p{6cm}|p{3cm}|p{3cm}|p{1cm}|}
\hline\hline
Codec.Utils & Dominic Steinitz &
Copyright \copyright\ 2005, All rights reserved & BSD \\
\hline\hline
\end{tabular}
\subsubsection{Data.Digest}
\begin{tabular}{|p{6cm}|p{3cm}|p{3cm}|p{1cm}|}
\hline\hline
Data.Digest.MD5 & Dominic Steinitz &
Copyright \copyright\ 2005, All rights reserved & BSD \\
\hline
Data.Digest.MD5Aux & Ian Lynagh &
Copyright \copyright\ 2005, All rights reserved & BSD \\
\hline
Data.Digest.SHA1 & Dominic Steinitz &
Copyright \copyright\ 2005, All rights reserved & BSD \\
\hline\hline
\end{tabular}
\subsubsection{Data}
\begin{tabular}{|p{6cm}|p{3cm}|p{3cm}|p{1cm}|}
\hline\hline
Data.LargeWord
& Dominic Steinitz &
Copyright \copyright\ 2005, All rights reserved & BSD \\
\hline\hline
\end{tabular}
\subsubsection{Tests and Examples}
\begin{tabular}{|p{6cm}|p{3cm}|p{3cm}|p{1cm}|}
\hline\hline
RSATest
& Dominic Steinitz &
Copyright \copyright\ 2005, All rights reserved & BSD \\
\hline
QuickTest
& Dominic Steinitz &
Copyright \copyright\ 2005, All rights reserved & BSD \\
\hline
SymmetricTest
& Dominic Steinitz &
Copyright \copyright\ 2005, All rights reserved & BSD \\
\hline\hline
\end{tabular}
\subsection{The BSD License}
This license is based on
\htmladdnormallinkfoot
{The BSD License}
{http://www.opensource.org/licenses/bsd-license.php}.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
\begin{itemize}
\item
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
\item
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
\item
The names of its contributors may not be used to endorse or promote
products derived from this software without specific prior written permission.
\end{itemize}
\begin{sc}
This software is provided by the copyright holders and contributors ``AS IS''
and any express or implied warranties, including, but not limited to,
the implied warranties of merchantability and fitness for a particular
purpose are disclaimed. In no event shall the copyright onwers or
contributors be liable for any direct, indirect, incidental, special,
exemplary, or consequential damages (including, but not limited to,
procurement of substitute goods or services; loss of use, data, or profits;
or business interruption) however caused and on any theory of liability,
whether in contract, strict liability, or tort (including negligence or
otherwise) arising in any way out of the use of this software,
even if advised of the possibility of such damage.
\end{sc}
\subsection{The GNU General Public License (GPL)}
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You can find a copy of
the GNU General Public License
\htmladdnormallinkfoot
{here}
{http://www.opensource.org/licenses/gpl-license.php}
;
if not, write to the Free Software Foundation, Inc., 59 Temple Place,
Suite 330, Boston, MA 02111-1307 USA
\section{Disclaimer}
Cryptography is a notoriously easy area in which to make mistakes,
not necessarily with the algorithms but with how they are implemented
(for example not protecting keys, using weak keys and so on).
For a readable account of some of the pitfalls, see
\htmladdnormallinkfoot
{Ross Anderson}
{http://www.cl.cam.ac.uk/users/rja14/}
's book.
\begin{sc}
This software is provided by the copyright holders and contributors ``AS IS''
and any express or implied warranties, including, but not limited to,
the implied warranties of merchantability and fitness for a particular
purpose are disclaimed. In no event shall the copyright onwers or
contributors be liable for any direct, indirect, incidental, special,
exemplary, or consequential damages (including, but not limited to,
procurement of substitute goods or services; loss of use, data, or profits;
or business interruption) however caused and on any theory of liability,
whether in contract, strict liability, or tort (including negligence or
otherwise) arising in any way out of the use of this software,
even if advised of the possibility of such damage.
\end{sc}
\section{Acknowledgements}
\begin{itemize}
\item
Doug Hoyte (HardCore SoftWare)
\item
Anatoly Zaretsky
\item
\htmladdnormallinkfoot
{Ian Lynagh}
{http://web.comlab.ox.ac.uk/oucl/work/ian.lynagh}
\item
\htmladdnormallinkfoot
{David Sankel}
{http://www.electronconsulting.com/whois.html}
\item
\htmladdnormallinkfoot
{Ross Paterson}
{http://www.soi.city.ac.uk/~ross}
\item
Lukasz Anforowicz
\item
\htmladdnormallinkfoot
{Warrick Gray}
{http://homepages.paradise.net.nz/warrickg/haskell/http/}
\item
\htmladdnormallinkfoot
{Russell O'Connor}
{http://r6.ca}
\item
Spencer Janssen
\end{itemize}
This document was last updated on 7th December 2008.
\copyright\ 2006--2008 Dominic Steinitz.
\end{document}