Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Hide password.

73 views
Skip to first unread message

Ross J. Reedstrom

unread,
Aug 14, 1997, 3:00:00 AM8/14/97
to

In article <33F325...@kodak.com>, Trac Tran <tr...@kodak.com> wrote:
>I am writing a Tcl/Tk's password screen using 1 line text entry widget
>(entry), how can I set the password to be hidden with "*"?

quoting from the entry man page (it's the _first_ option - doesn't
_anybody_ even glance at these anymore?):

WIDGET-SPECIFIC OPTIONS
Command-Line Name:-show
Database Name: show
Database Class: Show

If this option is specified, then the true contents
of the entry are not displayed in the window.
Instead, each character in the entry's value will
be displayed as the first character in the value of
this option, such as ``*''. This is useful, for
example, if the entry is to be used to enter a
password. If characters in the entry are selected
and copied elsewhere, the information copied will
be what is displayed, not the true contents of the
entry.


Ross

--
Ross J. Reedstrom, Ph.D., <r...@bioc.rice.edu> NSF Postdoctoral Fellow
W.M. Keck Center for Computational Biology
Department of Biochemistry & Cell Biology
Rice University, 6100 S. Main St., Houston, TX 77005

Trac Tran

unread,
Aug 14, 1997, 3:00:00 AM8/14/97
to

Craig Ewert

unread,
Aug 14, 1997, 3:00:00 AM8/14/97
to

Trac Tran wrote:
>
> I am writing a Tcl/Tk's password screen using 1 line text entry widget
> (entry), how can I set the password to be hidden with "*"?
Don't know, but the following causes the entry to be unseen.

entry .base -width 6 -relief sunken -textvariable base\
-background #ffffffffffff -foreground #ffffffffffff

sets both background color & foreground color to white, and nothing
shows up. Hope it helps.

JeroenHoppenbrouwers

unread,
Aug 15, 1997, 3:00:00 AM8/15/97
to

Trac Tran (tr...@kodak.com) wrote:
> I am writing a Tcl/Tk's password screen using 1 line text entry widget
> (entry), how can I set the password to be hidden with "*"?

entry .password -width 15 -show "-"

--
Jeroen Hoppenbrouwers, Senior Researcher at | Stop connecting computers;
Infolab, Tilburg University, The Netherlands | start connecting people!
http://infolabwww.kub.nl:2080/infolab/people/hoppie

Doug Hughes

unread,
Aug 15, 1997, 3:00:00 AM8/15/97
to

On Thu, 14 Aug 1997, Craig Ewert wrote:

> Trac Tran wrote:
> >
> > I am writing a Tcl/Tk's password screen using 1 line text entry widget
> > (entry), how can I set the password to be hidden with "*"?

> Don't know, but the following causes the entry to be unseen.
>
> entry .base -width 6 -relief sunken -textvariable base\
> -background #ffffffffffff -foreground #ffffffffffff
>
> sets both background color & foreground color to white, and nothing
> shows up. Hope it helps.
>
>

Yes, that's one way to do it, but innefficient, and possibly dangerous
because it's possible an option command later on could undo things.
A better approach is the -show flag to entry.
add -show {*} and it will show a star for every character typed.
I do that for our own password changing program.

____________________________________________________________________________
Doug Hughes Engineering Network Services
System/Net Admin Auburn University
do...@eng.auburn.edu


Ross J. Reedstrom

unread,
Aug 15, 1997, 3:00:00 AM8/15/97
to

Doug Hughes wrote:
>
> On Thu, 14 Aug 1997, Craig Ewert wrote:

<suggesting white on white for password hiding>

> Yes, that's one way to do it, but innefficient, and possibly dangerous
> because it's possible an option command later on could undo things.
> A better approach is the -show flag to entry.

Not only that, a quick cut&paste will get you the password!


> add -show {*} and it will show a star for every character typed.
> I do that for our own password changing program.

Much better- and takes care of the cut&paste problem

Tom Grydeland

unread,
Aug 15, 1997, 3:00:00 AM8/15/97
to

Craig Ewert <Cewe...@starnetinc.com> writes:

> Don't know, but the following causes the entry to be unseen.
>
> entry .base -width 6 -relief sunken -textvariable base\
> -background #ffffffffffff -foreground #ffffffffffff
>
> sets both background color & foreground color to white, and nothing
> shows up. Hope it helps.

No, but it's still perfectly trivial to retrieve the text via
cut'n'paste or anything that is allowed to contact your X server. It
will only thwart the random glance towards the screen.

--
//Tom Grydeland <Tom.Gr...@phys.uit.no>

tallships dot istar dot ca Hume Smith

unread,
Aug 15, 1997, 3:00:00 AM8/15/97
to

in message <nqoafij...@mitra.phys.uit.no> from comp.lang.tcl
Tom Grydeland <t...@mitra.phys.uit.no> wrote:

>Craig Ewert <Cewe...@starnetinc.com> writes:

>> entry .base -width 6 -relief sunken -textvariable base\
>> -background #ffffffffffff -foreground #ffffffffffff

>it's still perfectly trivial to retrieve the text via


>cut'n'paste or anything that is allowed to contact your X server. It
>will only thwart the random glance towards the screen.

even -show can be thwarted if send is working.

--
Hume Smith hclsmith at tallships dot istar dot ca


Will Coleda

unread,
Aug 16, 1997, 3:00:00 AM8/16/97
to tr...@kodak.com

Trac Tran wrote:
>
> I am writing a Tcl/Tk's password screen using 1 line text entry widget
> (entry), how can I set the password to be hidden with "*"?

Check the man page (unix) or the help (win) for entry, and take a look
at the -show option


--
Will Coleda http://www.coleda.com/
----------------------------------------------------------
"I was gratified to be able to answer promptly, and I did.
I said I didn't know." -- Mark Twain

Heribert Dahms

unread,
Aug 19, 1997, 3:00:00 AM8/19/97
to

In <5t226p$mep$1...@news.istar.ca> hclsmith@(tallships (Hume Smith) writes:

: even -show can be thwarted if send is working.

And even if send is disabled, a hacker need not care about output, but could
intercept keystrokes. So make access to the X-server as secure as possible.


Bye, Heribert (da...@ifk20.mach.uni-karlsruhe.de)

0 new messages