crystalburner Posted April 5, 2006 Share Posted April 5, 2006 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 Link to comment Share on other sites More sharing options...
seandisanti Posted April 5, 2006 Share Posted April 5, 2006 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 passwordDoes anyone know how to do this to a string? And is this a good idea or does anyone have a better suggestion?CheersCit'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. Link to comment Share on other sites More sharing options...
greenmachine Posted April 5, 2006 Share Posted April 5, 2006 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. Link to comment Share on other sites More sharing options...
crystalburner Posted April 5, 2006 Author Share Posted April 5, 2006 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 ideahow about this then when i verify them say its a 7 digit p/wYour password is *******and a 3 digit passwordYour password is *** Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 5, 2006 Moderators Share Posted April 5, 2006 (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 April 5, 2006 by SmOke_N 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. Link to comment Share on other sites More sharing options...
crystalburner Posted April 5, 2006 Author Share Posted April 5, 2006 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 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 5, 2006 Moderators Share Posted April 5, 2006 (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 April 5, 2006 by SmOke_N 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. Link to comment Share on other sites More sharing options...
crystalburner Posted April 6, 2006 Author Share Posted April 6, 2006 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? Link to comment Share on other sites More sharing options...
greenmachine Posted April 6, 2006 Share Posted April 6, 2006 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. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 6, 2006 Moderators Share Posted April 6, 2006 bugger it!!no no noi cant make another guithere 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? 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. Link to comment Share on other sites More sharing options...
crystalburner Posted April 6, 2006 Author Share Posted April 6, 2006 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 behindautoit isnt that hot at deleting 1 of 3 guis properlymy codecall inputbox funcrest of my codefunc ...$3rd=guicreatemy input box codeguidelete ($3rd)returnendfunc Link to comment Share on other sites More sharing options...
greenmachine Posted April 6, 2006 Share Posted April 6, 2006 I don't see what's wrong with that. Just return the value of the input box.... Or.. make the var global. Link to comment Share on other sites More sharing options...
crystalburner Posted April 6, 2006 Author Share Posted April 6, 2006 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 upall for the sake of one @ONTOP command for the damn inputbox Link to comment Share on other sites More sharing options...
greenmachine Posted April 6, 2006 Share Posted April 6, 2006 Post your code, I bet I can figure out what's going on. Link to comment Share on other sites More sharing options...
crystalburner Posted April 6, 2006 Author Share Posted April 6, 2006 (edited) Post your code, I bet I can figure out what's going on.i cant im not allowed toall i want is an inputbox on topbut i have gui1gui2and then gui3 is the input boxwhen 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 April 8, 2006 by Larry Link to comment Share on other sites More sharing options...
greenmachine Posted April 6, 2006 Share Posted April 6, 2006 Make up an example.. if you really want to solve the issue you'll come up with something. Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 6, 2006 Share Posted April 6, 2006 i cant im not allowed tofucking autoshite Tall i want is an inputbox on topbut i have gui1gui2and then gui3 is the input boxwhen 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 workfuck itYou don't mind being an insulting little git while asking for help, do you? 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 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 6, 2006 Moderators Share Posted April 6, 2006 (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 April 6, 2006 by SmOke_N 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. Link to comment Share on other sites More sharing options...
greenmachine Posted April 6, 2006 Share Posted April 6, 2006 Gah, get rid of it! Too much effort where it doesn't belong! People need to do some shit themselves. Seriously.... Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 6, 2006 Moderators Share Posted April 6, 2006 Gah, get rid of it! Too much effort where it doesn't belong! People need to do some shit themselves. Seriously....8 mins left 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now