How do i encrypt my password at command line
Good morning house, i'm writing an assignment that needs administrator password to login, i don't want the password to display the exact texts when typing it at command line. how can i get this done without using Jpassword?
Secondly, i want to implement something like "Press any key to continue..." in the code and don't know what to use. Thanks
Re: How do i encrypt my password at command line
If you want to use the standard command console, I'm not entirely sure that's possible (at least not without JNI).
The standard Java implementation of getting input from the command console waits until the user has pressed enter/return before sending the data to the input stream. At the same time, any typed characters immediately appear in the console.
Re: How do i encrypt my password at command line
Thank you Helloworld922,
how about pausing the program flow to wait untill a character is typed on the keyboard; to implement something like "press any key to continue..."
Re: How do i encrypt my password at command line
If you are using Scanner or whatever to read from the command prompt, I'm pretty sure that the program pauses when you are waiting for the next input with the call Scanner.getNext() or whatever. Someone will have to confirm that for me before I start giving examples and whatnot. I don't want to give incorrect information.
Re: How do i encrypt my password at command line
Re: How do i encrypt my password at command line
Reading in the next character from the console input stream will pause until the enter key is pressed, not when any key is pressed.
If it's acceptable for you to have a "press enter to continue", then Scanner.nextLine() will work for that purpose. Otherwise, it's back to JNI.