p-rposters
10-20-2007, 08:36 PM
I'm using AMS6 and want to have password authenticate on open.
I have successfully used the following code on my opening page (in the page on show script)
-------------
--assume the user enters a bad password
correct_password = false;
-- the 'correct' password
real_passwords = {"123", "3333", "aa"};
-- prompt the user to enter a password
user_password = Dialog.PasswordInput("Password", "Please enter the password: ", MB_ICONQUESTION);
-- compare the user's password to the 'correct' password.
for j in real_passwords do
if real_passwords[j] == user_password then
correct_password = true;
end
end
--if the password was bad, exit
if not correct_password then
Application.Exit();
end
-------------
What I'd like to do is have up to 100 md5 hash passwords instead of regular passwords. As I understand it, this is better for security since the passwords are not visible in the code.
How would I go about doing this? I do not need to have a username... just an 8-digit password (that I will convert to md5).
I have successfully used the following code on my opening page (in the page on show script)
-------------
--assume the user enters a bad password
correct_password = false;
-- the 'correct' password
real_passwords = {"123", "3333", "aa"};
-- prompt the user to enter a password
user_password = Dialog.PasswordInput("Password", "Please enter the password: ", MB_ICONQUESTION);
-- compare the user's password to the 'correct' password.
for j in real_passwords do
if real_passwords[j] == user_password then
correct_password = true;
end
end
--if the password was bad, exit
if not correct_password then
Application.Exit();
end
-------------
What I'd like to do is have up to 100 md5 hash passwords instead of regular passwords. As I understand it, this is better for security since the passwords are not visible in the code.
How would I go about doing this? I do not need to have a username... just an 8-digit password (that I will convert to md5).