org.logi.crypto.protocols
Class EncryptedKeyExServer

java.lang.Object
  |
  +--org.logi.crypto.Crypto
        |
        +--org.logi.crypto.protocols.EncryptedKeyEx
              |
              +--org.logi.crypto.protocols.EncryptedKeyExServer
All Implemented Interfaces:
InterKeyExServer, InterProtocolServer, NoninterKeyExServer, NoninterProtocolServer

public class EncryptedKeyExServer
extends EncryptedKeyEx
implements NoninterKeyExServer

Receive an encrypted key from the correstponding EncryptedKeyExClient and optionally check a signature.

This is a non-interactive protocol and the client sends one message to the server containing E(K) and optionally S(H(E(K)))). E is encryption with a CipherKey, S is signing with a Signature key, both set when the object is created. H is the default hash-function, which will be SHA1 unless changed.

If the key-exchange is performed with a public-key cryptosystem you will almost certainly want to authenticate the client in some way, such as by having him sign the session key.

In the case where a symmetric cipher is used for key-exchange and no signatures are used, attacks on the system, such as modified or dropped packages, etc., will be difficult to distinguish from transmission errors.

Author:
Logi Ragnarsson (logir@logi.org)
See Also:
EncryptedKeyExClient, SignatureKey, CipherKey, HashState.setDefaultHashFunction(java.lang.String)

Fields inherited from class org.logi.crypto.Crypto
BIT, cdsPath, EMPTY_ARRAY, FOUR, keySource, NIBBLE, ONE, primeCertainty, random, TWO, ZERO
 
Constructor Summary
EncryptedKeyExServer(CipherKey key)
          Creates a new EncryptedKeyExchangeServer object.
EncryptedKeyExServer(CipherKey key, SignatureKey verifyKey)
          Creates a new EncryptedKeyExchangeServer object.
EncryptedKeyExServer(CipherKey key, SignatureKey verifyKey, Seedable seedMe)
          Creates a new EncryptedKeyExchangeServer object.
 
Method Summary
 byte[] message(byte[] received)
          Get the next message in the protocol.
 
Methods inherited from class org.logi.crypto.protocols.EncryptedKeyEx
completed, maxMessageSize, sessionKey
 
Methods inherited from class org.logi.crypto.Crypto
binString, binString, equal, equalRelaxed, equalSub, fromHexNibble, fromHexString, fromString, fromString, hexString, hexString, hexString, hexString, hexString, initRandom, initRandom, makeClass, makeInt, makeLong, makeSessionKey, pastSpace, pickBits, pickBits, readBlock, readInt, writeBytes, writeBytes, writeInt
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.logi.crypto.protocols.InterProtocolServer
completed, maxMessageSize
 
Methods inherited from interface org.logi.crypto.protocols.InterKeyExServer
sessionKey
 

Constructor Detail

EncryptedKeyExServer

public EncryptedKeyExServer(CipherKey key)
Creates a new EncryptedKeyExchangeServer object. It uses key to decrypt the session key sent to it by the client.

EncryptedKeyExServer

public EncryptedKeyExServer(CipherKey key,
                            SignatureKey verifyKey)
Creates a new EncryptedKeyExchangeServer object. It uses key to decrypt the session key sent to it by the client.

If verifyKey is not null, a signature is expected to accompany the session key. If none is found, it will be treated as if a signature was not verified.


EncryptedKeyExServer

public EncryptedKeyExServer(CipherKey key,
                            SignatureKey verifyKey,
                            Seedable seedMe)
Creates a new EncryptedKeyExchangeServer object. It uses key to decrypt the session key sent to it by the client.

If verifyKey is not null, a signature is expected to accompany the session key. If none is found, it will be treated as if a signature was not verified.

If seedMe is not null, then any messages recieved which may contain random numbers from the server will be added to this objects entropy pool.

Method Detail

message

public byte[] message(byte[] received)
               throws CryptoProtocolException
Get the next message in the protocol.

process one message from the client. Since this protocol only requires a single message to be sent from the client to the server with no answer, the message method returns null and can be called independently, any number of times.

Specified by:
message in interface InterProtocolServer
Throws:
CryptoProtocolException - if a problem arises with the protocol.


Copyright 1997-2000 Logi Ragnarsson