In my case, I needed to convert from a given key (that was already in little endian format) to big endian string. It was easier than I first imagined, and did not require shifting bytes. Here's a simple console application I used to test it:
using System;
using System.Text;
public class Program
{
public static void Main()
{
string key = "B13E745599654841172F741A662880D4";
var guid = new Guid(key);
string hex = HexStringFromBytes(guid.ToByteArray());
Console.WriteLine("Original key: " + guid);
Console.WriteLine();
Console.WriteLine("Big-endian version of the key: " + hex);
Console.ReadLine();
}
public static string HexStringFromBytes(byte[] bytes)
{
var sb = new StringBuilder();
foreach (byte b in bytes)
{
var hex = b.ToString("x2");
sb.Append(hex);
}
return sb.ToString();
}
}
The given example prints this in the console:
Original key: B13E7455-9965-4841-172F-741A662880D4
Big-endian version of the key: 55743eb165994148172f741a662880d4
You can find a working fiddle here: Little Endian to Big Endian