FormsAuthentication.HashPasswordForStoringInConfigFile

  • Thread starter Thread starter Mircea Pleteriu
  • Start date Start date
M

Mircea Pleteriu

Does somebody know how
FormsAuthentication.HashPasswordForStoringInConfigFile
works inside?
 
Like this:

..method public hidebysig static string
HashPasswordForStoringInConfigFile(string password,
string
passwordFormat) cil managed
{
// Code size 133 (0x85)
.maxstack 4
.locals (uint8[] V_0)
IL_0000: ldarg.0
IL_0001: brtrue.s IL_000e
IL_0003: ldstr "password"
IL_0008: newobj instance void
[mscorlib]System.ArgumentNullException::.ctor(string)
IL_000d: throw
IL_000e: ldarg.1
IL_000f: brtrue.s IL_001c
IL_0011: ldstr "passwordFormat"
IL_0016: newobj instance void
[mscorlib]System.ArgumentNullException::.ctor(string)
IL_001b: throw
IL_001c: ldarg.1
IL_001d: ldstr "sha1"
IL_0022: ldc.i4.1
IL_0023: call class [mscorlib]System.Globalization.CultureInfo
[mscorlib]System.Globalization.CultureInfo::get_InvariantCulture()
IL_0028: call int32 [mscorlib]System.String::Compare(string,
string,
bool,
class
[mscorlib]System.Globalization.CultureInfo)
IL_002d: brtrue.s IL_0042
IL_002f: call class [mscorlib]System.Text.Encoding
[mscorlib]System.Text.Encoding::get_UTF8()
IL_0034: ldarg.0
IL_0035: callvirt instance uint8[]
[mscorlib]System.Text.Encoding::GetBytes(string)
IL_003a: call uint8[]
System.Web.Security.FormsAuthentication::GetMacFromBlob(uint8[])
IL_003f: stloc.0
IL_0040: br.s IL_007d
IL_0042: ldarg.1
IL_0043: ldstr "md5"
IL_0048: ldc.i4.1
IL_0049: call class [mscorlib]System.Globalization.CultureInfo
[mscorlib]System.Globalization.CultureInfo::get_InvariantCulture()
IL_004e: call int32 [mscorlib]System.String::Compare(string,
string,
bool,
class
[mscorlib]System.Globalization.CultureInfo)
IL_0053: brtrue.s IL_0068
IL_0055: call class [mscorlib]System.Text.Encoding
[mscorlib]System.Text.Encoding::get_UTF8()
IL_005a: ldarg.0
IL_005b: callvirt instance uint8[]
[mscorlib]System.Text.Encoding::GetBytes(string)
IL_0060: call uint8[]
System.Web.Security.FormsAuthentication::GetMD5FromBlob(uint8[])
IL_0065: stloc.0
IL_0066: br.s IL_007d
IL_0068: ldstr "InvalidArgumentValue"
IL_006d: ldstr "passwordFormat"
IL_0072: call string
System.Web.HttpRuntime::FormatResourceString(string,
string)
IL_0077: newobj instance void
[mscorlib]System.ArgumentException::.ctor(string)
IL_007c: throw
IL_007d: ldloc.0
IL_007e: ldc.i4.0
IL_007f: call string
System.Web.Configuration.MachineKey::ByteArrayToHexString(uint8[],

int32)
IL_0084: ret
} // end of method FormsAuthentication::HashPasswordForStoringInConfigFile

Nothing to it, really.

Jerry
 
Back
Top