views:

67

answers:

2

I am looking into how to encrypt data in .net.

After some reading decided on to use AES encryption as it's well establised standard and adoped by almost all organizations.

Now i am hunting for how to encrypt data using AES and getting some conflicting results. .Net has classes for AES as well as for Rijndael.

If any one has worked with it could you please share which classes i can use? I found some samples for Rijndael but not for AES.

Technically AES is Rijndael implementation so what is the differences between those two?

+2  A: 

Just addressing the question on the differences? I found one article here:

The Differences Between Rijndael and AES

Excerpt:

Essentially, if you want to use RijndaelManaged as AES you need to make sure that:

  1. The block size is set to 128 bits
  2. You are not using CFB mode, or if you are the feedback size is also 128 bits
o.k.w
Thanks that explains it, Unfortunatly i can't mark multiple answers but this is part of answer.
mamu
No worries, I'm not expecting this to be the accepted one. :)
o.k.w
+1  A: 

To address the Namespace part of the question, use:

System.Security.Cryptography.Aes

Also, here is a link to a blog post that demonstrates the AesManaged class:

Simple Cryptography Block

The code takes a string, encrypts it using the AesManaged wrapper, then converts it to Base64 (which you can comment out if you don't wan't that functionality).

GalacticJello