DavidTunnell Posted September 16, 2013 Posted September 16, 2013 I am using _StringEncrypt to decrypt a password that is used in a script with the use of a passcode: Global $IwpPassword = "D54A7D0E565AEA6251EF68376CD13577C8A89201F31D9946B5A551C9CF646506BCB0EF8BD74847433D7024C9BC80E021E835A67F4D9F2DE4ED59F8AD856A42D3" $UserPassCode = InputBox("Passcode Needed", "What is the passcode?") $IwpPassword = _StringEncrypt(0, $IwpPassword, $UserPassCode, 3) How can I provide error checking? If the user puts in the wrong passcode accoding to the documentation this should be the result: Blank string and @error = 1 But this doesn't work: If ($IwpPassword <> "") Then ;code EndIf It appears to always input some kind of string. Without defeating the purpose by checking the result against the password, how can I tell if the output is wrong and thus exit the script.
Danyfirex Posted September 16, 2013 Posted September 16, 2013 (edited) Hi, Did you try this?: If Not($IwpPassword == "") Then EndIf I really do not understand that you want to check. Edited September 16, 2013 by Danyfirex Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
michaelslamet Posted September 17, 2013 Posted September 17, 2013 Hello David, Something like this? #include<string.au3> Global $IwpPassword = "D54A7D0E565AEA6251EF68376CD13577C8A89201F31D9946B5A551C9CF646506BCB0EF8BD74847433D7024C9BC80E021E835A67F4D9F2DE4ED59F8AD856A42D3" $UserPassCode = InputBox("Passcode Needed", "What is the passcode?", "", "*") $IwpPassword = _StringEncrypt(0, $IwpPassword, $UserPassCode, 3) If StringCompare($UserPassCode, $IwpPassword, 1) <> 0 Then ; use StringCompare to check case sensitive MsgBox(0,"Incorrect","Your password is incorrect") Else MsgBox(0,"Correct","Your password is correct") EndIf
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