Using AES encryption in C#

If you just want to use the built-in crypto provider RijndaelManaged, check out the following help article (it also has a simple code sample): http://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndaelmanaged.aspx And just in case you need the sample in a hurry, here it is in all its plagiarized glory: using System; using System.IO; using System.Security.Cryptography; namespace RijndaelManaged_Example { class RijndaelExample … Read more

Java 256-bit AES Password-Based Encryption

Share the password (a char[]) and salt (a byte[]—8 bytes selected by a SecureRandom makes a good salt—which doesn’t need to be kept secret) with the recipient out-of-band. Then to derive a good key from this information: /* Derive the key, given password and salt. */ SecretKeyFactory factory = SecretKeyFactory.getInstance(“PBKDF2WithHmacSHA256”); KeySpec spec = new PBEKeySpec(password, … Read more