I was just reading this article http://www.eweek.com/article2/0,1759,1859751,00.asp explaining that MD5 is now bad because of collisions and stuff, so ive had another look at my hasher and added a few extras.
I was just reading this article http://www.eweek.com/article2/0,1759,1859751,00.asp explaining that MD5 is now bad because of collisions and stuff, so ive had another look at my hasher and added a few extras.
I just found out about this:
Put ‘Failure’ into Google and type ‘I’m feeling Lucky’
This is what I get (it might have changed):
http://www.whitehouse.gov/president/gwbbio.html
I found this just then, it combines the amazon web service and flash.
http://amaztype.tha.jp/US/Books/Title?q=batman
it generates the word at the of the url using images from that topic!
http://cpbotha.net/vtkFlRenderWindowInteractor.html
This has just saved me a ton of time… or has it just highlighted the fact that it works and I shouldn’t have wasted about 5hrs trying to get vtkFLTK to work and used it in the first place??!?!?!?!
I made a simple MD5 hasher today, I needed to check some hashes so I thought this might be handy.
The code is extremely simple, so here it is:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Security.Cryptography;
using System.Text;
namespace hasher
{
///
/// Summary description for Form1.
///
public class hash : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox txt_data;
private System.Windows.Forms.Label lbl_hash;
private System.Windows.Forms.GroupBox grp_hash;
private MD5 md5;
private UTF8Encoding ue;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public hash()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
md5 = new MD5CryptoServiceProvider();
ue = new System.Text.UTF8Encoding();
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.txt_data = new System.Windows.Forms.TextBox();
this.lbl_hash = new System.Windows.Forms.Label();
this.grp_hash = new System.Windows.Forms.GroupBox();
this.grp_hash.SuspendLayout();
this.SuspendLayout();
//
// txt_data
//
this.txt_data.Location = new System.Drawing.Point(8, 8);
this.txt_data.Multiline = true;
this.txt_data.Name = "txt_data";
this.txt_data.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txt_data.Size = new System.Drawing.Size(272, 112);
this.txt_data.TabIndex = 0;
this.txt_data.Text = "";
this.txt_data.TextChanged += new System.EventHandler(this.txt_data_TextChanged);
//
// lbl_hash
//
this.lbl_hash.Location = new System.Drawing.Point(8, 16);
this.lbl_hash.Name = "lbl_hash";
this.lbl_hash.Size = new System.Drawing.Size(256, 23);
this.lbl_hash.TabIndex = 1;
//
// grp_hash
//
this.grp_hash.Controls.Add(this.lbl_hash);
this.grp_hash.Location = new System.Drawing.Point(8, 128);
this.grp_hash.Name = "grp_hash";
this.grp_hash.Size = new System.Drawing.Size(272, 40);
this.grp_hash.TabIndex = 2;
this.grp_hash.TabStop = false;
this.grp_hash.Text = "MD5";
//
// hash
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 173);
this.Controls.Add(this.grp_hash);
this.Controls.Add(this.txt_data);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "hash";
this.Text = "MD5 Hasher";
this.grp_hash.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new hash());
}
private void txt_data_TextChanged(object sender, System.EventArgs e)
{
byte[] b = ue.GetBytes(txt_data.Text);
lbl_hash.Text = Convert.ToBase64String(md5.ComputeHash(b));
}
}
}