Sign in to follow this  
Followers 0
autocompiler

How to encrypt & decrypt Music Folder?

5 posts in this topic

Hello Guys here is the code,i am a newbie in autoit still learning so be patient whit me XD!!! i wanted to crypt the files inside user profile directory folders, in my case the music folder but even the picture or videos or documents,but it keeps giving me error also i wanted to do same thing for the decryption of the files please let me know what i am doing wrong!!

#include <File.au3>
#include <Crypt.au3>


$a_files = _FileListToArray(@UserProfileDir & "Music")

For $i = 1 To $a_files[0]
    $rc  = _Crypt_EncryptFile(@UserProfileDir & "Music" & $a_files[$i],@UserProfileDir & "Music" & $a_files[$i] & ".crypt", "APASSWORD", $CALG_AES_256)
    FileDelete ( "@UserProfileDir & "Music" & $a_files[$i]" )
Next

I still dont know if this script will encrypt only files or even the folders ? i wanted to encrypt everything  including the folders inside the folder music!! but also i want to be able to decrypt everything in it!!!And yes Music folder macro is not available if not the problem was solved i think!!!!

Thanks in Advance you guys for the help!!!!

Share this post


Link to post
Share on other sites



I simply want to be able to encrypt the music , pictures and  videos folder of the windows 7 and be able to decrypt them when i want..what exctly you need to understand?and what is a ransomware? anyway the code is simple and would be really handy for me to protect files and folders whit one exe!!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

You'd be better off using folder permissions and native NTFS encryption in my opinion.  Folders dont get encrypted really, just their contents.  The folder is just a container.  At best you could rename/obfuscate it or "package" the folder into an encrypted archive, but then you won't have the flexibility to access to the individual files as easily.

Your FileDelete statement is malformed (syntax) by the way.  Take due care correcting it though if you're going to keep playing with the _Crypt_EncryptFile function.

Edited by spudw2k

Share this post


Link to post
Share on other sites

Whole disk encryption like bitlocker is probably the best bet to protect a lot of files and still be able to use them regularly without a lot of time/trouble.

If you just want to block out a lot of files from access but then enable access to them later you can try NTFS but other administrators can change it, or if the disk is taken into a different OS or state that does not respect NTFS permissions it wont be protected.

Something like WinZip/WinRar/7Zip can add passwords to archives.  So you can automate packaging up the files into an archive with a password on it.  Pretty much would do exactly what you want to do, its just a lot of overhead depending on how much data your constantly packaging and then unpackaging. 

 

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