views:

86

answers:

3

How do I ensure that a username/password combination is not read from memory while my application is in use.

My program is a GUI wrapper for some CYGWIN tools, including SSH and SCP. I need to ensure single sign-on capabilities to a variety of hosts.

A: 

Use a public/private key pair with authorized_keys.

Jeremy Stein
This is not a problem for asymmetric cryptography, you have to trust your self!
Rook
Since he accepted your answer, that must be what he was getting at. I knew it wasn't possible, but I thought perhaps he was just worried about protecting the PASSWORD, not access.
Jeremy Stein
+1  A: 

With the SSH key pair using ssh-agent, but is there any other way? The problem is that you need to get the public key out to the remote host, which can be done in a simple string but still requires a login. So the initial setup of the key pairs with passphrase and the adding of the key to the remote host requires many passwords to be entered. After the initial setup it all works well.

ideas?

GIDDION
@ GIDDION Please add your comment as a comment on Jeremey's response. Stackoverflow makes a distinction between answers and general comments. Where you have entered your comment that is normally reserved for answers.
Ankur
+1  A: 

An attacker will try to obtain passwords from memory using a Debugger while the application is running. The use of any encryption can be bypassed because the password must be in plain text at the time of use. Any time memory is used it can also be observed with a debugger.

The answer lies in anti-debugging: http://www.codeproject.com/KB/security/Intro_To_Win_Anti_Debug.aspx

More advanced windows Anti-Debugging:

http://www.veracode.com/blog/2008/12/anti-debugging-series-part-i/

http://www.veracode.com/blog/2008/12/anti-debugging-series-part-ii/

http://www.veracode.com/blog/2009/01/anti-debugging-series-part-iii/

http://www.veracode.com/blog/2009/02/anti-debugging-series-part-iv/

Rook