AspCrypt using .NET framework?

H

hobbitam

Hi,

Does anyone know how to duplicate
AspCrypt's function using .NET framework?

I have an existing ASP application
that use AspCrypt to encrypt
employees' password.
Now I'm moving to ASP.NET
but need to continue using old data.
I don't know actually which encryption
algorithm AspCrypt uses.
Just know that it uses the same
algorithm as UNIX does.
I have tried MD5, DES, Rijndael
in .NET but they're all produce the result
that doesn't look like ones from AspCrypt.

I've also tried to wrap AspCrypt COM.
But face another problem.
It seems to make the other COMs stop working
once I executed AspCrypt object.
It also doesn't have dispose method
so I cannot get rid of it after use.

Any clues?

Regards,
Panya
 
P

Panya

Gaurav said:
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
 
P

Panya

I've just learned that unix password encryption
is not just a straightforward use of DES.
Actually it do DES 25 times with a blank string
using our password as encryption key,
and salt will be used to alter the key
for each iteration.
A bit complex.
Luckily I have found this article.

http://www.codeproject.com/csharp/unixcrypt.asp

And that's definitely what am I looking for.
So I think this topic can be closed now.
Thanks for your time anyway.

Regards,
Panya
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top