CONVENTIONAL_KEY_DECRYPT(3)

NAME
conventional_key_decrypt - decrypt an IDEA encrypted buffer

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

DESCRIPTION
The buffer pointed to by in is assumed to hold an IDEA encrypted PGP packet. This packet is decrypted and the result written into allocated memory returned in out which is (at least) outlen bytes long. The memory is allocated by means of malloc() and the caller is responsible for freeing this memory. The decryption is perfomed with digest as password and 0 as iv. The password is really the MD5 hash of the actual password.

RETURN VALUES
If in contains a PGP convential encrypted package, no errors occurs and the password is correct, 0 is returned. If the packet is not a valid packet, 1 is returned. If the password is incorrect, 2 is returned. On failure, -1 is returned. .

SEE ALSO
malloc(3) free(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 routine accepts packets encrypted according to RFC1991, that is, IDEA with context sensitive feedback.