Introduction
============

This module implements the SEAL2 algorithm. SEAL2 is the second version of the
stream cipher, SEAL, designed by Don Coppersmith and Phillip Rogaway.

Using it is very simple. First you have to create a SEAL2 context
initialize with a 20-byte key"

 >>> import seal2
 >>> context=seal2.new("x"*20)

You can now encrypt data using the encrypt method:

 >>> context.encrypt("Hello, world")
 '\xfb\xfd\x81\xa3\x0e\x05i\x9e\xc6\xbdU\xe7'


Decryption works very similar:

 >>> context=seal2.new("x"*20)
 >>> context.decrypt("\xfb\xfd\x81\xa3\x0e\x05i\x9e\xc6\xbdU\xe7")
 'Hello, world'



Caveat
======

SEAL2 is designed to generate up to 2^48 bytes of output per seed. In 1997,
Handschuh and Gilbert showed, however, that the output stream can be
distinguished from a random sequence after only seeing roughly 2^34 bytes of
output. Thus, it is prudent to avoid using the same seed for more than 2^34
bytes of output.


Requirements & Installation
===========================

seal2 requires python 2.4 or later. You also need setuptools.

To install it you will need a working C compiler and the python development
libraries and include files.

Installing it is simple: you can use the standard setup.py interface::

   python setup.py install


Author, copyright, availability
===============================

The SEAL2 algorithm was designed by Don Coppersmith and Phillip Rogaway.

The original C implementation was taken from the CPAN `Crypt::SEAL2`_ module
and is copyright 2003 by Julius C. Duque.

The python integration was written by Wichert Akkerman <wichert@jarn.com>
and is copyright 2007 by Jarn_.

The code is licensed under the GNU General Public License, version 2.

.. _Crypt::SEAL2: http://search.cpan.org/~jcduque/Crypt-SEAL2-1.0.4/
.. _Jarn: http://www.jarn.com/

