I need to encrypt bytecode to send over a connection to a webservice, preferably using a GUID as a key. I have done a bit of research and found several classes developed for a similar purpose, but haven't been able to turn up much that is built into the Windows libraries. My question is: Is there something built in to C# that performs this task? If there is not, I would very much appreciate any suggestions as to implementation.
Edit: After reading this post When would I choose AesCryptoServiceProvider over AesManaged or RijndaelManaged? I am going with AESCryptoServiceProvider.
AES Encryption offers good performance and a good level of security. AES Encryption is a symmetric cipher and uses the same key for encryption and decryption.
Private key Encryption With private-key encryption, you encrypt a secret message using a key that only you know. To decrypt the message, you need to use the same key. Private-key cryptography is effective only if the key can be kept secret.
Symmetric encryption The CryptoStream class can be initialized using any class that derives from the Stream class, including FileStream, MemoryStream, and NetworkStream. Using these classes, you can perform symmetric encryption on a variety of stream objects.
AES 256-bit encryption is the strongest and most robust encryption standard that is commercially available today. While it is theoretically true that AES 256-bit encryption is harder to crack than AES 128-bit encryption, AES 128-bit encryption has never been cracked.
You should check out the System.Security.Cryptography
namespace.
It's not clear whether you're in a position to choose which algorithm etc to use, but you might consider one of the following symmetric algorithms:
AesManaged
or AesCryptoServiceProvider
RijndaelManaged
TripleDESCryptoServiceProvider
There are also implementations of DES and RC2, but I would probably ignore them unless you're forced to use them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With