Jump to content

[solved] Encrypt PW and write it into a.ini file


Recommended Posts

Hi,

Today another Problem...

First: I have an input like this:

$PW = GuiCtrlCreateInput("", 82, 80, 65, 18, $ES_PASSWORD)

Second: I have a Iniwrite function like this:

Case $msg = $loginsend; $loginsend is the Button zu write the password in a .ini file
       iniwrite("server.ini", "Login", "PW", guictrlread($PW))

Now what I want is, that I type in a password and the encrypted password should it write in a .ini file.

To decrypt I want to have another Script... (But that is not the problem now)

I used the search function but it did not help me...

Edited by KillingEye
Link to comment
Share on other sites

@KillingEye

#include <String.au3>
 
 $password = InputBox("Password Encryption","Enter password to encrypt","","*",200,75)
 $Encrypt = _StringEncrypt(1, $password, "password", 1);Encrypt $password with Encryption password at level 1
 MsgBox(64, "Encrypted password", $Encrypt)
 $UnEncrypt = _StringEncrypt(0, $Encrypt, "password", 1);UnEncrypt $Encrypt with Encryption password at level 1
 MsgBox(64, "Encrypted password", $UnEncrypt)

Cheers, FireFox.

Edited by FireFox
Link to comment
Share on other sites

  • Moderators

Hi,

Today another Problem...

First: I have an input like this:

$PW = GuiCtrlCreateInput("", 82, 80, 65, 18, $ES_PASSWORD)

Second: I have a Iniwrite function like this:

Case $msg = $loginsend; $loginsend is the Button zu write the password in a .ini file
       iniwrite("server.ini", "Login", "PW", guictrlread($PW))

Now what I want is, that I type in a password and the encrypted password should it write in a .ini file.

To decrypt I want to have another Script... (But that is not the problem now)

I used the search function but it did not help me...

And what exactly is the problem?
#include <EditConstants.au3>
Global $h_gui = GUICreate("")
Global $i_pw = GUICtrlCreateInput("", 10, 10, 100, 20, $ES_PASSWORD)
Global $i_login = GUICtrlCreateButton("Login", 10, 40, 75, 25)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case -3
            Exit
        Case $i_login
            MsgBox(64, "Info", GUICtrlRead($i_pw))
    EndSwitch
WEnd
Works fine.

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

  • Moderators

The Problem was that my Script was more like the encrypt.au3 samlpe...

In this sample script the encrypted text is written in the same editbox.

I did not know that it is easy like firefox's sample :)

Ahh, I misunderstood, I thought you were having an issue reading the text from the input box.

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

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...