How we can convert character or integer values to the password form in C++
Fri, 22/02/2013 - 13:25
Can anyone help me out on following?
How we can convert character or integer values to the password form(encrypted form) in C++?
If i put write password then insted of printing the characters, how it should be shown in the encrypted form?
Fri, 22/02/2013 - 14:12
#1
I assume you are using Windows for C++ programming
Hi Richa,
I assume you are working on Windows platform.
I am not good at C++ but I think C code would work. You can change it in C++ which should not be so tough.
Code:
Note: This code would work only on windows. In Linux conio.h is not defined and moreover there is already a function which does the same thing i.e. getpass();
Here is the reference link for the same: http://www.gnu.org/savannah-checkouts/gnu/libc/manual/html_node/getpass....
Hope this will help you
I assume you are working on Windows platform.
I am not good at C++ but I think C code would work. You can change it in C++ which should not be so tough.
Code:
#include<stdio.h> #include <conio.h> int main() { char alpha,pass[10]; int i; while( (alpha=getch())!= '\n');{ pass[i] = alpha; printf("*"); i++; } return 1; }
Note: This code would work only on windows. In Linux conio.h is not defined and moreover there is already a function which does the same thing i.e. getpass();
Here is the reference link for the same: http://www.gnu.org/savannah-checkouts/gnu/libc/manual/html_node/getpass....
Hope this will help you
Fri, 22/02/2013 - 16:08
#3
in which OS you are running
Hi Richa,
In which O.S. you are working onand can you please share your code with the output that you are getting?
What you had to show at output screen and when depends upon your code. So please paste your code here.
In which O.S. you are working onand can you please share your code with the output that you are getting?
What you had to show at output screen and when depends upon your code. So please paste your code here.
Tue, 26/02/2013 - 13:34
#4
Explaining the same thing
Explaining the same thing what you are looking for.
Check it out : http://www.cplusplus.com/articles/E6vU7k9E/
Check it out : http://www.cplusplus.com/articles/E6vU7k9E/



