VB.net suggestions to avoid keyloggers spy on my textbox password? - vb.net

How it could be done?
So far i seen on Google:
Virtual keyboard
Add some events to my textbox to cancel the key event.
When key pressed record what has been pressed save and then simulate other 10 random keys?
what else can be done and not to build the whole anti-keylogger antivirus.

It can be done anything that your imagination let you:
You could tell the user to put his/her password using the key in the direction you want, for example on the right. And control the symbols with your application (with a Dictionary for example). You could show a standart keyboard picture to the user to be sure.
You could tell the user to put a letter you show to him/her every X keys pressed, or just press any key he/she wants and discard it.
You could tell the user to put a letter you show to him/her after each key of password pressed.
You could tell the user to put only the even characters of his password, and later ask for the rest.
You could tell the user to put the password backwards.
But I think a Virtual Keyboard is the best option.

Related

Check if a sequence of keys are pressed in vb.net?

Im not sure if this is possible but I am working on a small project where I would like to be able to enter in a specific sequence of keys and then something happens. Its purpose is to act as a sort of "password" to unlock additional functionality. Im thinking maybe I could store key presses in an array somehow and compare the array to another that has the same key presses in it already or something similar but im not sure on where to start.

Creating login screen in labview

I am trying to create a login screen. It takes username and password. Also, I create a text file, I write valid usernames and passwords in to the text file.
When I press the confirm button (after I enter the user name and password in to the login screen), program matches the username and password, if they are valid then led light open.
It works but when I try to press the confirm button more than 2 times, it fails. Actually not give an error but confirm button blocked so, I can not make trial more than 2. What are the possible reasons for that?
Here is the my vi:
Move all the code of the case structure inside the event case. Whenever there is a click event the code inside the case structure will be executed. Hence, there is no need to wire the Boolean from the OK button to outside the event case.
OK event:
Also, I would have a stop case with a stop button to end the while loop.
Stop event:
From your code example it looks like the first time the confirm button is pressed the case structure will run. In a While loop the user name and password are checked against the text file and if both match the LED indicator is set to true and the while loop is stopped. If either user name or password do not match the text file data then the LED will stay off and the loop would continue, blocking the confirm button from triggering again.
Looking further at the function of your code, the feedback node will retain the previous value so the second time the confirm button is pressed the username and passwords are checked from the entry following the last found entry. If the new username is before or the same then it will not be found so will enter an endless loop as in the previous case.
To resolve this you should look at:
the initialiser terminal for the feedback node is only used for the first time the vi is executed, if it is inside a loop then it will not have any effect on subsequent execution. You should remove it and modify your code to ensure the complete file is checked each time. Maybe try using a shift register terminal on the edge of the while loop and wire through to the far side of the loop.
look at the case when the username and passwords do not match to prevent an endless loop.
There is an inherent logical problem with the code that nobody has addressed yet, which is leading to the failure.
As many others have pointed out, your inner while loop is not exiting. It appears that the case statement in the inner while loop is always true, as you tied it to the Boolean constant TRUE. Your code will enter that case statement, and if either your username or password are incorrect, your AND will result in false. The indicator will not change, but you also do not stop the loop. In order to read in new values, you must stop the inner while loop.
The question seems to have been answered by other users so I just wanted to add my two cents from having just implemented something very similar myself. We needed to secure the information in the username and password file to prevent/detect tampering. Towards this end we used the built in MD5 function in labivew to create a hash of the password and then computed the hash of the user input with the hash stored in the file.
Further, to prevent people from recomputing the hash and inserting it in the file we took the row of data and computed a hash of the row elements and placed that in the file as well so the system could determine if the row hash matched and identify any tampering.
Additionally we salted our hash with a string so that even if the user knew what information was used to compute the hash they would still have to know how the string in question was salted to be able to generate the proper checksums. Perhaps this is overkill for your uses but, since the question seems to have been answered, I figured I'd throw this out for you to consider.

VB.Net how to make a Key Selection Button

Since my last post was incredibly informative, and people seemed to get the wrong idea of what I wanted to make, I figured I would do a detailed version here. In my last post, someone mentioned I should enter code, I would, I really would, issue is, I've been working on every way I can possibly think for the past day, scouring Google, writing things that make logical sense but don't, with no results, to the point that I just deleted all my code and decided to start fresh.
So here is the pseudo code of what I want to try and do.
The user has a button on their interface saying '< Click and Press >
They click the button and the button changes it's text to '< Press a Key! >'
They then push any key on the keyboard, let's use 'K' as an example, and the button then displays the Virtual Keycode of that key. That being '75' so the button would display '75'.
This then gets stored in a variable where it can later be exported to a TXT document. (I know how to do this part for the most of it.)
I hope that sort of clears up some of the confusion that happened in my last post.
A couple of pages that might help...
Control.KeyUp Event
KeyEventArgs Class

Microsoft VB.NET 2010 - Assigning a Key to start a process when the window is minimized

This is an auto talker that i created, but it isn't very convenient to click on start and stop when the text is being typed at 10 milliseconds. So i wanted to create a key that when pressed starts the auto typer, and also stops it. I have a box where the user can press a key to assign to start and stop the auto typing. What code would i put for clicking on assign? I want assign to: get key from textbox5.text and use it as the shortcut key to start spamming. The key would be pressed when the Interface for the spam bot is minimized, so i can't use "&Spambot" for S to be the shortcut key.
Any help would be appreciated.
Please click on the link below to see image
http://s16.postimg.org/6xdxtjvg5/Interface.png
I successfully used some methods to read the numkey state, started my stuff when it is turned on, and stop it when it is turned off again, maybe you will like that solution.
If Control.IsKeyLocked(Keys.NumLock) Then ...
your alternative would be to 1. use an keyDown event (i think it gave more information about pressed keys than key pressed event), then store it in a local variable
And finally using an external dll to figure out if any key is pressed anywhere in windows. And if, then compare if it is the correct key, and then trigger whatever you want to trigger.

How to give users a certain time to enter something? (VB.Net)

I'm making a speed game in VB.Net (Console Application) and users have a certain time to press a certain key. So how can I give the Console.ReadKey function a timeout without just waiting until a key was pressed?
You should use a timer. When the user selects the correct key you can disable it. If the user is to then choose a different key you can just reset it.