473,385 Members | 1,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Prompting for Passwords - obscuring input

hi
we are working on a program which has to read password from user
for security each character in the password must be echoed as *

1 print "enter passwd\n";
2 system('stty','-echo');
3 chop($passwd=<stdin>);
4 system('stty','echo');
5 open(myfile,'>>./c');
6 print myfile "$passwd\n";
7 close (myfile);

this is the code for hiding password completely
could u please help us with *
thanks inadvance
Jul 25 '07 #1
8 5239
miller
1,089 Expert 1GB
cpan IO::Prompt

Expand|Select|Wrap|Line Numbers
  1. use IO::Prompt;
  2.  
  3. my $passwd = prompt -echo => '*';
  4.  
- Miller
Jul 25 '07 #2
Can't locate IO/Prompt.pm in @INC (@INC contains:..................
thats the error its givin is it the prob of the perl compiler
anything tat could b done to resolve it
we r working on unix platform
Jul 25 '07 #3
numberwhun
3,509 Expert Mod 2GB
Yes, you are going to have to install the module IO::Prompt. That is the error you receive when the module you are trying to use is not installed.

ie: perl -MCPAN -e 'install IO::Prompt'

Regards,

Jeff
Jul 25 '07 #4
prn
254 Expert 100+
Can't locate IO/Prompt.pm in @INC (@INC contains:..................
thats the error its givin is it the prob of the perl compiler
anything tat could b done to resolve it
we r working on unix platform
That's because IO::Prompt is a CPAN module. It is not part of the standard Perl distro. That's why miller gave you a link. You have to install it separately.

The easiest way to install it is (preferably as root):

Expand|Select|Wrap|Line Numbers
  1. # perl -MCPAN -e shell
  2. cpan> install IO::Prompt
  3. ...
  4. cpan> quit
Assuming you have not used the CPAN module before, you will probably have to configure it. I just checked this on a Linux box where I had not used the CPAN module previously and almost all the questions in the configuration prompts were fairly obvious. It did prompt for the location of ncftpget, which I did not have installed, so I downloaded and installed it. I'm not sure that I had to, but it seemed like a good idea.

Once IO::Prompt is installed, miller's example code will work just fine.

HTH,
Paul
Jul 25 '07 #5
numberwhun
3,509 Expert Mod 2GB
That's because IO::Prompt is a CPAN module. It is not part of the standard Perl distro. That's why miller gave you a link. You have to install it separately.

The easiest way to install it is (preferably as root):

Expand|Select|Wrap|Line Numbers
  1. # perl -MCPAN -e shell
  2. cpan> install IO::Prompt
  3. ...
  4. cpan> quit
Assuming you have not used the CPAN module before, you will probably have to configure it. I just checked this on a Linux box where I had not used the CPAN module previously and almost all the questions in the configuration prompts were fairly obvious. It did prompt for the location of ncftpget, which I did not have installed, so I downloaded and installed it. I'm not sure that I had to, but it seemed like a good idea.

Once IO::Prompt is installed, miller's example code will work just fine.

HTH,
Paul
Sure, I see how you are... just step ALL over me. :-)

Jeff
Jul 25 '07 #6
miller
1,089 Expert 1GB
Some notes about IO::Prompt:
  • It is platform dependent on unix based systems as it has hardcoded access to /dev/tty
  • It's test suite is minimal, so it will install successfully under ActivePerl but will not work. I have written to the module maintainer about this issue. However, it does have a large set of examples included as part of its distribution.
  • It was suggested by the book "Perl Best Practices"; Chapter 10: I/O; Power Prompting.
- Miller
Jul 25 '07 #7
prn
254 Expert 100+
Sure, I see how you are... just step ALL over me. :-)

Jeff
Sorry, Jeff. I was composing mine when you posted. If I had seen yours first, I would have decided the question was already answered and left it alone. I'm just kind of compulsive (some people might have a different name for it ;-) ) sometimes.

Paul
Jul 26 '07 #8
numberwhun
3,509 Expert Mod 2GB
No worries! I was just busin' on ya. I chalked it up to re-enforcement of what I said. :-)

Regards,

Jeff
Jul 26 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Fred Emmott | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi - just wondering how I should store passwords in a database - I was thinking MD5 hashes would be a good idea - but I've heard it's better to...
14
by: Miranda | last post by:
Hi, I have a ASP/vbscript program that generates random passwords. The problem is I need to insert those passwords into an Access database of 327 clients. I have the random password program...
12
by: Andrew DeFaria | last post by:
I am developing a database application in which I store usernames and passwords. Naturally I want to store the passwords in an encrypted form. However, just like you see in many web applications, I...
1
by: Paradigm | last post by:
I want to store some passwords in a MySQL table. Is there any way of preventing someone using say COntrolcentre from viewing the passwords.
10
by: Dino M. Buljubasic | last post by:
Hi, I am using MD5 to hash my passwords and add them to database as hashed. I have noticed though that some passwords don't get recognized and I suppose that it happen because hashing might...
5
by: k.i.n.g. | last post by:
Hi, I have a csv file which in taken as the input file for adding users in my linux mail server with the format userid,fullname,passwword,dateofbith Now I have to write a script to generate...
19
by: Cord-Heinrich Pahlmann | last post by:
Hi, I have written a tool wich de/encrypts a few of my forum and bloggin-Passwords. My question is how secure it is. The following describes how I have encrypted my passwords. When I log in,...
1
by: jeffkatyspanky | last post by:
I am prompting for the user to enter an IP address and I can't figure out a cleaner way to re-prompt if the user enters something other than a valid IP address. I'd like to just clear the "bad" entry...
0
boxfish
by: boxfish | last post by:
Hello, I'm trying to make a kind of complicated overloaded input operator in C++, and I need to look ahead a couple of characters on the input stream, and not remove them from the stream until I know...
3
by: =?Utf-8?B?QmlsbHkgWmhhbmc=?= | last post by:
I have a asp.net page, it uses js to print in IE. It always has the prompting user window appear. I have tried: <input onclick="document.all.WebBrowser.ExecWB(6,6)" type="button"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.