Have you looked into SRP? (srp.stanford.edu I think) It is a mutual
authentication, where one side has a password and the other side has an one-way-hash of it. The password is never sent, but from password and hash a random secret key is calculated. Success is having the same key on both sides, proven by being able to decrypt messages from the other side. If your script contains the hash and your utility contains the password no one could get the password.
Comment on Re: How to hide a password in a script?