Encryption and decryption binary files with c#

試著忘記壹切 提交于 2019-12-11 17:17:27

问题


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.


回答1:


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




回答2:


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




回答3:


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



来源:https://stackoverflow.com/questions/4816121/encryption-and-decryption-binary-files-with-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!