I have a batch script with a password sitting in it as part of a command that requires credentials that I do not want to prompt for credentials. I am not worried about external threats, but I don't really want a co-worker going in there and seeing that password. While I trust them not to abuse it, I'd rather not have it there at all.
I was able to do this pretty easily with PowerShell by just storing a secure string in a text file. Pretty basic, but at least there's no plain text passwords laying around. That's all I really need.
How can I obfuscate a password in a batch script?
certutil
to hex or base64 (or both) -> ss64.com/nt/certutil.html .That's the easiest thing that comes to me right now.-encode/-decode
and-encodehex\-decodehex
options.You can also try to store the password as binary in the registry.