Jump to content

Problem with _StringEncrypt


Recommended Posts

Hello,

Sorry for my english but i am french...

How can we write in a inifile an encrypted password by an imputbox ?

#include <guiconstants.au3>
#include <string.au3>
      
GUICreate("test")
$input = GUICtrlCreateInput ( "", 10,  5, 100, 20, $ES_PASSWORD)
$EncryptButton = GuiCtrlCreateButton('Encrypt', 31, 54, 40, 40)

GUISetState () 

While 1
sleep(1)
$msg = GUIGetMsg()
       Select       
    Case $msg = $EncryptButton
           $pass = GuiCtrlRead($input)
           IniWrite("Conf.ini", "PASS", "Mot de passe", _StringEncrypt(0,$pass,"12345","2"))                
               ExitLoop
       EndSelect
Wend

that return only one strange letter...

THANKS

Link to comment
Share on other sites

0 is to decrypt

#include <guiconstants.au3>
#include <string.au3>
      
GUICreate("test")
$input = GUICtrlCreateInput ( "", 10,  5, 100, 20, $ES_PASSWORD)
$EncryptButton = GuiCtrlCreateButton('Encrypt', 31, 54, 40, 40)

GUISetState ()

While 1
sleep(1)
$msg = GUIGetMsg()
       Select        
    Case $msg = $EncryptButton
           $pass = GuiCtrlRead($input)
           ;IniWrite("Conf.ini", "PASS", "Mot de passe", _StringEncrypt(1,$pass,"12345","2"))  
           $encypt = _StringEncrypt(1,$pass,"12345","2")
            MsgBox(0x0,"encypted", $encypt)
            $dencypt = _StringEncrypt(0,$encypt,"12345","2")
            MsgBox(0x0,"encypted", $dencypt)
               ExitLoop
       EndSelect
Wend

8)

NEWHeader1.png

Link to comment
Share on other sites

  • Developers

change this line:

IniWrite("Conf.ini", "PASS", "Mot de passe", _StringEncrypt(1, $pass, "12345", 2))

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...