Jump to content

About Encryption and Descryption


Recommended Posts

I use windows xp japanese I'm trying to write encryption/descryption code.

I tried with simple encrypt function that included by default Autoit also use the encryption function that I found within this forum. I tried to encrypt password or text or date. It can encrypt but it still doesn't decrypt correctly.

Maybe it is a bug or not perform correctly on Japanese windows.

Does anyone have this problem?

Link to comment
Share on other sites

Here's a working example.

Try it as I know it works. You may need to have your input script encoded in UTF-8 with BOM to have some older calls (ANSI) work with Big5 codepages. I believe UTF-8 to be more consistent worldwide. Also be sure you're running the latest release of AutoIt.

Forget what I wrote, I was confused with another function. This version will not work with anything else than single byte ANSI. I'll look if you can do something to workaround.

Edited by jchd

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

I'd recommend switching to using the Crypt.au3 functions as these will work with plain Unicode strings. This UDF uses the Windows cryptography functions, _ways_ faster (and more robust) than AutoIt RC4 loops of String(En|De)crypt.

Look in the help file under UDF > Encryption Management. It's now 4:45 AM and I need to have some rest, sorry that I can help you more at this time.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

#include <Crypt.au3>

$Message = "Hello mrmacadamia"
$Password = "This is darkjohn20"

_Crypt_Startup()
$Key = _Crypt_DeriveKey($Password, $CALG_RC4)

$Encrypted = _Crypt_EncryptData($Message, $Key, $CALG_USERKEY)
ConsoleWrite("Encrypted: " & $Encrypted & @CRLF)

_Crypt_DestroyKey($Key)

$Decrypted = _Crypt_DecryptData($Encrypted, $Password, $CALG_RC4)
ConsoleWrite("Decrypted: " & BinaryToString($Decrypted) & @CRLF)

_Crypt_Shutdown()

Small example.

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