Abhilash

Abhilash

  • NA
  • 4
  • 0

on the fly cryptography in C#.NET

Jan 4 2006 12:49 AM
Dear all,

I would like to do encryption & decryption in a dll, & call these functions from the application, using C#. I am able to pass the file to be encrypted/decrypted to the dll & create the necessary decrypted/encrypted file

Now, i wants to perform on-the-fly cryptography.

I wants to pass a file for encryption to the dll & return the encrypted data in a data structure or stream, which i can use in the applicatiuon. But, when i tried to copy the data from the CryptoStream, i cannot read from it to any datastructure as it's CanRead property is false. Is there any method to return the encrypted data in any datastructure to the application.

On the other hand, while decryption, i am storing the decrypted data in a byte array & returning to the application. Is there any better way for this.

I also wants to send the data from some datastructure to the dll, encrypt/decrypt it & return the data in some datastructure.

In short, my aim is to create a dll, which can perform the encryption & decryption when
1.Input is file & output is to be stored in memory/data structure
2.Input is memory/data structure & output is to be stored in memory/data structure
3.Input is memory/data structure & output is file
4.Input is file structure & output is file

Please help me....

Best Regards,
Abhilash