简体   繁体   中英

Encrypt a CSV file with C# - Decrypt On the Client Side

I have a CSV file that has sensitive information in it. I need to encrypt it and send it over to a SFTP server for a client. I also need to give them something that they can use for decryption.

The problem is I have to do encryption in C# code but I do not know how I can make them decrypt the file. What would be the best approach to handle this kind of requirement? Maybe I create a desktop app for decryption and give it to them?

The best way would be to use common, well-established encryption scheme. I would recommend using PGP or CMS, since they are de-facto standard for encryption. In my opinion, PGP would be much simpler to use and understand. Google for PGP .NET libraries (there are free ones, like Bouncycastle, and commercial, like SecureBlackbox). Also these libraries support SFTP upload. Also clients can use command line or GUI applications/utilities to decrypt PGP messages.

You can put it in a self-extracting archive with encryption.

There are multiple ways to create such archive, one of them is to use command-line tool like 7Zip, or a library like Ionic.Zip

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM