Jump to content
Sign in to follow this  
Bert

_StringEncrypt

Recommended Posts

wolf9228

#include <Array.au3>
#Include <String.au3>
FileDelete(@ScriptDir & "\win.ini")
FileDelete(@ScriptDir & "\win2.ini")

Dim $myArray[10]
$arrayitems = (UBound($myArray) - 1)
MsgBox(0,"", "array items ==>" & $arrayitems)

For $i = 1 To 10 Step 1
$section = "section" & $i
$key = "key" & $i
$Data = "Data" & $i
IniWrite(@ScriptDir & "\win.ini", $section, $key, $Data)
Next

$arrayIni = IniReadSectionNames(@ScriptDir & "\win.ini")
$arrayIni_items = $arrayIni[0]
$arrayIni_items2 = (UBound($arrayIni) - 1)


MsgBox(0,"", "arrayIni_items ==> " & $arrayIni_items & "  Or " & "arrayIni_items2 ==> " & $arrayIni_items2)

For $i = 1 To $arrayIni_items2 Step 1
MsgBox(0,"", "SectionNames ==> " & $arrayIni[$i])
Next


$i_Encrypt = 1 ;encrypt
$s_EncryptPassword = 'Password'
$i_EncryptLevel = 1

For $i = 1 To 10 Step 1
$section = "section" & $i
$key = "key" & $i
$Data = "Data" & $i
$encrypt = _StringEncrypt($i_Encrypt, $section, $s_EncryptPassword, $i_EncryptLevel)
IniWrite(@ScriptDir & "\win2.ini", $encrypt, $key, $Data )
Next

$arrayIni = IniReadSectionNames(@ScriptDir & "\win2.ini")
_ArrayDisplay( $arrayIni, "encrypt")

$i_Encrypt = 0 ;decrypt
$s_EncryptPassword = 'Password'
$i_EncryptLevel = 1

$arrayIni = IniReadSectionNames(@ScriptDir & "\win2.ini")


For $i = 1 To $arrayIni_items Step 1
$s_EncryptText = $arrayIni[$i]
$decrypt = _StringEncrypt($i_Encrypt, $s_EncryptText, $s_EncryptPassword, $i_EncryptLevel)
$arrayIni[$i] = $decrypt
Next

_ArrayDisplay( $arrayIni, "decrypt")


صرح السماء كان هنا

 

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.