Are password textboxes really secure?

by Miha Markič 22. March 2007 23:11

You know, the control on the form that displays some character over and over instead of displaying the text behind.

Let's create a simple demo. i will have a WinForms application with a single form that hosts a single TextBox. I'll set TextBox.PasswordChar to asterisk (*). That's all I need to create the demo. After running the application and typing word tubo into the text box I'll see something like this:

You would think that text is protected and nobody can get to it even if he has access to the computer, right? Wrong. Due to the nature of the Windows controls one can always inspect its properties through their handle. A nice tool that lets you do inspection like this is Spy++ that comes with Visual Studio - you'll find it in Visual Studio Tools subfolder in start menu. Run Spy++, click on Search/Find Window... menu entry. Drag the marker shown in picture bellow

over the our protected text box and this window will appear:

Text is clearly visible now. And you can even set the value and do the same with other supported properties. And of course this feature isn't limited to TextBox control.

Magic? No, just the way Windows works. Well, until now. Since Vista is introducing new UI system called WPF (which runs on Windows XP, too) I think it won't be that easy anymore to get to the control's content or even impossible due to entirely different system. I guess that makes WPF automatically more secure.

Tags:

Windows | .net

Comments (1) -

Miha Pihler
Miha Pihler
3/29/2007 5:06:10 PM #

There are many "professional" (?) tools out there that can reveal hidden fields.

One of my favorite tools for this is Cain & Able (http://www.oxid.it/cain.html).

First time I used it was when one of my customer forgot their POP3 password for their Outlook Express...

Reply

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Miha Markic

About me
Righthand
 
Microsoft MVP
 
Developer Express' DXSquad
INETA Country Leader for Slovenia
INETA Country Leader for Slovenia

Slovene Developer Users Group Lead
Friends of Red-Gate
LLBLGenPro Partner

Miha currently works as a free lance consultant and software developer specialized in .net area.
He graduated in Computer and information science at the University of Ljubljana, Slovenia. He has accumulated experience in various programming languages such as Java, Visual Basic 3-6 (MCP), Visual C++, Delphi, C# and VB.Net through years.
He has experience in practically all (technical) stages of project development, including planning, framework development, user interface, business processes, as well as testing and documenting. He has worked on big and small projects in Slovenia and abroad (e.g. participated in completing level 3 IS for the Nucor steel plant, Hertford, USA).
Currently he enjoys programming in .net environment using C#. Since 2000 he has been active in Developer Express' DX Squad and has been ECDL trainer and tester. He also gives lectures on conferences and other events in Slovenia.

Month List

Tag cloud

Most comments

Paulius Paulius
1 comments
us United States
Meh Meh
1 comments
us United States
bart dm bart dm
1 comments
nl Netherlands

RecentComments

Comment RSS