I've made a simple command line example that successfully decrypts a 20KB encrypted data using streams.
The example code (C#) is below. You can try it on your side:
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Net;
using DidiSoft.Pgp;
namespace EncryptStream1024
{
class Program
{
static void Main(string[] args)
{
//
// You can change these to reflect yours
//
string pgpPublicKeyLocation = @"c:\Projects\PGPKeys\public.key";
string pgpPrivateKeyLocation = @"c:\Projects\PGPKeys\private.key";
string privateKeypassword = "changeit";
// download some big text file (20KB in our case)
var cli = new WebClient();
// pgp encrypt
PGPLib pgp = new PGPLib();
string encryptedText = pgp.EncryptString(data, pgpPublicKeyLocation);
//
// pgp decryption
//
MemoryStream outStream = new MemoryStream();
using (Stream encryptedStream = new MemoryStream(UTF8Encoding.UTF8.GetBytes(encryptedText)))
using (Stream keyStream = File.OpenRead(pgpPrivateKeyLocation))
{
pgp.DecryptStream(encryptedStream, keyStream, privateKeypassword, outStream);
}
// do we have more than 1024 bytes ?!?
Console.WriteLine(outStream.Length);
Console.WriteLine("Press <ENTER> to exit.");
Console.ReadLine();
}
}
}
-------
Please let me know of the outcome.
Best Regards,
Peter Kalef
DidiSoft Tech support