Jump to content

Recommended Posts

Posted

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

  1. 5
  2. 1.txt
  3. 2.txt
  4. 3.txt
  5. folder1
  6. folder2
Posted
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.

Posted

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?

Posted
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)

 

Posted

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!

Posted
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.

Posted

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 - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Posted
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

 

Posted

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
Posted

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.
  :)

Posted

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
Posted

@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.
  :)

  • Jos locked this topic
  • Moderators
Posted
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!

Guest
This topic is now closed to further replies.
×
×
  • Create New...