Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Password as a argument

Posted on 2003-03-05
5
Medium Priority
?
309 Views
Last Modified: 2010-04-17
Dear all,
I am developing a console based application and it requires a password validation entry field. I want that password should not be printed in screen (rather some character should be displayed instead)
eg.
We have to pass the password as an argument in the following format:
c:\myexe  ps = ****** and then enter
where
myexe   is first argument ( name of my application)
ps=       is the second argument
the third argument is password AND THIS SHOULD BE IN CODED FORM eg. ********


Please comment!
0
Comment
Question by:replylalit
4 Comments
 

Accepted Solution

by:
ZalexZ earned 100 total points
ID: 8070825
Do you want to start your exe from a batch??
I don't think its possible to hide chars in bat-files!

If you start your exe manually read the pwd extra:
C:\myexe
Please enter pwd:
Then you read every char with getch set cursor one pos back and write a *!

Regards
AZ
0
 
LVL 1

Expert Comment

by:spiritwithin
ID: 8070857
As far as i understood this correctly, you want to pass a password to an application by command line, without actually writing? That is not possible.

You can either encrypt the command line string or store the password encrypted in a temporary file.

Cheers.
0
 
LVL 1

Assisted Solution

by:sarda_ramesh
sarda_ramesh earned 100 total points
ID: 8071843
no the way u want it is not possibe .. because at commant prompt the commands we are giving are given to the shell and we cant change the shell like that .. as mentioned by ZalexZ u have to read the password like

enter ur passwd: ******

if u dont want to change the current exe u can write another program from where u can call ur exe .. the skelaton of the program will be like this ..

1. u will read the password (using getch() for example , so that the char u entered r not echoed and u can show * in place of them)

2. then u will call ur main exe like ..

strcpy(str,"myexe ");
strcat(str,password);

system(str);

hope it works

regards
ramesh
0
 

Expert Comment

by:CleanupPing
ID: 9447355
replylalit:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
Six Sigma Control Plans
Progress

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question