ice-doc-C.html
951e87ac163f07cb72e239044e7f9135e0b076557b4344fc68b70e61dbd0cbe0
<HTML>
<HEAD><TITLE>The ICE Encryption Library</TITLE></HEAD>
<BODY BGCOLOR="#d8d8d8" TEXT="#000080" LINK="#0000FF">
<H1>The ICE Encryption Library</H1>
<H3>Synopsis</H3>
<DL>
<DD> <CODE>#include <ice.h></CODE>
<BR><BR>
<DD> <CODE>ICE_KEY *ice_key_create (int level);</CODE>
<BR><BR>
<DD> <CODE>void ice_key_destroy (ICE_KEY *ik);</CODE>
<BR><BR>
<DD> <CODE>void ice_key_set (ICE_KEY *ik, const unsigned char *key);</CODE>
<BR><BR>
<DD> <CODE>unsigned char *ice_key_encrypt (const ICE_KEY *ik,
const unsigned char *plaintext, unsigned char *ciphertext);</CODE>
<BR><BR>
<DD> <CODE>unsigned char *ice_key_decrypt (const ICE_KEY *ik,
const unsigned char *ciphertext, unsigned char *plaintext);</CODE>
<BR><BR>
<DD> <CODE>int ice_key_key_size (const ICE_KEY *ik);</CODE>
<BR><BR>
<DD> <CODE>int ice_key_block_size (const ICE_KEY *ik);</CODE>
</DL>
<H3>Description</H3>
<P>
The ICE library <B>libice.a</B> contains functions for encrypting and
decrypting 64-bit blocks of data with the ICE (Information Concealment
Engine) encryption algorithm. </P>
<P>
The function <CODE>ice_key_create()</CODE> creates a new <CODE>ICE_KEY</CODE>
that can be used to encrypt and decrypt data. The <EM>level</EM> of
encryption determines the size of the key, and hence its speed.
Level 0 uses the Thin-ICE variant, which is an 8-round cipher taking
an 8-byte key. This is the fastest option, and is generally considered
to be at least as secure as DES, although it is not yet certain whether
it is as secure as its key size. </P>
<P>
For levels <EM>n</EM> greater than zero, a 16<EM>n</EM>-round cipher is
used, taking 8<EM>n</EM>-byte keys. Although not as fast as level 0, these
are very very secure. </P>
<P>
Before an <CODE>ICE_KEY</CODE> can be used to encrypt data, its key
schedule must be set with the <CODE>ice_key_set()</CODE> function.
The length of the key required is determined by the level, as described
above. </P>
<P>
The functions <CODE>ice_key_encrypt()</CODE> and <CODE>ice_key_decrypt()</CODE>
encrypt and decrypt respectively data in blocks of eight characters, using
the specified key. They return a pointer to the resulting
ciphertext/plaintext. </P>
<P>
Two functions <CODE>ice_key_key_size()</CODE> and
<CODE>ice_key_block_size()</CODE>
are provided which return the key and block size
respectively, measured in bytes. The key size is determined by
the level, while the block size is always 8. </P>
<P>
To destroy a key when it is no longer needed, the function
<CODE>ice_key_destroy()</CODE> should be used. As well as freeing up
memory, it zeroes it out, thus preventing snooping. </P>
<HR>
<DIV ALIGN=RIGHT>
<FONT SIZE=-1>
Document written by Matthew Kwan, 25 March 1997 <BR>
Please send any comments or corrections to
<A HREF="mailto:mkwan@darkside.com.au">mkwan@darkside.com.au</A>
</FONT>
</DIV>
</BODY>
</HTML>