CONVENTIONAL_KEY_ENCRYPT(3)

NAME
conventional_key_encrypt - encrypt a buffer with IDEA

SYNOPSIS
#include <pgplib.h>
#include <idea.h>
int
coventional_key_encrypt(u_char *in, int inlen, u_char digest[16], int compress, int *outlen, u_char **out);

DESCRIPTION
The buffer pointed to by in is assumed to hold a PGP packet. This packet is then encrypted and the result written into allocated memory returned in out which is outlen bytes long. This memory is allocated by means of malloc() and the caller is responsible for freeing it after use. The encryption is done with digest as password and 0 as iv. The password should be the MD5 hash of the actual password. If compress is non-zero the data will be compressed and packed into a compressed packet before encryption; this is usually a good idea.

RETURN VALUES
If no errors are encountered, 0 is returned. On failure, -1 is returned. .

SEE ALSO
malloc(3) free(3) convential_key_encrypt(3) compress_buffer(3) PGPlib(3)

HISTORY
Written by Tage Stabell-Kulų. First appeared in PGPlib 0.1

WARNINGS
PGPlib does not supply an implementation of IDEA. This code assumes that SSL is used. This might change.

STANDARDS
The resulting package (including the embedded compressed package) is compatible with RFC1991.