AlmarM Posted November 7, 2008 Share Posted November 7, 2008 (edited) Hello, a time ago I made a _StringEncrypt example for someone who had problems with passwords. I tought i'd just share it with everyone. expandcollapse popup#include <String.au3> #include <EditConstants.au3> Global $Level = 2 ;1 - 10 Global $Pass = "autoit" ;Can be anything. For more information read '_StringEncrypt()' in the Helpfile. _Check() _Password() Func _Check() If FileExists(@ScriptDir & "\Saved Password.ini") And IniRead(@ScriptDir & "\Saved Password.ini", "Password", "Pass", "Not Found") <> "Not Found" Then $GetPassword = InputBox("* Password *", "Please enter the password", "", "*", 200, 130) $Read_Pass = IniRead(@ScriptDir & "\Saved Password.ini", "Password", "Pass", "Not Found") If _StringEncrypt(0, $Read_Pass, $Pass, $Level) == $GetPassword Then MsgBox(64, "* Succes *", "Password Correct.") _Main() Else MsgBox(16, "* ERROR *", "Wrong Password!") Exit EndIf EndIf EndFunc Func _Password() $GUI = GUICreate("* Set Password*", 170, 65, -1, -1) $Label = GUICtrlCreateLabel("Password:", 10, 10) $Input = GUICtrlCreateInput("", 65, 7, 100, "", $ES_PASSWORD) $Button = GUICtrlCreateButton("Set Password!", 10, 35, 150) GUISetState() While 1 $nMsg = GUIGetMsg() Select Case $nMsg = -3 Exit Case $nMsg = $Button $ReadPassword = GUICtrlRead($Input) $Encrypt = _StringEncrypt(1, $ReadPassword, $Pass, $Level) IniWrite(@ScriptDir & "\Saved Password.ini", "Password", "Pass", $Encrypt) MsgBox(64, "* Succes *", "Password Succesfully Set!") Exit EndSelect WEnd EndFunc Func _Main() $GUI = GUICreate("* Succes *", 170, 45, -1, -1) $Label = GUICtrlCreateLabel("Hi, and Welcome!" & @CRLF & "You entered the right password!", 10, 10) GUISetState() While 1 $nMsg = GUIGetMsg() Select Case $nMsg = -3 Exit EndSelect WEnd EndFunc AlmarM Edited November 7, 2008 by AlmarM robertocm 1 Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
DarkHo Posted January 23, 2010 Share Posted January 23, 2010 nice man like it 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