If you can use Tk , this will do it in a GUI. It pops the GUI, gets the user and pass, then undefines the password after it is used to authorize.
#!/usr/bin/perl use warnings; use strict; use Tk; my ($user, $password); my $mw = MainWindow->new; $mw->title("Password Entry"); $mw->withdraw; # let size be determined before centering $mw->fontCreate('big', -weight=>'bold', -size=> 14 ); my $buttom = $mw -> Button(-text => "SUBMIT", -font => 'big', -bg => 'white', -command => \&somesub) ->pack(-side => 'bottom',-anchor => 'center'); my $label = $mw -> Label(-text => "Enter User and Password", -font => 'big', -bg => 'white', )->pack(-side => 'top', -anchor => 'center'); my $label1 = $mw -> Label(-justify => 'left', -text => "User: ", -font => 'big', -bg => 'white', ) ->pack(-side => 'left', -expand => 1); my $entry = $mw -> Entry(-selectborderwidth => 10, -font => 'big', -bg => 'white', )->pack(-side => 'left', -expand => 1); ############################################################### my $label2 = $mw -> Label(-justify => 'left', -text => "Password: ", -font => 'big', -bg => 'white',) ->pack(-side => 'left', -anchor => 'n'); my $entry1 = $mw -> Entry(-selectborderwidth => 10, -show => "*", -font => 'big', -bg => 'white', )->pack(-side => 'top', -anchor => 'w'); ############################################################## # an enter in the password entry will submit $entry1->bind('<Return>',[\&somesub]); $entry->focus; center($mw); MainLoop; sub somesub { $user = $entry->get; chomp $user; $password = $entry1->get; chomp $password; #print "$user $password"; $mw -> destroy; } sub center { my $win = shift; $win->withdraw; # Hide the window while we move it about $win->update; # Make sure width and height are current # Center window my $xpos = int(($win->screenwidth - $win->width ) / 2 ); my $ypos = int(($win->screenheight - $win->height ) / 2 ); $win->geometry("+$xpos+$ypos"); $win->deiconify; # Show the window again } # now Tk is finished, you can send the $user and $password to your ser +ver # your script continues here, the prints are just for demo purposes he +re print "Hit Enter to continue and send info to server\n"; <>; # send to server or wherever print "user->$user password->$password\n"; # now undefine password $password = undef; print "Hit Enter to exit, password is undefined\n"; <>;

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

In reply to Re: Masking Windows Passwords by zentara
in thread Masking Windows Passwords by nimdokk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.