Queener Posted September 4, 2013 Share Posted September 4, 2013 (edited) I'm just doing this for fun and learning experience. This is a simple tool to encrypt and decrypt a password. If a user press Encrypt, it suppose to write the encrypted password to a txt file called Enc.txt. Same with Decrypted. The problem is It's adding text to the text file instead of wiping it then rewrite each time you press Encrypt/Decrypt. example: Instead of test when you press 2x, it would display testtest expandcollapse popupFunc _Encry() Global $file1 = Fileopen("Enc.txt", 1) if $file1 = -1 Then msgbox(0, "ERROR", "Unable to open file.") Exit EndIf while 1 Global $sPasswordCT = guictrlread($pw) Global $Jamon = '' $Jamon = _Encrypt("password", $sPasswordCT) GUICtrlSetData($hash, $Jamon) FileWrite($file1, Guictrlread($hash)) sleep(200) FileClose($file1) Return WEnd EndFunc Func _Decry() Global $file2 = FIleopen("Dec.txt", 1) If $file2 = -1 Then msgbox(0, "ERROR", "Unable to open file.") Exit EndIf while 1 Global $sPasswordCT = guictrlread($hash) Global $Jamon = '' $Jamon = _Decrypt("password", $sPasswordCT) GUICtrlSetData($pw, $Jamon) Filewrite($file2, $Jamon) sleep(200) Fileclose($file2) WEnd EndFunc Edited September 4, 2013 by asianqueen Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Link to comment Share on other sites More sharing options...
Solution Queener Posted September 4, 2013 Author Solution Share Posted September 4, 2013 I set the 1 as fileopen which I should be setting it 2 = Write mode (erase previous contents) close. Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Link to comment Share on other sites More sharing options...
Danyfirex Posted September 4, 2013 Share Posted September 4, 2013 (edited) use flag 2 Global $file1 = Fileopen("Enc.txt", 2) saludos Edited: I was slow :S lol Edited September 4, 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 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