所以这是我当前的代码:
Local $source = "C:UsersEXAMPLEDocumentsEXAMPLE"
Local $password = "Example"
Local $array = _FileListToArrayRec($source, "*", 1, , 1, 2); LOADS ALL FILES FROM $source AS AN ARRAY
我不知道如何从那里继续,因为我想做的是获取该数组中的所有文件并对它们进行加密。但这就是另一个问题,我如何加密所有文件并将其保存在同一位置?
示例:_Crypt_EncryptFile($sSourceFile, $sDestinationFile, $vCryptKey, $iALG_ID)
获取一个文件并将未加密的版本保存到另一个位置,我如何使它用加密的版本覆盖原始文件?我在这里很困惑,在谷歌上搜索了多个主题,找不到任何对我有帮助的东西,所以我来到这里希望能找到我的答案。无论如何,提前谢谢。
#include <Crypt.au3>
#include <File.au3>
Local $sSource = "C:UsersEXAMPLEDocumentsEXAMPLE"
Local $sPassword = "Example"
Local $aArray = _FileListToArrayRec($sSource, "*", 1, 1, 1, 2); LOADS ALL FILES FROM $sSource AS AN ARRAY AND AS A FULLPATH
If Not @error Then
For $i = 1 To $aArray[0]
If Not _Crypt_EncryptFile($aArray[$i], $aArray[$i], $sPassword, $CALG_AES_256) Then
ConsoleWrite("Error: " & @error & ", " & $aArray[$i] & @CRLF)
EndIf
Next
EndIf
如果您需要AutoIt的文件加密,请考虑此处列出的解决方案
https://www.autoitscript.com/forum/topic/178131-autoit-string-files-encryption/
它对文件使用多态(随机)加密,并在AutoIt中生成文件内容加密的输出代码:
; encrypted with https://www.stringencrypt.com (v1.0.0) [AutoIt]
#include <Array.au3>
; $Label = "Fast & easy AutoIt string and file encryption."
Global $Label[47] = [ 0xC254, 0xC273, 0xC261, 0xC260, 0xC212, 0xC236, 0xC202, 0xC24B, _
0xC253, 0xC281, 0xC277, 0xC20C, 0xC22B, 0xC277, 0xC27E, 0xC27D, _
0xC21B, 0xC280, 0xC22A, 0xC281, 0xC27E, 0xC25A, 0xC237, 0xC232, _
0xC255, 0xC21C, 0xC24F, 0xC22A, 0xC24E, 0xC214, 0xC248, 0xC247, _
0xC23E, 0xC237, 0x3E0A, 0xC233, 0xC234, 0xC251, 0xC27C, 0xC227, _
0xC282, 0xC280, 0xC247, 0xC27D, 0xC224, 0xC23E, 0x3D92 ];
For $SYdIB = 0 to 46
$fWyHA = $Label[$SYdIB];
$fWyHA += $SYdIB;
$fWyHA = BitNOT($fWyHA);
$fWyHA = BitXOR($fWyHA, $SYdIB);
$fWyHA += $SYdIB;
$fWyHA -= $SYdIB;
$fWyHA = BitXOR($fWyHA, $SYdIB);
$fWyHA = $fWyHA - 1;
$fWyHA = BitXOR($fWyHA, $SYdIB);
$fWyHA = $fWyHA + 1;
$fWyHA += $SYdIB;
$fWyHA = BitXOR($fWyHA, 0xC212);
$fWyHA = BitNOT($fWyHA);
$fWyHA += $SYdIB;
$Label[$SYdIB] = ChrW(BitAND($fWyHA, 0xFFFF));
Next
$Label = _ArrayToString($Label, "")
ConsoleWrite($Label);
由于解密代码的复杂性和随机性,它也很难被脱氧器克服。