I have gazed into my crystal ball and emerged with a prediction for 2006. Revealing my prediction now may influence the event itself, so I will post only the hash for the prediction. I will post the actual prediction at the end of the year.
using System.Security.Cryptography;
using System;
class Prediction {
static void DoHash(byte[] bytes, string name, HashAlgorithm hash)
{
Console.WriteLine(name);
hash.ComputeHash(bytes);
byte[] result = hash.Hash;
for (int i = 0; i < result.Length; i++) {
Console.Write("{0:X2}", result[i]);
if (i % 32 == 31) Console.WriteLine();
}
if (result.Length % 32 != 0) Console.WriteLine();
}
static void Main()
{
string msg = "prediction goes here";
Console.WriteLine("length {0}", msg.Length);
byte[] bytes = (new System.Text.ASCIIEncoding()).GetBytes(msg);
DoHash(bytes, "MD5", MD5.Create());
DoHash(bytes, "SHA1", SHA1.Create());
DoHash(bytes, "SHA256", SHA256.Create());
DoHash(bytes, "SHA384", SHA384.Create());
DoHash(bytes, "SHA512", SHA512.Create());
}
}
The output of this program (after you replace “prediction goes here” with the actual prediction, of course) is as follows:
length 45 MD5 6D915EC203DF0C918D13B63C4FF7C1EE SHA1 49A2E2B22D27D450890E30D0A34EBA53B454925E SHA256 2C928DC82E133B0FAD5DAA64BC373BE400C700B124749072816B7053EECC9A82 SHA384 080BDBB804B8F9B28731E6E17F872C6BE6F8F08B6670CA3424726295DE58A8DE 2FE9EA43D724B7AA2ED3366CA9A80631 SHA512 D0A84D8B1B330F101D115044C9C7146605C951199BC2F036EE677C690D5151A9 3F78FDFD8E6FF147EE2DB517A96642B24ED17D2306A772B953281CB4C0BEEDF1
0 comments