Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/02/2022 in all areas

  1. 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 Get CryptoNG from the AutoIt Downloads Area
    1 point
  2. MsgBox(0,"Exchange",$oOL_Sender.GetExchangeUser) tries to display an addressentry object. For all Exchange sender addresses $vSenderAdd is set to this addressentry and hence does not get displayed.
    1 point
  3. Have you tried this? Msgbox(0,"Variable",IsObj($vSenderAdd))
    1 point
  4. Pay particular attention to this line in the above link.
    1 point
  5. Inverted

    Virus Detection

    You have a point, but most ppl don't want to distribute their script butt-naked like that ! :-)
    1 point
  6. phillip123adams

    scramble code

    Here's a version I did a while ago. It scrambles a little differently because it starts with the last character, then the first, and so on. ;; For Testing ;$sOrig = "Apple" $sOrig = "AutoIt3 is the best!" $sScrambled = _Scramble($sOrig) $sDeScrambled = _DeScramble($sScrambled) MsgBox(4096, "test", "$sOrig = " & $sOrig &@LF& "$sScrambled = " & $sScrambled &@LF& "$sDeScrambled = " & $sDeScrambled) Exit ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Func _Scramble($sText) ;; Scramble a text string. $iLen = StringLen($sText) $Scrambled = "" For $i1 = 1 To Int($iLen / 2) $Scrambled = $Scrambled & StringMid($sText, $iLen - $i1 + 1, 1) & StringMid($sText, $i1, 1) Next; $i1 ; Pick up the odd character. If Mod($iLen, 2) Then $Scrambled = $Scrambled & StringMid($sText, $i1, 1) EndIf Return $Scrambled EndFunc ;==>_Scramble ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Func _DeScramble($sText) ;; De-Scramble a Scrambled text that was scrambled by _Scramble. Local $iLen = StringLen($sText) Local $i, $DeScrambled1, $DeScrambled2 $DeScrambled1 = "" $DeScrambled2 = "" For $i1 = 1 To $iLen step 2 $DeScrambled1 = StringMid($sText, $i1, 1) & $DeScrambled1 $DeScrambled2 = $DeScrambled2 & StringMid($sText, $i1 + 1, 1) Next; $i1 ; Pick up the odd character. If Mod($iLen, 2) Then $DeScrambled1 = StringMid($sText, $i1, 1) & $DeScrambled1 EndIf $sText = $DeScrambled2 & $DeScrambled1 Return $DeScrambled2 & $DeScrambled1 EndFunc ;==>_DeScramble
    1 point
  7. use _GUICtrlComboBoxEx_Create rather than _GUICtrlComboBox_Create to set icon's and use _GUICtrlSetFont to set font.
    0 points
  8. About set icon to combobox:
    0 points
×
×
  • Create New...