Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/26/2021 in all areas

  1. Looking back at the initial problem posted by the OP, I don’t think it takes much more than: Func main() Local $var1, $var2 web_extraction($var1, $var2) StringStripWS($var1, 3) EndFunc Func web_extraction(ByRef $var1, ByRef $var2) $var1 = "extracted info 1" $var2 = "extracted info 2" EndFunc
    2 points
  2. Version v2.2.0

    1,420 downloads

    Encryption / Decryption / Hashing / Signing Purpose Cryptography API: Next Generation (CNG) is Microsoft's long-term replacement for their CryptoAPI. Microsoft's CNG is designed to be extensible at many levels and cryptography agnostic in behavior. Although the Crypt.au3 UDF lib that is installed with AutoIt3 still works well, the advapi32.dll functions that it uses have been deprecated. In addition the Crypt.au3 UDF lib, as it is currently written, has a very limited ability to decrypt AES data that was not encrypted using Crypt.au3 functions. That is because Crypt.au3 functions do not allow you to specify an actual key or initialization vector (IV). It only lets you specify data to be used to derive a key and uses a static IV. This UDF was created to offer a replacement for the deprecated functions used by Crypt.au3. According to Microsoft, deprecated functions may be removed in future release. It was also created to allow more flexibility and functionality in encryption/decryption/hashing/signing and to expand the ability for users to implement cryptography in their scripts. Description This UDF implements some of Microsoft's Cryptography API: Next Generation (CNG) Win32 API functions. It implements functions to encrypt/decrypt text and files, generate hashes, derive keys using Password-Based Key Derivation Function 2 (PBKDF2), create and verify signatures, and has several cryptography-related helper functions. The UDF can implement any encryption/decryption algorithms and hashing algorithms that are supported by the installed cryptography providers on the PC in which it is running. Most, if not all, of the "magic number" 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. As of v1.4.0, there is also a Help file that includes all of the functions, with examples. Current UDF Functions Algorithm-Specific Symmetric Encryption/Decryption Functions _CryptoNG_AES_CBC_EncryptData _CryptoNG_AES_CBC_DecryptData _CryptoNG_AES_CBC_EncryptFile _CryptoNG_AES_CBC_DecryptFile _CryptoNG_AES_ECB_EncryptData _CryptoNG_AES_ECB_DecryptData _CryptoNG_AES_GCM_EncryptData _CryptoNG_AES_GCM_DecryptData _CryptoNG_3DES_CBC_EncryptData _CryptoNG_3DES_CBC_DecryptData _CryptoNG_3DES_CBC_EncryptFile _CryptoNG_3DES_CBC_DecryptFile Generic Symmetric Encryption/Decryption Functions _CryptoNG_EncryptData _CryptoNG_DecryptData _CryptoNG_EncryptFile _CryptoNG_DecryptFile Hashing Functions _CryptoNG_HashData _CryptoNG_HashFile _CryptoNG_PBKDF2 Asymmetric (Public/Private Key) Cryptography Functions _CryptoNG_ECDSA_CreateKeyPair _CryptoNG_ECDSA_SignHash _CryptoNG_ECDSA_VerifySignature _CryptoNG_RSA_CreateKeyPair _CryptoNG_RSA_EncryptData _CryptoNG_RSA_DecryptData _CryptoNG_RSA_SignHash _CryptoNG_RSA_VerifySignature Misc / Helper Functions _CryptoNG_CryptBinaryToString _CryptoNG_CryptStringToBinary _CryptoNG_GenerateRandom _CryptoNG_EnumAlgorithms _CryptoNG_EnumRegisteredProviders _CryptoNG_EnumKeyStorageProviders _CryptoNG_LastErrorMessage _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
    1 point
  3. @Danyfirex Interesting way of using static _ClassTest() Func _ClassTest() _1() _2() _3() EndFunc ;==>_Test Func _1() ConsoleWrite("Creating new class myclass" & @CRLF) _MyClass("Hello World") EndFunc ;==>_1 Func _2() ConsoleWrite("_2 MyData Value: " & _MyClass("Property2") & @CRLF) ;~ _MyData("") ;Clear _MyClass("Property2",_MyClass("Property2") & " - AutoIt Rocks!!!") ;Append Data EndFunc ;==>_2 Func _3() ConsoleWrite("_3 MyClass data: " & _MyClass() & @CRLF) _MyClass("ha") EndFunc ;==>_2 func ha() consolewrite("Hello AutoIt") endfunc Func _MyClass($propName = Default, $propData=Default) Local Static $Property1 = " a " Local Static $Property2 = " b " Local Static $Property3 = " c " Local Static $Property4 = " d " local static $method1 = ha() If @NumParams = 0 Then Return "{" & $property1 & ";" & $property2 & ";" & $property3 & ";" & $property4 & "}" if @NumParams = 1 then if isdeclared($propname) then return eval($propName) Else $property1=$propname EndIf EndIf If @NumParams = 2 then if isdeclared($propname) then assign($propname,$propdata) endif EndIf EndFunc ;==>_MyClass
    1 point
  4. Hello, Maybe this: _Test() Func _Test() _1() _2() _3() EndFunc ;==>_Test Func _1() ConsoleWrite("_1 Set MyData To 'Hello World'" & @CRLF) _MyData("Hello World") EndFunc ;==>_1 Func _2() ConsoleWrite("_2 MyData Value: " & _MyData() & @CRLF) ;~ _MyData("") ;Clear _MyData(_MyData() & " - AutoIt Rocks!!!") ;Append Data EndFunc ;==>_2 Func _3() ConsoleWrite("_3 MyData Value: " & _MyData() & @CRLF) EndFunc ;==>_2 Func _MyData($Data = Default) Local Static $MyData = "" If @NumParams = 0 Then Return $MyData $MyData = $Data EndFunc ;==>_MyData Saludos
    1 point
×
×
  • Create New...