[Top] [Prev] [Next]

gensk

Keyring: genSK, genSKfromPK, sktopk, dhparams - generate keys

Synopsis

include "keyring.m";
kr:= load Keyring Keyring->PATH;
genSK:       fn(algname, owner: string, length: int): ref SK; 
genSKfromPK: fn(pk: ref PK, owner: string)          : ref SK;
sktopk:      fn(sk: ref SK)                         : ref PK;
dhparams:    fn(nbits: int)             : (ref IPint, ref IPint);

Description

genSK (algname, owner, length)

Although we call it a private key, the SK adt contains both the private and public parts of a public key. The genSK function generates this key pair. The algname parameter is the name of the algorithm to use; in the current implementation, only "elgamal" is possible. The owner parameter is the user name to be associated with the key. The length parameter specifies the length of the key modulus in bits. The nil value is returned if an unknown algorithm has been specified.

genSKfromPK (pk, owner)

The genSKfromPK function generates a private key that has the same system parameters as the public key, pk. The function is used to generate new keys that are of the same complexity as old keys.

sktopk (sk)

The sktopk function extracts the public part of private key.

dhparams (nbits)

The dhparams function creates Diffie-Hellman parameters. The second IPint returned is an nbits long prime number that serves as the modulus. The first IPint is a primitive root in the integer field defined by that modulus.

See Also

B. Schneier, Applied Cryptography, 1996, J. Wiley & Sons, Inc.



[Top] [Prev] [Next]

infernosupport@lucent.com
Copyright © 1996,Lucent Technologies, Inc. All rights reserved.