Sign in to follow this  
Followers 0
ricky

Crypt-decrypt a txt or ini file

3 posts in this topic

Hello,

y want to make a little program to crypt and decrypt by command line a txt or ini file, how can i make this one?

Thanks in advance

Share this post


Link to post
Share on other sites



Help file quote:

_StringEncrypt

--------------------------------------------------------------------------------

An RC4 based string encryption function.

#Include <String.au3>

_StringEncrypt($i_Encrypt, $s_EncryptText, $s_EncryptPassword[, $i_EncryptLevel = 1])

Parameters

$i_Encrypt 1 to encrypt, 0 to decrypt.

$s_EncryptText Text to encrypt/decrypt.

$s_EncryptPassword Password to encrypt/decrypt with.

$i_EncryptLevel Optional: Level to encrypt/decrypt. Default = 1

Return Value

Success: The Encrypted/Decrypted string.

Failure: Blank string and @error = 1


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

Check out your installation directory, and go to :

AutoIt3\Examples\GUI\Advanced\encrypt.au3

That shows you how to encrypt and decrypt strings easily.

After that, check out the AutoIt help file. It allows you to check out the different functions you'll need, such as FileOpen, FileRead, and FileClose. Your program will have to open the txt or ini file, read it as a string, encrypt the string, write it to the original file, save the key somehow (or you won't get your original data back.) Then FileClose, and so on, and so forth.

As far as command line stuff goes, you'll have to research executing programs with parameters... you'll have to do something like

myScript.exe -f"fileToBeEncrypted.ini"

Not really sure on that one, but I think it's doable.

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