/// /// Converts a byte array to a string /// /// Byte array to be converted /// string representation of the byte array private static string byteArrayToString( byte [] arrInput) { StringBuilder sb = new StringBuilder (arrInput.Length * 2); for ( int i = 0; i < arrInput.Length; i++) sb.Append(arrInput[i]. ToString( "X2" )); return sb.ToString().ToUpper(); } private static byte [] StringToByteArray( string textString) { UTF8Encoding encoding = new UTF8Encoding (); return encoding.GetBytes(textString); }