Jump to content

Recommended Posts

Hello i have a text file which contain over 600KB of BASE64 strings like :

TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

Now what i need is divide this long string as autoit variable each max lenght (4000characters per line) example:

Local $var

$var &=  TVqQAAMAAAAEAAA..

$var &=  VbAmejwqqqAACEE..

and then how to i add encrypt function on every line ? how to i can xor it? example final will be :

$var &=  XorEnc(TVqQAAMAAAAEAAA..)

$var &=  XorEncVbAmejwqqqAACEE..)

 

Thanks for any help and ideas 

Share this post


Link to post
Share on other sites
57 minutes ago, SC0U7 said:

Now what i need is divide this long string as autoit variable each max lenght (4000characters per line)

Use https://www.autoitscript.com/autoit3/docs/functions/StringMid.htm      

in a loop.

 

1 hour ago, SC0U7 said:

and then how to i add encrypt function on every line ?

Look at the https://www.autoitscript.com/autoit3/docs/libfunctions/_Crypt_EncryptData.htm

in Helpfile.

Share this post


Link to post
Share on other sites

If you want to XOR them that maybe will help you

#include <String.au3>
$data=_StringToHex("Data")
$key=_StringToHex("key")
$encrytpted=BitXOR($data, $key)
ConsoleWrite("Hex Encrypted data: " & $encrytpted & @CRLF)
ConsoleWrite("Hex Text to encrypt: " & $data & @CRLF)
ConsoleWrite("Hex Key: " & $key & @CRLF)
ConsoleWrite("Hex XOR: " & BitXOR($data, $key) & @CRLF)

But if you do that for security it's a weak  encryption that is susceptible to cryptanalysis. For better encryption I suggest you to watch that:

Thats the most used and secure encryption algorithm. Remember encryption is not only XORing data and key together but protect data and key , to avoid that someone can get them through cryptanalysis, using confusion and diffusion. I think it will help you.

Share this post


Link to post
Share on other sites
1 hour ago, Dragon_Fighter said:

But if you do that for security it's a weak  encryption that is susceptible to cryptanalysis.

I whish you good luck cryptanalysing one-time-pads.


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)

Share this post


Link to post
Share on other sites

One-time-pad is plaintext XOR full-size-key. How is that different from what you posted (except that sample key is a toy example)?


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)

Share this post


Link to post
Share on other sites

I at least had wrote a script to help SC0U7 and you start discussing without helping him. So stop discussing and try o help him without losing energy and time

Share this post


Link to post
Share on other sites

@Dragon_Fighter calm down. Sometimes a question is just a question, and not a personal affront.


"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites

well, here we like to lead people to knowledge. well, some of us believe in that. It is not always best to offer up a coded solution as the OP will usually not learn as much. You can't teach people to read by reading for them, for instance.

still, the site here is full of people who will gladly run with specs and code it up... lol

Edited by Earthshine

My resources are limited. You must ask the right questions

 

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

  • Similar Content

    • By adjist
      Hello all! 
       
      Getting this error :
      (22) : ==> Variable used without being declared.: if $vNumber = 0 Then if ^ ERROR  
      But I'm sure I have defined the variable, as in the top of my script has 
      Global $vNumber = 0  
      How would I go about fixing this?
       
    • By TheXman
      Encryption / Decryption / Hashing
      Purpose
      Cryptography API: Next Generation (CNG) is Microsoft's long-term replacement for their CryptoAPI.  CNG is designed to be extensible at many levels and cryptography agnostic in behavior.  Although the Crypt.au3 UDF that is installed with AutoIt3 still works perfectly, the advapi32.dll functions that it uses have been deprecated.  This UDF was created to offer a replacement for the deprecated functions.  According to Microsoft, deprecated functions may be removed in future release.  Therefore, this UDF will be available when/if that happens.
      Description
      This UDF implements some of Microsoft's Cryptography API: Next Generation (CNG) Win32 API functions.  In its initial release, it implements functions to encrypt text & files, decrypt text and files, generate hashes, and the Password-Based Key Derivation Function 2 (PBKDF2) function.  The UDF can implement any the encryption/decryption algorithms or hashing algorithms that are installed on the PC in which it is running.  Most, if not all, of the values that you would commonly use to specify that desired algorithms, key bit lengths, and other magic number type values, are already defined as constants or enums in the UDF file.
      To flatten the learning curve, there is an example file that shows examples of all of the major functionality.  This example file is not created to be an exhaustive set of how to implement each feature and parameter.  It is designed to give you a template or guide to help you hit the ground running in terms of using the functions.  I have tried to fully document the headers of all of the functions as well as the code within the functions themselves.
      The UDF currently has all of the same functionality as the Crypt.au3 except for the random number generation function.  I left that out of the initial version because the functionality already exists in the Crypt.au3 UDF as well as the Random() function in AutoIt3 itself.
      Current UDF Functions
      _CryptoNG_CreateRSAKeyPair($iKeyBitLength, $sPublicKeyPath, $sPrivateKeyPath, $sProvider = "Microsoft Primitive Provider") _CryptoNG_DecryptData($sAlgorithmId, $xData, $vEncryptionKey, $sProvider = "Microsoft Primitve Provider") _CryptoNG_DecryptFile($sAlgorithmId, $sInputFile, $sOutputFile, $vEncryptionKey, $sProvider = "Microsoft Primitve Provider") _CryptoNG_EncryptData($sAlgorithmId, $sText, $vEncryptionKey, $sProvider = "Microsoft Primitve Provider") _CryptoNG_EncryptFile($sAlgorithmId, $sInputFile, $sOutputFile, $vEncryptionKe, $sProvider = "Microsoft Primitve Provider") _CryptoNG_EnumAlgorithms($iAlgorithmOperations) _CryptoNG_EnumRegisteredProviders() _CryptoNG_HashData($sAlgorithmId, $vData, $bHMAC = False, $vHMACSecret = "", $sProvider = "Microsoft Primitve Provider") _CryptoNG_HashFile($sAlgorithmId, $sFilePath, $bHMAC = False, $vHMACSecret = "", $sProvider = "Microsoft Primitve Provider") _CryptoNG_LastErrorMessage() _CryptoNG_PBKDF2($sPassword, $vSalt, $iIterations, $iDKeyBitLength, $sHashAlgorithmId = $CNG_BCRYPT_SHA1_ALGORITHM, $sProvider = "Microsoft Primitve Provider") _CryptoNG_Version()  
       
      Related Links
      Cryptography API: Next Generation - Main Page
      Cryptography API: Next Generation - Reference
      Cryptography API: Next Generation - Primitives
      Cryptography API: Next Generation - Cryptographic Algorithm Providers
    • By PeterVerbeek
      This topic give you access to an AutoIt functions library I maintain which is called PAL, Peter's AutoIt Library. The latest version 1.19 contains 194 functions divided into these topics:
      window and screen mouse and GUI GUI controls logics and mathematics string, xml string and file string dialogues and progress bars data lists: lists, stacks, shift registers and key maps (a.ka. dictionaries) miscellaneous: logging/debugging, process and system info A lot of these functions were created in the development of Peace, Peter's Equalizer APO Configuration Extension, which is a user interface for the system-wide audio driver called Equalizer APO.
    • By topgundcp
      Hi, 
      This is my very first post in this forum and am also new with Autoit programming so be easy on me.
      Below is the code that I am trying to get the index of the item selected. No problem getting the text.
      Case $listEdition   ; handle of the list             local $index=0             $item=GUICTRLRead($listEdition)    ; This will return the text in the list             ; ==============   The loop below always fails  ==================             ; Meaning _GUICtrlListView_GetItemSelected($listEdition, $i) always return FALSE. WHY ???????              For $i = 0 To $editionArray[0] - 1   ; The content of the list in an array where editionArray[0] contains total count of items                 If _GUICtrlListView_GetItemSelected($listEdition, $i) Then                     $index = $i                     exitloop                 EndIf              Next              ;===================================================             ConsoleWrite( "Select Edition:     " & $item & "  index: " & $index & @CR) ....... Please look at the comments in the code & the pix attached.
      _GUICtrlListView_GetItemSelected($listEdition, $i) always returns FALSE.
      Another problem is on the list. It also populate  the total count of items from the Array. How can I skip this item from populating to the list ?.
      Please advise and thanks

    • By MarkIT
      Hi AutoIT masters,
      Good day! Sorry to have bothered this forum but we really need help. We are working on an automation project that is running on VDI server. The BOTS are in .exe are running fine until AV detected them and deleted the files. The files were re-compiled and AV kept on deleting them. The copy of the .exe BOT deleted were sent to Symantec for whitelisting. After whitelisting, it is no longer deleted but no longer working as designed (showing Line script error). We checked the scripts and there were no issues since we run it using SciTE editor and it performed the desired task. Good thing we found on this thread the solution using .a3x and the BOTS worked fine and no longer deleted. Now, the problem is they are asking why the BOTS won't run in .EXE and what is the reason behind Symantec AV deleting them. We raised a case with Symantec but they cannot provide further information as they are always seeing the file as "False Positive". We even tested with Symantec turned off and those .EXE files are working fine, however, after re-enabling, it got deleted.
      Just seeking help on how to better convince them that it is really Symantec causing the issue and the .a3x file.
×
×
  • Create New...