Know another language? Translate this tutorial!


1,309 visitors
13.6K page views

Diffuse text in a Textbox

Favourite 8 favourites
Tutorial written by CodeMasterMikeOriginally published on 15th, December 2011 - 3 revisions

If you have a input textbox in your application, and you dont want people around you to see it, then you can use this technique!

This technique DOES NOT encrypt the text in anyway, so this is NOT a secure way to handle sensitive information! This technique only diffuses the visible input box while keeping the orginal text inside the application for later use.

Here is a preview of how it can look like:Here is a preview of how it can look like

The basic idea of this technique, is when the text is changed inside the textbox, I store the text in a global variable and I change the text inside the textbox into a diffused text (in this example I use '*' as diffusion). So by doing it this way, I still have the orginal text inside the application, so I can use it later on, but what the user sees is only the diffused text.

Next I will break down the technique to show how it is done!


Kyatric 75.4k rep

What is the advantage of this technic compared to setting the property "Type" of the textbox to "Password" ?

Thursday, December 15, 2011 at 8:38:24 PM
CodeMasterMike 8,802 rep

Well, first of I didnt know that setting existed :P
That was the reason for I made this for myself in the first place.

I dont think it has more advantages. But it does add more customization freedom than the property setting, by letting a user to build further on this technique, or change it in some way.

Thursday, December 15, 2011 at 9:55:26 PM
DanyLdon 1,682 rep

I check that tutorial, and it works on localhost but doesn't work on server.

Tuesday, January 24, 2012 at 3:11:51 PM

Leave a comment

Everyone is welcome to leave their thoughts! Register a new account or login.