\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}