C# - symetric text encryption for a beginner

I'm trying to do some basic symetric text encryption with C# and the .NET framework.  I have a string variable with data and I need to have it encrypted and stored into another string variable.

I know there are a lot of examples out there, but I'm new and am having a little trouble wrapping my brain around a lot of what I'm finding.  Can somone please give me some basic example code that I can use to accomplish the above mentioned task?
josephdaviskcrmAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
josephdaviskcrmAuthor Commented:
Ok... so once again... I'm needing help interpreting and making these work.  I've been looking at the second link that you posted and have been trying to make this encryption class that he is using work for me.  I've got the entire class saved as a class file and I'm referencing it in the code below.  The code runs without any syntax errors, but the result of the encryption function is just a bunch of squares...

Àg%‹|h8c¤nÚÃó€U £)åÈ`½¥ûšð

Is it supposed to show up like that?  What I'm looking for is something that will give me an encrypted ASCII string so I can shove it in the a varchar field in a database.
byte[] key; byte[] iv;
key = UnicodeEncoding.Unicode.GetBytes("cornhle");
iv = UnicodeEncoding.Unicode.GetBytes("abcdefg");
strUniqueID = Encryption.EncryptData(strUniqueID, out key, out iv);

Open in new window

0
askbCommented:
Then you would need to encode the encrypted binary string in some know format (base64)  which would be suitable to store it as a string,

Later, you need to decode the encoded sting first and then decrypt.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.