Sie sind auf Seite 1von 2

using System; using System.Text; using System.Security.

Cryptography;

class md5demo { static void Main(string[] args { string plain! hashed;

plain " #secret$ord#; hashed " M%5(plain ;

Console.&rite'ine(#plain version is #(plain ; Console.&rite'ine(#hashed version is #(hashed ; )

pu*lic static string M%5(string pass$ord { *yte[] text+ytes " System.Text.,ncoding.%e-ault..et+ytes(pass$ord ; try { System.Security.Cryptography.M%5CryptoService/rovider crypt0andler; crypt0andler " ne$ System.Security.Cryptography.M%5CryptoService/rovider( ; *yte[] hash " crypt0andler.Compute0ash (text+ytes ; string ret " ##; -oreach (*yte a in hash { i- (a123

ret (" #4# ( a.ToString (#x# ; else ret (" a.ToString (#x# ; ) return ret ; ) catch { thro$; ) ) )

Das könnte Ihnen auch gefallen