gahhon Posted December 30, 2018 Posted December 30, 2018 Hi guys, I am trying to modify the Folder Lock script to enhance the protection of the files. Folder Lock by Meerecat Since the script is only encrypt the password file. But also, I would like to encrypt the files within the locked folder, since I had found out that user still able to the view the contents by typing the files' name in the Search Input Box. However, I am not able to retrieve all of the files in the sub-folders and also unable to encrypt the file within the For-Each loop. Here is my modified code: Global $dir = @MyDocumentsDir & '\My Locked Folder' ... func _encrypt() Local $aFileList = _FileListToArray($dir, "*") For $vElement In $aFileList ConsoleWrite($vElement) _Crypt_EncryptFile($vElement, $vElement, 'test', $CALG_RC4) Next _Crypt_EncryptFile ($INI_PASSWORD, $INI_PASSWORD_ENCRYPT, 'test', $CALG_RC4) sleep (1000) FileDelete ($INI_PASSWORD) EndFunc ... Please noted that, My Locked Folder might have more than 1 files/folders. For example, the locked folder have 3 text files and 2 folders, console will display 5 1.txt 2.txt 3.txt folder1 folder2
Deye Posted December 30, 2018 Posted December 30, 2018 gahhon, Along with _FileListToArrayRec which allows unlimited recursion (check the help files for all options), you can encrypt all "sub" files with the "For" loop here is one example you could use Deye
gahhon Posted December 30, 2018 Author Posted December 30, 2018 4 hours ago, Deye said: gahhon, Along with _FileListToArrayRec which allows unlimited recursion (check the help files for all options), you can encrypt all "sub" files with the "For" loop here is one example you could use Deye I modified my code to FileListToArrayRec but the encryption is not working. func _encrypt() Local $aFileList = _FileListToArrayRec ($dir, "*", 1, 1, 1, 2) For $i = 1 To $aFileList[0] _Crypt_EncryptFile ($aFileList[$i], $aFileList[$i], 'test', $CALG_RC4) Next _Crypt_EncryptFile ($INI_PASSWORD, $INI_PASSWORD_ENCRYPT, 'test', $CALG_RC4) sleep (1000) FileDelete ($INI_PASSWORD) EndFunc This function will be triggered when closing the application. But the closing button is not working. Please advise.
gahhon Posted December 30, 2018 Author Posted December 30, 2018 From what I can see here why the encryption function stuck is because the file cannot be overwrite/replace. Is anyway to overwrite/replace the file?
Nine Posted December 30, 2018 Posted December 30, 2018 3 hours ago, gahhon said: Is anyway to overwrite/replace the file? #include <Crypt.au3> #include <File.au3> Opt ("MustDeclareVars", 1) Global $sSourceDir = "Test" Global $sDestDir = "CryptTest" DirRemove ($sDestDir, $DIR_REMOVE) Global $Arr = _FileListToArrayRec ($sSourceDir, "*", $FLTAR_FILES , $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_RELPATH) _ArrayDisplay ($Arr) For $i = 1 to $Arr[0] _Crypt_EncryptFile ($sSourceDir & "\" & $Arr[$i], $sDestDir & "\" & $Arr[$i], "CryptPassWord", $CALG_RC4) Next DirRemove ($sSourceDir, $DIR_REMOVE) DirMove ($sDestDir, $sSourceDir) “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
rudi Posted December 30, 2018 Posted December 30, 2018 When you want to hide content from other users, use NTFS rights managment. When you want to encrypt files to prevent revealing their content use Windows' buildin encryption mechanisms. Asking for help to recursively encrypt files as you do is stinking of RANSOMWARE! Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE!
Nine Posted December 30, 2018 Posted December 30, 2018 3 hours ago, rudi said: Asking for help to recursively encrypt files as you do is stinking of RANSOMWARE! “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
gahhon Posted December 31, 2018 Author Posted December 31, 2018 20 hours ago, Nine said: #include <Crypt.au3> #include <File.au3> Opt ("MustDeclareVars", 1) Global $sSourceDir = "Test" Global $sDestDir = "CryptTest" DirRemove ($sDestDir, $DIR_REMOVE) Global $Arr = _FileListToArrayRec ($sSourceDir, "*", $FLTAR_FILES , $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_RELPATH) _ArrayDisplay ($Arr) For $i = 1 to $Arr[0] _Crypt_EncryptFile ($sSourceDir & "\" & $Arr[$i], $sDestDir & "\" & $Arr[$i], "CryptPassWord", $CALG_RC4) Next DirRemove ($sSourceDir, $DIR_REMOVE) DirMove ($sDestDir, $sSourceDir) In this code, I don't need to delete the folder also can. I just move the encrypted files to a new destination. But what if I just want replace the files instead with same name.
Developers Jos Posted December 31, 2018 Developers Posted December 31, 2018 @gahhon, So what exactly is this topic about? What are you actually trying to do here? Jos @Everybody else: Stay out till it's cleared again. Thanks SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
caramen Posted December 31, 2018 Posted December 31, 2018 From what i understand he want to crypt and recrypt something on the same value... ? Crypt Data 1 > Send Crypted Data1 > into $Var1 Crypt Data 2 > Send Crypted Data2 > into $Var1 Or what...? My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
Developers Jos Posted December 31, 2018 Developers Posted December 31, 2018 (edited) @caramen Which part in my last post was unclear? I honestly do not care what you think.... just STAY OUT. Edited December 31, 2018 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
gahhon Posted December 31, 2018 Author Posted December 31, 2018 44 minutes ago, Jos said: @gahhon, So what exactly is this topic about? What are you actually trying to do here? Jos @Everybody else: Stay out till it's cleared again. Thanks I want encrypt the files and store them into same path and same filename as SOURCE. Many of example of Encrypt function are stored them with different path and different filename. That's why I said the keyword "REPLACE/OVERWRITE" Thanks
Developers Jos Posted December 31, 2018 Developers Posted December 31, 2018 Ok, but why do you want to do this as this type of behavior can also be used for malicious purposes, so like to understand why you want/need this? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
gahhon Posted December 31, 2018 Author Posted December 31, 2018 Because I was trying to modify the Folder Lock code from Meeracat. Once the folder is locked, you cannot view the folder and its content which is very good protection. But however, If I typed in the filename in the Search Box, it still able to view the file and the contents, so I would like to encrypt them. Folder Lock Please kindly see this post, I did comment and ask.
Developers Jos Posted December 31, 2018 Developers Posted December 31, 2018 Simply use the proper security measures in the OS in stead of all of this difficult goofing around with encrypting files. Don't you think that is much safer and less risky fucking up your own files? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
gahhon Posted December 31, 2018 Author Posted December 31, 2018 Then is there anyway to disable to find the "Locked Folder" and it contents via the Search Box?
rudi Posted December 31, 2018 Posted December 31, 2018 You still refuse to provide the information what *EXACTLY* is your goal. As mentioned above, use the regular and reliable security mechanisms of Windows itself. (NTFS rights managment, Bitlocker) Or other ready-to-take solutions like BoxCryptor, TrueCrypt, VeraCrypt and others. I suspect that you're looking for help to code something MALICIOUS, propably RANSOMWARE. Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE!
Developers Jos Posted December 31, 2018 Developers Posted December 31, 2018 @rudi, also having problems reading? Stay out! 24 minutes ago, gahhon said: Then is there anyway to disable to find the "Locked Folder" and it contents via the Search Box? So you didn't even check out the existing options. Anyway, I do not see any proper purpose for all of this and do not want to advertise AutoIt3 as an option for this type of activities. Thread is done before iam going to ban any of these impatient helpers. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Moderators JLogan3o13 Posted December 31, 2018 Moderators Posted December 31, 2018 5 hours ago, rudi said: I suspect that you're looking for help to code something MALICIOUS, propably RANSOMWARE. Rudi. It is not up to you to suspect anything - much like Caramen earlier in this thread no one on the Mod team needs (or is particularly interested in) your opinion on the matter. Please review this thread and engage the gray matter before posting next time: "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!
Recommended Posts