Salsa20 is a fast stream cipher written by Daniel Bernstein 
    that basically uses a hash function to create a stream that 
    is XORed on the data making for very fast encryption and 
        design strength    128 bits
        key length         128 or 256 bits, exactly
        IV, aka nonce      64 bits, always
        chunk size         must be in multiples of 64 bytes
    Salsa20 has two reduced versions, 8 and 12 rounds each.  The 
    12-round reduced version, Salsa20/12, is a "winner" of the 
    EU eSTREAM competition.
    ...and Salsa20 is "free for any use".  
    ----------- is a pure Python implementation of Salsa20.

    ---------- is a simple Python ctypes wrapper.  Salsa20 is 
    as it's name implies, 20 rounds, but there are two reduced 
    versions, 8 and 12 rounds each.  Because the APIs are 
    identical, pySalsa20 is capable of wrapping all three 
    versions (number of rounds hardcoded), including a special 
    version that allows you to set the number of rounds with a 
    set_rounds() function.  Source modification is preferred, 
    but one easy way to get Salsa20/12 is to call set_rounds(12). 
    Be sure to compile the version of your choice as a shared 
    library (not as a Python extension), name and install it as
        from pySalsa20 import Salsa20
        s20 = Salsa20(key, IV)
        dataout = s20.encryptBytes(datain)   # same for decrypt
      One benchmark (10 MB):
        1.5GHz PPC G4     102/97/89 MB/sec for 8/12/20 rounds
        AMD Athlon 2500+   77/67/53 MB/sec for 8/12/20 rounds
          (memory only, no I/O, and before Python GC kicks in)
    Larry Bugbee
    April 2007
    rev Dec 2008