----------------------------------------------------------------
 Copyright (c) 1999 by Michael Neumann (neumann@s-direktnet.de)
 URL:  http://www.s-direktnet.de/homepages/neumann/crypt/en/
 Date: 23.05.1999
----------------------------------------------------------------


Now, I have written two version of CAST_256. 
One in pure Ruby (see folder "pure") and one which calls some C++ functions.
Of course the version which calls C++ functions is much faster!



----------------
 How to compile
----------------
To compile the C++ files for Windows with VC++ use the files in folder "vc++" and compile
all .cpp files and link them together with rubywm.lib into a DLL.
If you use GCC (Unix) then try folder "gcc".



----------------
 Using CAST_256
----------------
If you use the CAST_256-version written in pure Ruby, you need only "pure/cast_256.rb".
I have tested it with the stable version 1.25, which works, but others do not!

When using the C++ version (recommended) then you need:
   Windows:
      rcast_256.dll
      cast_256.rb
   Unix:
      ??? (you have to compile files in "gcc")
      cast_256.rb



--------------------
 the class CAST_256
--------------------
With the class CAST_256 you can crypt/decrypt using the CAST-256 algorithm, which is a
candidate for AES (Advanced Encryption Standard), and so had to be very secure, and not
yet broken.

The key-size is always 256-bit (32 byte). 

After having created a CAST_256 object (with new), you have to set the key with the
method "set_key(key)", where key is a string which contains a hexadecimal-number, with
64 digits (e.g. "2342bb9efa38542cbed0ac83940ac2988d7c47ce264908461cc1b5137ae6b604").

After that, you can call "encrypt_block(block)", "decrypt_block(block) or 
"crypt_block(block,mode)", where block is a string (not hexadecimal-number string)
of length 16 (128 bit). All three methods return a string of length 16.
"mode" is CAST_256::ENCRYPT or CAST_256::DECRYPT.

See test.rb for an easy example.



---------------
 End
---------------