Encryption and decryption binary files with c#

2019-09-15 02:09发布

There are lot of examples of encrypting/decrypting passwords and simple text files with c#, available on web. But I havn't found any example on encrypting or decrypting entire binary file like .exe or .mdb file.

Can anybody provide an example on encrypting/decrypting binary file or can provide some links.

Thanks for sharing your valuable time.

3条回答
淡お忘
2楼-- · 2019-09-15 02:51

It's pretty much the same, since the Crypto-APIs deal anyway always with byte streams or arrays.

This might help you: http://www.codeproject.com/KB/security/DotNetCrypto.aspx

查看更多
爷、活的狠高调
3楼-- · 2019-09-15 03:03

I think you can read byte[] from file and just use simple encrypttion.

查看更多
不美不萌又怎样
4楼-- · 2019-09-15 03:09

Hint: Don't use the crypto API.

Take a look into src + examples, at:

http://www.bouncycastle.org/csharp/

Here's why:
http://en.wikipedia.org/wiki/NSAKEY

查看更多
登录 后发表回答