Tutorial by Examples

Cryptography is something very hard and after spending a lot of time reading different examples and seeing how easy it is to introduce some form of vulnerability I found an answer originally written by @jbtule that I think is very good. Enjoy reading: "The general best practice for symmetric e...
You can improve the security for data transit or storing by implementing encrypting techniques. Basically there are two approaches when using System.Security.Cryptography: symmetric and asymmetric. Symmetric Encryption This method uses a private key in order to perform the data transformation. ...
Passwords should never be stored as plain text! They should be hashed with a randomly generated salt (to defend against rainbow table attacks) using a slow password hashing algorithm. A high number of iterations (> 10k) can be used to slow down brute force attacks. A delay of ~100ms is acceptable...
The following code sample demonstrates a quick and easy means of encrypting and decrypting files using the AES symmetric encryption algorithm. The code randomly generates the Salt and Initialization Vectors each time a file is encrypted, meaning that encrypting the same file with the same password ...
There are times when the framework's Random() class may not be considered random enough, given that it is based on a psuedo-random number generator. The framework's Crypto classes do, however, provide something more robust in the form of RNGCryptoServiceProvider. The following code samples demonstr...
Asymmetric encryption is often regarded as preferable to Symmetric encryption for transferring messages to other parties. This is mainly because it negates many of the risks related to the exchange of a shared key and ensures that whilst anyone with the public key can encrypt a message for the inten...

Page 1 of 1