using System.Security.Cryptography;
public static void Main()
string pas = "iLoveDogs";
var res = GetPasswordDigestAsBase64(pas, out outputNonce);
Console.WriteLine(outputNonce);
public static string GetPasswordDigestAsBase64(string inputPassword, out string outputNonce)
RandomNumberGenerator rndGenerator = new RNGCryptoServiceProvider();
byte[] _nonce = new Byte[16];
rndGenerator.GetBytes(_nonce);
outputNonce = Convert.ToBase64String(_nonce);
outputNonce = "0TBQcVnd9H4uGi1jGxqJWg==";
_nonce = Convert.FromBase64String(outputNonce);
byte[] time = Encoding.UTF8.GetBytes("2014-06-21T12:43:21.791Z");
byte[] pwd = Encoding.UTF8.GetBytes(inputPassword);
byte[] operand = new byte[_nonce.Length + time.Length + pwd.Length];
Array.Copy(_nonce, operand, _nonce.Length);
Array.Copy(time, 0, operand, _nonce.Length, time.Length);
Array.Copy(pwd, 0, operand, _nonce.Length + time.Length, pwd.Length);
SHA1 sha1 = SHA1.Create();
return Convert.ToBase64String(sha1.ComputeHash(operand));