Sign in to follow this  
Followers 0
KillingEye

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

7 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

@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

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thank you for your fast help :o

EDIT: It Works!!! Thank you :)

Edited by KillingEye

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

No, that was not my problem :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0