IrfanRaza
IrfanRaza

Reputation: 3058

Encryption and decryption binary files with c#

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.

Upvotes: 1

Views: 15241

Answers (3)

Stefan Steiger
Stefan Steiger

Reputation: 82186

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

Upvotes: 1

TToni
TToni

Reputation: 9391

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

Upvotes: 4

Polaris
Polaris

Reputation: 3793

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

Upvotes: 2

Related Questions