Here is an example how to encode and decode a string from and to base64:
String encoded = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(sourceString));
String decoded = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(sourceString));