Skip to main content

Timeline for C# AES Encryption

Current License: CC BY-SA 3.0

5 events
when toggle format what by license comment
Jul 2, 2018 at 16:22 vote accept Sam
Jan 25, 2015 at 17:05 comment added Sam CodesInChaos, I just researched the TransformFinalBlock. It does look like I can get rid of the streams. But I also noticed that ICryptoTransform returned by CreateEncryptor() and CreateDecryptor() is an IDisposable. Should that not be wrapped in a using block and properly disposed of?
Jan 23, 2015 at 20:11 comment added Sam I'm relatively new to this so I'm not sure what you mean in your first point. You are correct, 16 bit was a typo--it is 16 bytes. I would use the Rfc2898DeriveBytes(password, saltSize, iterations) constructor to generate a random salt and specify more iterations, correct? Is salt size for this constructor in bits or bytes (Intellisense/MSDN doesn't say)? Do you have examples for the key based encryption stuff you mentioned? I'm trying to keep this somewhat simple so consumers can just call Encrypt(plainText)/Decrypt(cipherText). I have to work out the details on managing the password.
Jan 23, 2015 at 18:32 history edited CodesInChaos CC BY-SA 3.0
added 104 characters in body
Jan 23, 2015 at 18:27 history answered CodesInChaos CC BY-SA 3.0