password encryption

This is a discussion on password encryption within the C++ Programming forums, part of the General Programming Boards category; OK I am trying to make a program to type in a password... however when the password is typed in ...

  1. #1
    quicksilver9531
    Guest

    password encryption

    OK I am trying to make a program to type in a password... however when the password is typed in i do not want the user to see what they are typeing... I dont want the little ****'s either i just want the input field to remain blank.. is there anyway to do this? please help me out.. my email is pak8484@hotmail.com

  2. #2
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,220
    This is actually quite difficult. It involves making your own function to get input one character at a time and you also have to consider things like backspaces, the arrow keys, and the del key.

    Why should we email you? There's an option so that if anyone replies to your post you get notified by email.

  3. #3
    Unregistered
    Guest
    I'm assuming you're writing a console app.

    #include <conio.h>

    in that header are some useful functions for what you want to do.
    getch() reads a key pressed. you can use that to intercept a keypress and write whatever character you want in its place (using putch()).

    Look thru the header at the functions. It's not too difficult.

    ...
    char ch = getch();
    passStr[index++] = ch;
    putch('*');
    ...

    HTH

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Exception of file encryption using c#
    By shu_fei86 in forum C# Programming
    Replies: 11
    Last Post: 12-27-2008, 11:17 AM
  2. Character Tables ( Password Encryption )
    By Necrofear in forum C++ Programming
    Replies: 26
    Last Post: 11-14-2006, 11:54 AM
  3. [Q]Hide Password
    By Yuri in forum C++ Programming
    Replies: 14
    Last Post: 03-02-2006, 02:42 AM
  4. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM
  5. written command line password generator
    By lepricaun in forum C Programming
    Replies: 15
    Last Post: 08-17-2004, 08:42 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21