Hide User Input in FORTRAN 95: Solve Password Problem

  • Context: Fortran 
  • Thread starter Thread starter dawilso9
  • Start date Start date
  • Tags Tags
    Fortran
Click For Summary
SUMMARY

The discussion focuses on hiding user input in FORTRAN 95, specifically for password entry. Users can achieve this by calling operating system routines or utilizing a GUI library to read keystrokes without displaying them on the screen. A suggested approach involves looping to capture individual keystrokes and displaying asterisks instead of the actual characters. For enhanced security, it is recommended to use GUI routines that return an encrypted representation of the password rather than the plain text.

PREREQUISITES
  • Understanding of FORTRAN 95 programming language
  • Familiarity with operating system routines for input handling
  • Knowledge of GUI libraries and their functionalities
  • Basic concepts of encryption and secure password handling
NEXT STEPS
  • Research how to implement keystroke capture in FORTRAN using operating system calls
  • Explore GUI libraries compatible with FORTRAN for enhanced user input handling
  • Learn about encryption techniques for securely storing passwords
  • Investigate error handling in user input scenarios within FORTRAN applications
USEFUL FOR

Programmers working with FORTRAN, software developers focusing on secure user input methods, and anyone interested in enhancing the security of password handling in applications.

dawilso9
Messages
1
Reaction score
0
This might be a stupid question but my TAs in my lab could not answer it so I thought I would try to ask it here. What I want to do is for the user to enter some string of characters for something such as a password and for the input not to show up on the screen or for it to be replaced by something else so someone else cannot see what they previously entered.

Here is what I am asking:

Password: (User enters something)

What I want it to show as it is entered:

Password: (blank) or *********

I hope this is possible I have attempted to find the answer in my book and by googling it but to no avail. Thank you for any help you can provide.
 
Technology news on Phys.org
This is not part of "standard" Fortran (or any other language).

You need to call some routines that are part of your computer's operating system, or from a GUI (Graphical user interface) library, to do this.

Probably the "lowest level" way to do it would be code that does something like this:

do while (.true.)

call a routine to read a single keystroke, without the user having to press return, and without displaying anything on the screen

if the keystroke was "return", exit the loop
else store the character in a string, and display a * on the screen.
endinf
enddo

"Real" code to do this would be more complicated, because you need to handle what happens if the user pressed say a function key instread of a letter or number, what to do if the user presses the backspace key, etc, etc. A GUI library would probably include a routine that handles all this low-level stuff and just returns you the string.

Actually, in a really secure system, the GUI routine would not even return you the string that was typed, but an encrypted representation of it. You could pass the encrypted string to another routine to check if the password is valid, without your program ever being able to "see" what the real password was and "steal" it.
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
35K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 59 ·
2
Replies
59
Views
12K
  • · Replies 1 ·
Replies
1
Views
4K
Replies
13
Views
8K
Replies
6
Views
9K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K