i just made an app that makes the password you type in the dialog box to a hash string
set myPass1 to text returned of (display dialog "Type in your password" default answer "" default button 1 buttons {"Cancel", "Next"} with title "Password Encrypter" with hidden answer)
tell application "Terminal"
activate
{visible:false}
set myPass2 to word 4 of (do shell script "md5 -s" & myPass1)
display dialog "Your Encrypted Password: " default answer "" & myPass2 buttons {"Cancel", "Ok"} default button 1 with icon note with title "Password Encrypter"
end tell
Model: Macbook Pro
AppleScript: Version 2.3 (118)
Browser: Firefox 9.0.1
Operating System: Mac OS X (10.6)
Neat. The script needs a space after the -s in the shell script, and shell scripts don’t need the terminal to run, so the script below is a compressed version of yours with the “Next” and “OK” buttons made the defaults. I also added a bit so you could copy the result to the clipboard for use elsewhere.
set myPass1 to text returned of (display dialog "Type in your password" default answer "" default button 2 buttons {"Cancel", "Next"} with title "Password Encrypter" with hidden answer)
set myPass2 to word 4 of (do shell script "md5 -s " & myPass1)
set B to button returned of (display dialog "Your Encrypted Password: " & return & return & myPass2 buttons {"To Clipboard", "Ok"} default button 2 with title "Password Encrypter")
if B is "To Clipboard" then set the clipboard to myPass2
I assume you would then copy the encrypted password and change the password to some account to match. Then you could write a script to use this one to accept a plain text password and use the encrypted version instead.
set x to do shell script "md5 -q -s " & quoted form of “it’s”
You’ll see that with quoted form I can make an md5 hash of a string with special characters, your will throw an error. Then I use -q as an option so I don’t need the word 4 command.
An improved version of Adam’s script will be
set myPass1 to text returned of (display dialog "Type in your password" default answer "" default button 1 buttons {"Cancel", "Next"} with title "Password Encrypter" with hidden answer)
set myPass2 to (do shell script "md5 -q -s " & quoted form of myPass1)
set B to button returned of (display dialog "Your Encrypted Password: " & return & return & myPass2 buttons {"To Clipboard", "Ok"} default button 2 with title "Password Encrypter")
if B is "To Clipboard" then set the clipboard to myPass2