Only Bolivian Here
Only Bolivian Here

Reputation: 36743

Encrypting a string using AES 128 Bit encryption and a key

Imagine I have this key (base 64):

Jdn1jJsD5hFrip4jzHODyA==

If I want to encrypt a string using AES 128 bit and the above key, what facilities does the .NET framework provide for this case?

I've tried searching on MSDN, but haven't found anything useful I could use.

Any guidance?

Upvotes: 0

Views: 7079

Answers (1)

Henk Holterman
Henk Holterman

Reputation: 273274

Your key appears to be encoded in Base64.

 byte[] binKey = System.Convert.FromBase64String(textKey);

will give you a 16 byte key. All encryption classes use byte[] keys.

Upvotes: 2

Related Questions