Its me again!
Have readed this page:
https://en.bitcoin.it/wiki/Protocol_specificationGot text:
"Example of double-SHA-256 encoding of string "hello":
hello
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 (first round of sha-256)
9595c9df90075148eb06860365df33584b75bff782a510c6cd4883a419833d50 (second round of sha-256)"
Got after first round :
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
second
a6ac4251402d8b9cbac7af2abeb7f2cd3fc96c3a1d3df508e26870dc91a079a4
or
d7914fe546b684688bb95f4f888a92dfc680603a75f23eb823658031fff766d9
Code:
public string ComputeHash(string input, HashAlgorithm algorithm)
{
Byte[] inputBytes = Encoding.UTF8.GetBytes(input);
Byte[] hashedBytes = algorithm.ComputeHash(inputBytes);
return BitConverter.ToString(hashedBytes);
}
private void button1_Click(object sender, EventArgs e)
{
textBox2.Text = ComputeHash(textBox1.Text, new SHA256Cng());
textBox2.Text = textBox2.Text.ToLower();
textBox2.Text = textBox2.Text.Replace("-", "");
textBox3.Text = ComputeHash(textBox2.Text, new SHA256Cng());
textBox3.Text = textBox3.Text.ToLower();
textBox3.Text = textBox3.Text.Replace("-", "");
}
Whats wrong?