Think about Loose Coupling | |
PerlMonks |
Re: Masking Windows Passwordsby VinsWorldcom (Prior) |
on Sep 29, 2011 at 15:09 UTC ( [id://928598]=note: print w/replies, xml ) | Need Help?? |
I'm not sure I understand the question when read with the title. If you're looking to mask the password when entered on the command line, use Term::Readkey. Your script with the Term::Readkey stuff inserted - I check to see if you have it installed first. Not sure if it is a core module. If not, then just install it, not a big deal.
The script outputs:
Notice the "Password?" prompt has no text next to it as the ReadMode(2) call turns off echo so you don't see the user typing their password. It does get saved to $pass however. But also notice the "Use of uninitialized ..." error after "CONNECT..." because we set $pass to 'undef' and then print it - just so you see it has been "erased" after using it to authenticate. Are you concerned that people will be snooping the memory of the computer you are running the script on while you're running the script - and thus need the obfuscation of the $pass variable immediately?
In Section
Seekers of Perl Wisdom
|
|