Claudia Reuter wrote:

>I like to encrypt and decrypt large files e.g. pdf files. I wrote some
>code based on libgcrypt. I tested it with .txt files. Encryption seems
>to work, but gcry_pk_decrypt works only, if there's a single line in the
>txt file.

That suggests your read operations assume textmode.

>fread(&retSize, 1, sizeof(retSize), InputFile);
>//read encrypted text
>Buffer = (char *) malloc(retSize);
>fread(Buffer, 1, retSize, InputFile);

Do you store the file length in the first sizeof(retSize) byte(s)?
You now read sizeof(retSize) bytes of data and store them in *retSize.
Now you consider retSize as a size_t and read that many bytes into
Buffer. Are you sure this is what you want?

-- 
ir. J.C.A. Wevers         //  Physics and science fiction site:
[EMAIL PROTECTED]   //  http://www.xs4all.nl/~johanw/index.html
PGP/GPG public keys at http://www.xs4all.nl/~johanw/pgpkeys.html

_______________________________________________
Gnupg-users mailing list
[email protected]
http://lists.gnupg.org/mailman/listinfo/gnupg-users

Reply via email to