0

I have an encryption key that looks like this:

Z2FzYWdlYmk=

I read the key to a byte[] using Encoding.UTF8.GetBytes(text)

My problem is when I try to turn the byte[] back into a string like this: Encoding.UTF8.GetString

This doesn't help, because it need to be byte.

I just want to know how to "Remove" the string format on this key and then safety convert it back to a string again.

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
donxnik
  • 55
  • 6
  • It is a base64 encoded string. Decode it, then you'll get the byte array. – CodeCaster Nov 18 '15 at 22:17
  • 1
    You might consider using `Convert.FromBase64String` to get the `byte[]`, then run that through `Encoding.UTF8.GetString` to get your final value. – A.Konzel Nov 18 '15 at 22:22

0 Answers0