sam.cipher
Class Deal

java.lang.Object
  |
  +--sam.cipher.Cipher
        |
        +--sam.cipher.Deal

public class Deal
extends Cipher

Implementation of the Deal algorithm Retrofitted for personal use by Guillaume Lacôte. DEAL is a 128-bit, variable key-size (128-, 192- and 256-bit) symmetric cipher.

DEAL was designed by Lars Ramkilde Knudsen and is described by the designer in: DEAL -- A 128-bit Block Cipher, February 21, 1998 (postscript file).

Copyright © 1997, 1998 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

Disclaimer: this implementation is currently buggy and this cipher is thus not registered by default. I believe this is due to my modifications.


Nested Class Summary
static class Deal.Key
          Key implementation that is adapted to the Deal cipher.
 
Nested classes inherited from class sam.cipher.Cipher
Cipher.ByteArrayFilter, Cipher.Error
 
Field Summary
 
Fields inherited from class sam.cipher.Cipher
DECRYPT, EMPTY, ENCRYPT, INVERSE, key, REGISTRY
 
Constructor Summary
Deal(sam.cipher.Key key)
           
 
Method Summary
protected  void decrypt(byte[] in, int inOffset, sam.cipher.Key key)
          Decrypts exactly one block of plaintext.
protected  void encrypt(byte[] in, int inOffset, sam.cipher.Key key)
          Encrypts exactly one block of plaintext.
 int getPreferredSize(int size)
          The DES preferred size is always 16
 
Methods inherited from class sam.cipher.Cipher
cipher, cipher, fill, main, store, store, storeReversed, streamTest, test, unstoreInt, unstoreLong, unstoreReversedLong
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Deal

public Deal(sam.cipher.Key key)
Method Detail

getPreferredSize

public int getPreferredSize(int size)
The DES preferred size is always 16

Overrides:
getPreferredSize in class Cipher
Parameters:
size - proposed buffer size (in bytes)
Returns:
adjusted buffer size (in bytes)

encrypt

protected void encrypt(byte[] in,
                       int inOffset,
                       sam.cipher.Key key)
Encrypts exactly one block of plaintext.

Specified by:
encrypt in class Cipher
Parameters:
in - The plaintext.
inOffset - Index of in from which to start considering data.
key - The session key to use for encryption.

decrypt

protected void decrypt(byte[] in,
                       int inOffset,
                       sam.cipher.Key key)
Decrypts exactly one block of plaintext.

Specified by:
decrypt in class Cipher
Parameters:
in - The plaintext.
inOffset - Index of in from which to start considering data.
key - The session key to use for encryption.