Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
AsymmetricCiphers


NAME

AsymmetricCiphers - abstraction for public key ciphers

SYNOPSIS

CONST composed = 0; isPrivateKey = 1;
TYPE CapabilitySet = SET;
TYPE Cipher = POINTER TO CipherRec;
TYPE CipherRec = RECORD (BlockCiphers.CipherRec) END;
TYPE SplitProc = PROCEDURE (VAR public: Cipher; key: Cipher);
TYPE RandomStreamProc = PROCEDURE (s: Streams.Stream);
TYPE Interface = POINTER TO InterfaceRec;
TYPE InterfaceRec = 
   RECORD
      (Ciphers.InterfaceRec)
      compencrypt : Ciphers.CryptProc;
      split : SplitProc;
      randomStream : RandomStreamProc;
   END;
PROCEDURE Init (key: Cipher; if: Interface;
               cap: CapabilitySet; inLength, outLength: INTEGER);
PROCEDURE Capabilities (key: Cipher) : CapabilitySet;
PROCEDURE IsPublicKey (key: Cipher) : BOOLEAN;
PROCEDURE Split (VAR public: Cipher; key: Cipher);
PROCEDURE ComposedEncrypt (in: Streams.Stream; key: Cipher;
                 out: Streams.Stream) : BOOLEAN;
PROCEDURE ComposedEncryptPart (in: Streams.Stream; key: Cipher;
                 length: INTEGER; out: Streams.Stream) : BOOLEAN;
PROCEDURE ComposedEncryptBlock (in: Streams.Stream; key: Cipher;
                 out: Streams.Stream) : BOOLEAN;
PROCEDURE RandomStream(s: Streams.Stream; key: Cipher);

DESCRIPTION

AsymmetricCiphers provides an abstraction for the use of public key ciphers. In general a public key consists basically of two parts: a public cipher which can encrypt data and a private cipher which can decrypt (hence the name asymmetric cipher since there are different keys for encryption and decryption). User A may send his public key over an insecure channel to another user B for communication purposes. User B then encrypts the data using A's public key and sends it to him. Since only user A knows how to decrypt data using his private key this communication can not wiretapped by an intruder (at least in theory).

Apart from an encryption and a decryption method an implementation has to provide three other procedures for an asymmetric cipher: compencrypt is the composition of the encryption and decryption maps. For most public key systems this will be the identical map. In this case it may be given as NIL. split extracts the public part of a cipher. randomStream puts some random bytes onto the stream s which can be used as starting values for an encryption with the specific asymmetric cipher.

Init initializes the cipher key with the given interface if, the capabilities cap and the block lengths inlength and outLength.

Capabilites returns the capabilities of an asymmetric cipher. The supported capabilities are:

composed
is set when the composed map of the cipher is not the identity map
isPrivateKey
is set when the cipher is private

IsPublicKey returns TRUE if the cipher key is a public cipher, otherwise FALSE.

Split extracts the public part of the cipher key and returns it as a seperate cipher public. If key itself is a public cipher then public is set to key.

ComposedEncrypt, ComposedEncryptPart andComposedEncryptBlock encrypt the stream in using the composed map of the cipher key. If composed is not a capability of key then the identiy map is used instead. The use of these functions is similar to the use of Ciphers.Encrypt, Ciphers.EncryptPart and BlockCiphers.EncryptBlock.

RandomStream puts some random bytes onto the stream s. These can be used as the starting values of an encryption when the composed map of the cipher is not the identical map.

SEE ALSO

BlockCiphers
abstraction for the use of block ciphers
Ciphers
abstraction for general ciphers and crypto systems
StreamCiphers
abstraction for the use of stream ciphers
TCrypt
implementation of the TCRYPT algorithm

AUTHOR

Michael Szczuka, University of Ulm
Edited by: borchert, last change: 1996/09/17, revision: 1.2, converted to HTML: 1997/04/28

Oberon || Library || Module Index || Search Engine || Definition || Module