elgamal man page on Plan9

Man page or keyword search:  
man Server   549 pages
apropos Keyword Search (all sections)
Output format
Plan9 logo
[printable version]

ELGAMAL(2)							    ELGAMAL(2)

NAME
       eggen,  egencrypt,  egdecrypt, egsign, egverify, egpuballoc, egpubfree,
       egprivalloc, egprivfree, egsigalloc, egsigfree, egprivtopub  -  elgamal
       encryption

SYNOPSIS
       #include <u.h>
       #include <libc.h>
       #include <mp.h>
       #include <libsec.h>

       EGpriv*	 eggen(int nlen, int nrep)

       mpint*	 egencrypt(EGpub *k, mpint *in, mpint *out)

       mpint*	 egdecrypt(EGpriv *k, mpint *in, mpint *out)

       EGsig*	 egsign(EGpriv *k, mpint *m)

       int	 egverify(EGpub *k, EGsig *sig, mpint *m)

       EGpub*	 egpuballoc(void)

       void	 egpubfree(EGpub*)

       EGpriv*	 egprivalloc(void)

       void	 egprivfree(EGpriv*)

       EGsig*	 egsigalloc(void)

       void	 egsigfree(EGsig*)

       EGpub*	 egprivtopub(EGpriv*)

DESCRIPTION
       Elgamal	is a public key encryption and signature algorithm.  The owner
       of a key publishes the public part of the key:
	    struct EGpub
	    {
		 mpint	   *p;	// modulus
		 mpint	   *alpha;   // generator
		 mpint	   *key;     // (encryption key) alpha**secret mod p
	    };
       This part can be used for encrypting data (with egencrypt) to  be  sent
       to  the	owner.	 The owner decrypts (with egdecrypt) using his private
       key:
	    struct EGpriv
	    {
		 EGpub	   pub;
		 mpint	   *secret; // (decryption key)
	    };

       Keys are generated using eggen.	Eggen takes both  bit  length  of  the
       modulus	and  the  number  of repetitions of the Miller-Rabin primality
       test to run.  If the latter is 0, it does the default number of rounds.
       Egprivtopub  returns  a	newly  allocated copy of the public key correā€
       sponding to the private key.

       The routines egpuballoc, egpubfree,  egprivalloc,  and  egprivfree  are
       provided to manage key storage.

       Egsign signs message m using a private key k yielding a
	    struct EGsig
	    {
		 mpint	   *r, *s;
	    };
       Egverify returns 0 if the signature is valid and -1 if not.

       The  routines egsigalloc and egsigfree are provided to manage signature
       storage.

SOURCE
       /sys/src/libsec

SEE ALSO
       mp(2), aes(2), blowfish(2), des(2), dsa(2), rc4(2), rsa(2), sechash(2),
       prime(2), rand(2)

								    ELGAMAL(2)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server Plan9

List of man pages available for Plan9

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net