Sign in to follow this  
Followers 0
Meerecat

Folder Lock

15 posts in this topic

#1 ·  Posted (edited)

Hello

I'm new to AutoIT. Currently working on an Encryption program, but thought I would post my first attempt here.

It's basically a program to create a secure folder on your computer.

Any and all feedback welcome.

Thanks

Lee

Edited by Meerecat

Lack of planning on your part does not constitute an emergency on my part.-The biggest idiot can ask questions the smartest man cannot answer.

Share this post


Link to post
Share on other sites



Forgot to add source code.

Meerecat Folder Lock.au3


Lack of planning on your part does not constitute an emergency on my part.-The biggest idiot can ask questions the smartest man cannot answer.

Share this post


Link to post
Share on other sites

wow! Nice scripts

Share this post


Link to post
Share on other sites

Thank you. I did have help :huh2:

Any suggestions on improving it?


Lack of planning on your part does not constitute an emergency on my part.-The biggest idiot can ask questions the smartest man cannot answer.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Is there a reason why you have a 3 second Sleep in Encryption and Decryption?

Edited by guinness

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Is there a reason why you have a 3 second Sleep in Encryption and Decryption?

Yes. Before I explain my logic, please bear in mind this was my first proper script and I have no programming experience. :huh2:

The first version of the script didn't encrypt the password file. Although it is buried in the App Data directory, it was still only a plain text ini file. This kind of made the program pointless. So I added the encryption, but found each time the script tried to run it asked for a new password because it couldn't read the encrypted file.

So the point of the sleep is to give the ini file containing the password time to decrypt. Does that make sense?

I'm sure there are a million better ways of doing this, but I'm still a beginner ;)


Lack of planning on your part does not constitute an emergency on my part.-The biggest idiot can ask questions the smartest man cannot answer.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I'm still new at this as well, more often then not I have MrCreatoR pointing out how I could improve, which has always been valuable. :huh2: The thing is _Crypt_EncryptFile will complete first so Sleep is only useful for the FileDelete,, but I think 3 seconds is a little long. So as a safety measure why not use something like this? Wait for the file to exist.

Func _Encrypt()
    _Crypt_EncryptFile($INI_PASSWORD, $INI_PASSWORD_ENCRYPT, 'Password', $CALG_RC4)
    While FileExists($INI_PASSWORD) = 0
        Sleep(10) ; Smallest Sleep you can have.
    WEnd
    FileDelete($INI_PASSWORD)
EndFunc   ;==>_encrypt
Edited by guinness

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Thanks. I like that. I use this encrypted ini file function in a couple of other projects I'm working on so can include this there as well :huh2:

Thanks again, and if you have any other suggestions feel free to yell ;)


Lack of planning on your part does not constitute an emergency on my part.-The biggest idiot can ask questions the smartest man cannot answer.

Share this post


Link to post
Share on other sites

Nice try dear.Here is a tip, instead of changing the ACL (because it takes 20 secs to reset manually), try to open the handle of directory, with no share.


73 108 111 118 101 65 117 116 111 105 116

Share this post


Link to post
Share on other sites

Nice try dear.Here is a tip, instead of changing the ACL (because it takes 20 secs to reset manually), try to open the handle of directory, with no share.

Hello

I know this isn't wonderfully secure. Version 2 will encrypt the entire directory.

My logic is that this program is for people with no IT experience. Mums to protect files from the kids, that sort of thing.

But I do appreciate your point.


Lack of planning on your part does not constitute an emergency on my part.-The biggest idiot can ask questions the smartest man cannot answer.

Share this post


Link to post
Share on other sites

#11 ·  Posted

Share this post


Link to post
Share on other sites

#12 ·  Posted

you need to add /t to the cacls command to include subdirectories and files. You can still access the files through recent or filepaths.

You could also edit the registry to remove access to the folder options tab in windows explorer, and the Security tab from the properties dialogue when you lock the folder, then show them again when you unlock.

Share this post


Link to post
Share on other sites

#13 ·  Posted

Share this post


Link to post
Share on other sites

#14 ·  Posted

it will not work because Autoit design for Windows Os not for Linux


[font=verdana,geneva,sans-serif]I will do my best in this forum [/font][font=verdana,geneva,sans-serif]my code :[/font] WindowsSwitcher3d()

Share this post


Link to post
Share on other sites

#15 ·  Posted

Windows does not have resources to lock folders in linux and it does not do anything practical using autoit too.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0