

                 pyTomCrypt.py (v0.20)
                 ---------------------

A ctypes Python wrapper for LibTomCrypt.  See http://libtom.org/

Implements:
  - public key algorithms:  RSA, DSA, ECDSA, ECDH
  - hash algorithms:
      md2, md4, md5, rmd128, rmd160, rmd256, rmd320, 
      sha1, sha224, sha256, sha384, sha512, tiger, whirlpool
  - symmetric ciphers:
      aes, rijndael, twofish, blowfish, des, rc2, des3, cast5, 
      kasumi, anubis, kseed, khazad, noekeon, rc5, rc6, xtea,
      skipjack
  - modes: ecb, cbc, ctr, cfb, ofb
  - MACs:  HMAC, OMAC, PMAC, Pelican, XCBC, F9
  - PRNGs:  fortuna, rc4, sprng, yarrow, sober128
  - libtomcrypt  1.17
  - libtommath   0.41 (optional)
  - tomsfastmath 0.12 (default)

Not [yet?] supported:
  - symmetric cipher: safer
  - modes: lrw, f8
  - hash: chc
  - EC curves other than Tom's base set
  - DSA encrypt/decrypt
  - ASN.1/DER routines
  - EAX, OCB, CCM, GCM

Examples of use: see contents of demos and test dirs

pyTomCrypt is experimental software and intended for educational 
purposes only.  To make your learning and experimentation less
cumbersome, pyTomCrypt is placed in the Public Domain and is 
free for any use.      

    THIS PROGRAM IS PROVIDED WITHOUT WARRANTY OR GUARANTEE
    OF ANY KIND.  USE AT YOUR OWN RISK.  
    
Enjoy,
  
Larry Bugbee
bugbee@seanet.com
June 4, 2007
    
    

----------------------------------------------------------------
  
ToDo:
  - support for EC curves other than Tom's base set
  - ASN.1/DER routines
  - a minimalist build for NSA's Suite B
  - provide a mechanism to allow the packaging of LTC, LTM, TFM 
    and application code as a single Python application without 
    having to install the libs into /usr/lib.  ...including auto 
    detect of platform to support native code for multiple 
    platforms.
  
Changes for v0.20 (August 18, 2007):
  - added support for ELF by adding SONAME to makefile.plus 
    (suggested by Noah and the Fedora crew)
  
Changes for v0.19 (June 4, 2007):
  - added support for Tom's FastMath lib - to switch between LTM
    and TFM, change the value of USE_MATH_LIB in pyTomCrypt.py
  
Changes for v0.18:
  - support libtomcrypt v1.17 by upgrading tomcrypt_plus.c to
    reflect new "LTC_" name changes
  
----------------------------------------------------------------


                       Installation
                       ------------

Prerequisites (compiled and installed):
  - Python 2.5, or Python 2.4.x with ctypes added
  - LibTomCrypt  1.17
  - LibTomMath   0.41
  - TomsFastMath 0.12


Configuration
-------------                    suggested location:

    libtommath.so                in /usr/local/lib
         |
    libtomcrypt.so               in /usr/local/lib
         |   \
         | libtomcrypt_plus.so   in /usr/local/lib
         |   /
    pyTomCrypt.py                in Python's site-packages
         |
  your Python program


LibTomMath, TomsFastMath, LibTomCrypt
-------------------------------------
  Follow Tom's instructions to create shared libraries just
  as if you were going to use them in a C program you might
  write.  Do NOT make them Python extensions; it won't work.
  See http://libtom.org/ for his build instructions.  (I'm
  running OSX and Ubuntu and found it necessary to tweak 
  Tom's makefiles, so if you get stuck, I can make them 
  available.  YMMV.)


LibTomCrypt_plus
----------------
  make -f makefile.plus
  sudo make -f makefile.plus install

  libtomcrypt_plus.so is built as a shared library and NOT 
  as a Python extension.  


NB:  These shared libraries need to be accessible by ctypes.  
     Personally, I have them installed in /usr/local/lib and 
     all is well.  If you want to put them elsewhere that's 
     fine but be sure to set LD_LIBRARY, LD_LIBRARY_PATH or 
     whatever as appropriate for your platform.
     

pyTomCrypt
----------
  sudo python setup.py install


Installed and tested on:
  - miniMac PPC, MacOSX 10.4.9, gcc 4.0, Python 2.4
  - miniMac PPC, Ubuntu 7.04,   gcc 4.1, Python 2.5
  - AMD Athlon, Mandrivia 2006, gcc 3.4, Python 2.4

----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
