Sign in to follow this  
Followers 0
crystalburner

Password Mask

27 posts in this topic

hi,

i have a script, that asks a user to enter a username and password, and then to make sure they got it right it throws up a message box saying

"you chose username xxxx

password xxxxx "

IS THIS CORRECT?

My boss just grilled me, he said its a security problem because someone else can see over the users shoulders as it throws up the password on the screen.

I thought seeing as I still need to verify its correct, maybe I could do something like this, say the password was elephant

"you chose username crystal

password e*e*h*n* "

The string will be random lengths depending on the password

Does anyone know how to do this to a string? And is this a good idea or does anyone have a better suggestion?

Cheers

C

Share this post


Link to post
Share on other sites



hi,

i have a script, that asks a user to enter a username and password, and then to make sure they got it right it throws up a message box saying

"you chose username xxxx

password xxxxx "

IS THIS CORRECT?

My boss just grilled me, he said its a security problem because someone else can see over the users shoulders as it throws up the password on the screen.

I thought seeing as I still need to verify its correct, maybe I could do something like this, say the password was elephant

"you chose username crystal

password e*e*h*n* "

The string will be random lengths depending on the password

Does anyone know how to do this to a string? And is this a good idea or does anyone have a better suggestion?

Cheers

C

it's a bad idea. if they're just setting up accounts, an e-mail confirmation should be enough. if they're logging in, no need to display the password.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

I'd do it like most password forms do: make the user verify the password in the input below the first (and don't allow copy/paste). If they don't match, clear them both and start over.

Share this post


Link to post
Share on other sites

I'd do it like most password forms do: make the user verify the password in the input below the first (and don't allow copy/paste). If they don't match, clear them both and start over.

yeah good idea

how about this then when i verify them say its a 7 digit p/w

Your password is *******

and a 3 digit password

Your password is ***

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I agree not to show the password at all, just for them to confirm... and GUICtrlRead() can read the $ES_PASSWORD anyway, and the confirmation is just a better idea IMHO... but to answer your question... this may work:

Local $Var = 'elephant1'
Local $NewVar = ''
For $i = 1 To StringLen($Var) Step 2
    $NewVar = $NewVar & StringMid($Var, $i, 1) & '*'
    If StringLen($NewVar) > StringLen($Var) Then $NewVar = StringTrimRight($NewVar, 1)
Next

MsgBox(0, StringLen($Var), $NewVar)

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I agree not to show the password at all, just for them to confirm... and GUICtrlRead() can read the $ES_PASSWORD anyway, and the confirmation is just a better idea IMHO... but to answer your question... this may work:

Local $Var = 'elephant1'
Local $NewVar = ''
For $i = 1 To StringLen($Var) Step 2
    $NewVar = $NewVar & StringMid($Var, $i, 1) & '*'
    If StringLen($NewVar) > StringLen($Var) Then $NewVar = StringTrimRight($NewVar, 1)
Next

MsgBox(0, StringLen($Var), $NewVar)
bugger!

InputBox ( "title", "Prompt" [, "Default" [, "password char" [, Width, Height [, Left, Top [, TimeOut]]]]] )

Im using input box but it doesnt have an on top function so it falls behind the "on top" gui :)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

So make your own GUI Input box...

Edit:

For some reason, I thought you might be able to do this with one line with StringRegExpReplace(), but I can't figure it out :) ... This might make it easier for you in your coding:

Local $Var = 'elephant123titu'

MsgBox(0, 'Test', _MaskPassword($Var))

Func _MaskPassword($s_Var)
    Local $aArray = StringSplit($s_Var, ''), $aStore = ''
    For $i_Count = 1 To UBound($aArray) - 1 Step 2
        $aStore = $aStore & $aArray[$i_Count] & Chr(149)
    Next
    If StringLen($aStore) > StringLen($s_Var) Then $aStore = StringTrimRight($aStore, 1)
    Return $aStore
EndFunc
Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

So make your own GUI Input box...

Edit:

For some reason, I thought you might be able to do this with one line with StringRegExpReplace(), but I can't figure it out :) ... This might make it easier for you in your coding:

Local $Var = 'elephant123titu'

MsgBox(0, 'Test', _MaskPassword($Var))

Func _MaskPassword($s_Var)
    Local $aArray = StringSplit($s_Var, ''), $aStore = ''
    For $i_Count = 1 To UBound($aArray) - 1 Step 2
        $aStore = $aStore & $aArray[$i_Count] & Chr(149)
    Next
    If StringLen($aStore) > StringLen($s_Var) Then $aStore = StringTrimRight($aStore, 1)
    Return $aStore
EndFunc
bugger it!!

no no no

i cant make another gui

there must be a way of either

- setting the existing gui to not on top before the input box

- forcing the input box on top?

Share this post


Link to post
Share on other sites

It's really too bad InputBox doesn't have styles like MsgBox. One of the styles of MsgBox is to have it be topmost.. that would be really handy right about now.

Share this post


Link to post
Share on other sites

bugger it!!

no no no

i cant make another gui

there must be a way of either

- setting the existing gui to not on top before the input box

- forcing the input box on top?

That makes NO sense... why can't you make another GUI?

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

That makes NO sense... why can't you make another GUI?

because then i have 3 guis and when i delete the input box gui i lose the variables its created and it fuks up the other guis left behind

autoit isnt that hot at deleting 1 of 3 guis properly

my code

call inputbox func

rest of my code

func ...

$3rd=guicreate

my input box code

guidelete ($3rd)

return

endfunc

Share this post


Link to post
Share on other sites

I don't see what's wrong with that. Just return the value of the input box....

Or.. make the var global.

Share this post


Link to post
Share on other sites

I don't see what's wrong with that. Just return the value of the input box....

Or.. make the var global.

trust me its a pain in the arse, when the 3rd gui closes non of the button on the second work, it fucks the whole thing up

all for the sake of one @ONTOP command for the damn inputbox

Share this post


Link to post
Share on other sites

Post your code, I bet I can figure out what's going on.

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

Post your code, I bet I can figure out what's going on.

i cant im not allowed to

all i want is an inputbox on top

but i have gui1

gui2

and then gui3 is the input box

when the inputbox closes at the return statement it leaves gui2 on the screen where witht he inputbox statement gui2 dissapears but now it just stays and none of the controls work

Edited by Larry

Share this post


Link to post
Share on other sites

Make up an example.. if you really want to solve the issue you'll come up with something.

Share this post


Link to post
Share on other sites

i cant im not allowed to

fucking autoshite T

all i want is an inputbox on top

but i have gui1

gui2

and then gui3 is the input box

when the inputbox closes at the return statement it leaves gui2 on the screen where witht he inputbox statement gui2 dissapears but now it just stays and none of the controls work

fuck it

You don't mind being an insulting little git while asking for help, do you? :mellow:

You have had good answers based on best practices from people who have done this before. I've done the same password function myself (with friendly and patient help of people on this forum). Multiple GUIs is very doable also., and works fine with a properly coded script. So if yours are blowing up, post some sample code of your problem and I'll bet it's fixed in short order.

Till then, I hope that stress-induced ulcer is working out for you... :)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

Wow, I feel like a stupid ass, I started making an inputbox for him that had the window set on top... So since he's signed off, I'll post it for 10 or 20 mintues so others can see it ... and see if it's beneficial to them... then I'll edit it out!

Edit:

If anyone wants this... (other than the rude original poster) feel free to PM me for it... it's a custom InputBox that you can set on top, and set password chars etc... just like a normal one, but ontop option that doesn't affect the rest of your script at all.

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Gah, get rid of it! Too much effort where it doesn't belong! People need to do some shit themselves. Seriously....

Share this post


Link to post
Share on other sites

Gah, get rid of it! Too much effort where it doesn't belong! People need to do some shit themselves. Seriously....

8 mins left :)

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0