Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

Is it possible for other application running in the OS to read the keystrokes that my application uses?

What about mouse events and window handles?

Is there any security wall that the OS uses to shield my application from other potential dangerous applications that have might infiltrated into the machine?

Is there any difference between Windows in Mac in this issue?

Thank you

share|improve this question

migrated from stackoverflow.com Apr 1 '12 at 4:03

This question came from our site for professional and enthusiast programmers.

1  
these are called keyloggers i believe.. –  deathApril Mar 28 '12 at 18:15
    
Good questions, but off-topic. These would be a better fit at Security.Stackexchange.Com As a side-note, yes, there are applicaitons as well as devices that can record keystrokes. There are also tools that can record keystrokes without software just by monitoring the electromagnetic emissions from your keyboard. en.wikipedia.org/wiki/… The only way to be 100% sure your keystrokes aren't being logged is to not use a computer. –  David Stratton Mar 28 '12 at 18:16
add comment

2 Answers

up vote 0 down vote accepted

One way this can be accomplished on Windows is by installing a message hook, which would allow you to spy on the keyboard messages in flight. This may require some level of access, and, for Vista and above--it may not be possible to see messages destined for processes at a higher integrity level--I've never tried.

Another method is to poll the keyboard with GetAsyncKeyState. I don't think there are any security precautions against that, though I'm not sure if it would work when the input is going to another desktop (like the secure desktop used for UAC prompts).

Both methods are pretty easy to detect.

share|improve this answer
add comment

the windows developer tool 'spyxx' can capture all windows messages, including keystrokes and mouse events of other applications, so it is certainly possible.

It uses SetWindowsHookEx.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.