Re: AspCrypt using .NET framework?



Gaurav Vaish (www.EduJini.IN) wrote:

If it's the plain old Unix style, it should be DES.
If it's the new style with shadow, it must be MD5.
btw, what's the length of the encrypted password that you get from
AspCrypt... that may ring some bells of mine...


So I guess it should be DES.

The result from AspCrypt's been somthing like
"aa0LEL4gR0chI"
where two first charactors are password salt.

And this is the code I adapt from one I found in Google

========================
Dim inputByteArray() As Byte = _
System.Text.Encoding.Default.GetBytes(Password)
Dim des As New DESCryptoServiceProvider
des.GenerateKey()
des.GenerateIV()

Dim ms As New MemoryStream
Dim cs As New CryptoStream( _
ms, des.CreateEncryptor(), CryptoStreamMode.Write)
cs.Write(inputByteArray, 0, inputByteArray.Length)
cs.FlushFinalBlock()

Dim ret As New System.Text.StringBuilder
For Each b As Byte In ms.ToArray()
ret.AppendFormat("{0:X2}", b)
Next
Return ret.ToString()
========================

I don't really understand the code above.
I don't even know how to put "salt" in it.

The result from this function looks like
"0E16710C4E90D4C2"
So I'm not sure do I go the right way.

Thanks,
Panya

.



Relevant Pages

  • IO.Compression and Encryption Error
    ... sure you are passing in a GZip stream. ... Dim outfile, infile As FileStream ... ' Use the automatically generated key for encryption. ... Dim DES As New DESCryptoServiceProvider ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • IO.Compression and Encryption Error
    ... sure you are passing in a GZip stream. ... Dim outfile, infile As FileStream ... ' Use the automatically generated key for encryption. ... Dim DES As New DESCryptoServiceProvider ...
    (microsoft.public.dotnet.framework.windowsforms)
  • IO.Compression and Encryption
    ... sure you are passing in a GZip stream. ... Dim outfile, infile As FileStream ... ' Use the automatically generated key for encryption. ... Dim DES As New DESCryptoServiceProvider ...
    (microsoft.public.dotnet.framework)
  • Re: aspnet with DES
    ... For DES this would be a 8 byte value. ... > 'Create the file streams to handle the input and output files. ... > Dim fin As New FileStream ... > 'Read from the input file, then encrypt and write to the output file. ...
    (microsoft.public.dotnet.security)