Solved

Password TextBox control in .NET

Posted on 2015-02-23
2
91 Views
Last Modified: 2015-03-15
What is the proper way to create a password textbox control that is masked with bullet points.

Currently, I created a textbox control, and set itsHtmlTextWriterAttribute.Type property to "password".
writer.AddAttribute(HtmlTextWriterAttribute.Type, "password", true);
writer.AddAttribute(HtmlTextWriterAttribute.Value, text, true);

Everything looks great, except that when you right click on the page and "view source" it actually shows the password in plain text.

REQUIREMENT:
For example, the current password in the textbox is "Apple" and is masked.

If the user goes in and deletes the last letter and replaces it with "a", the new password needs to be "Appla". So in other words, the characters need to be real.

How do I achieve this without the password showing up in "view source"?
0
Comment
Question by:pzozulka
2 Comments
 
LVL 9

Accepted Solution

by:
Valliappan AN earned 250 total points
ID: 40626689
I think the prefilled password, shows in view source, no matter, do you really need to prefill the password, I believe you do an edit data here. The purpose View Source is to avoid someone else peeking in to view the password.

An alternative would be to get Old and New Passwords, and update it, if they want to update password. It appears not an easy way to hide the prepopulated HTML code, in View Source.

HTH.
0
 
LVL 17

Assisted Solution

by:OriNetworks
OriNetworks earned 250 total points
ID: 40627202
It is generally a bad security practice to be able to send the password back to a user and should normally only be stored in a hashed or encrypted form. In this case you are sending the password to the client so they can see it. If someone wants to see it, they will find a way to see it, there is no way around this with this method.

If you need to store this value for some kind of authentication later, you may have the option of storing in some kind of session information or a temporary database location but please do not store a plaintext or easily reversible password.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now