PDA

View Full Version : Check User Password



KBF66
01-15-2002, 11:24 PM
I'm totally new to scripting. I would like a script that would check a user password before executing. I've searched, but haven't found anything. Help?

Thanks.

govi
01-16-2002, 08:05 PM
Where is the password stored ?
Is it in a database,file.....?????

KBF66
01-16-2002, 09:22 PM
Post deleted by KBF66

KBF66
01-16-2002, 10:54 PM
Ok, I've got something that works well, with the password stored in a registry key. But NOW I need to figure out how to "hash" the password as it's entered, otherwise it's pointless. From the things I've seen, I suspect it's not possible, but maybe someone will surprise me.

<P ID="edit"><FONT class="small">Edited by KBF66 on 01/16/02 17:37.</FONT></P>

adamdelves
01-17-2002, 01:42 PM
I know of a way of encrypting password before it is stored in the registry:

Function Change(ByVal char, _
ByVal key, ByVal strength, _
ByVal operation)

Rnd -1
Randomize key

code = Asc(char)

num = Fix(Rnd * strength) + 1

If operation = "Encrypt" Then
code = code + num
Do While code &gt; 255
code = code - 256
Loop
ElseIf operation = "Decrypt"
code = code - num
Do While code &lt; 0
code = code + 256
Loop
End If

Change = Chr(code)

End Function

This function works by morphing the character code of the character and changing it back to a chartacter again. It can work to encrypt or decrypt a character.

The encryption key is a number whioch is used when randomize is called to generate a set of renadom numbers. The strength is number the random number is multiplied by- the higher the number the harder it is to decrypt.

As long as the same encryption key and strength are used the code can be decrypted just by working backwards through the encryption proscess.

This is an ideal way of creating custom passwords but i don't think it is possible to check passwords generated by other programs.

KBF66
01-17-2002, 05:12 PM
I might be able to use that, thanks. But what I am seeking is a way to hide the password while it's being typed, by either displaying "####" or "****" in place of the characters typed by the user.

adamdelves
01-18-2002, 09:46 PM
VB Script Input Box won't do that. The only answer i have to that is to make your own active X component in Visual Basic CCE. I am currently devloping my own fully customizable input box and it does allow you to specify a password character.