This is my first time using the Rebex Security module to encrypt and decrypt streams.
In my code, I am passing in to the Decrypt() method two streams. The sourceStream paramenter is of type StreamReader and the targetStream is a MemoryStream. The intention for the MemoryStream is to NOT write the Plain Text after decrypting back to the file system.
I am getting this exception at run-time; 'Invalid base stream specified. The stream is empty and its not writeable or seekable'.
StreamReader sourceStream = new StreamReader("CypherText.fil");
sourceStream.ReadToEnd();
MemoryStream targetStream = new MemoryStream();
FileEncryption fe = new FileEncryption();
fe.SetPassword("secret password");
fe.Decrypt(sourceStream.BaseStream, targetStream); <--exception here