Jump to content

Decoding Old StringEncrypt Strings


swoop
 Share

Recommended Posts

I have some old AutoIt code that saves the encrypted string from StringEncrypt function into the Windows registry.

But when I go to try to decrypt it using the new _Crypt_DecryptData ( $input, $base_key, $CALG_RC4 ), I cannot get the old data back out.

I've tried:

BinaryToString (_Crypt_DecryptData ( $input, $base_key, $CALG_RC4 ) )

_Crypt_DecryptData ( StringToBinary ($input), $base_key, $CALG_RC4 ) 

and different combinations, but I cannot get the original text back out.

Has anyone encountered this issue? This breaks my program when I have to use _Crypt_DecryptData instead of the old StringEncrypt. It cannot fetch the data previously stored in the Windows Registry.

Link to comment
Share on other sites

Couple of questions?

  • Have you checked the data types being handled?

Try $input = Execute($input) before passing it to _Crypt_DecryptData

  • Did you check data provided by RegRead?

Registry values can be a little tricky sometimes

  • Can you provide the exact code that you're using?

In case the above doesn't work.

Edited by rcmaehl

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

_StringEncrypt and friends were removed due to terrible bugs, so it isn't recommended for new design of course.

The _Crypt* function rely on much stronger feet but aren't anyway compatible with this "encryption". You should download an old version of AutoIt (prior to 3.3.10.0) to extract the _StringDecrypt function used at that 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

I did go back to an older version as suggested by jchd to at least fetch the data created by the old encryption.

However, this still does present a problem of my application, which I would like to compile with the latest AutoIT, but still needs to retrieve for previous users who encrypted data using the older application. I guess the only other way, if I cannot use StringEncrypt or some function that can decrypt the legacy encryption, is to write some upgrade application that will take the old data under 3.3.10.0 and save it temporarily to a text file and then encrypt it again using the latest _Crypt functions. Though this is not a very secure way to transfer the data to the new encryption format.

Link to comment
Share on other sites

Copy the old String.au3 UDF and extract the relevant function(s) then include it(them) in your application and compile using your up-to-date installation.

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

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