CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
Hiding Text...

 



KaoAtlantis
Novice

Aug 29, 2000, 8:47 PM

Post #1 of 4 (3397 views)
Hiding Text... Can't Post

I have two questions...

One is when someone types something in a program, how do you mask the typing with the stars "*" or other symbols...

And if all possable does anyone know of a good site on Encripting Text in perl?

-Thanks, Kao


brian.hayes
User

Sep 14, 2000, 5:18 PM

Post #2 of 4 (3397 views)
Re: Hiding Text... [In reply to] Can't Post

I am assuming your talking about forms, so to answere that you would type something like.

the type = password will do it.

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>


<input name="userpass" type="Password">
</pre><HR></BLOCKQUOTE>

Your other question about encrytion come with perl. If you read your manual that installs with perl you will find multiple type of encrytion you can use.

MD2, MD5, etc....
Digest::MD5 - Perl interface to the MD5 Algorithm

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>



# Functional style
use Digest::MD5 qw(md5 md5_hex md5_base64);
$digest = md5($data);
$digest = md5_hex($data);
$digest = md5_base64($data);
# OO style
use Digest::MD5;
$ctx = Digest::MD5->new;
$ctx->add($data);
$ctx->addfile(*FILE);
$digest = $ctx->digest;
$digest = $ctx->hexdigest;
$digest = $ctx->b64digest;

</pre><HR></BLOCKQUOTE>


KaoAtlantis
Novice

Sep 15, 2000, 6:34 AM

Post #3 of 4 (3397 views)
Re: Hiding Text... [In reply to] Can't Post

No, I was talking about in the A Perl Program... a non-WEB Program...
<P>
-Thanks, Kao


Kanji
User

Sep 15, 2000, 9:09 AM

Post #4 of 4 (3397 views)
Re: Hiding Text... [In reply to] Can't Post

I don't remember how good Term::ReadKey works under Windows, but try ...

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

use Term::ReadKey;
ReadMode("cbreak");
my $password;
while ( my $key = ReadKey(0) ) {
last if $key eq "\n";
print "*";
$password .= $key;
}
ReadMode("normal");
print "\nYou entered $password!";</pre><HR></BLOCKQUOTE>

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives