Encrypt files in folder

Discussion related to AES Crypt, the file encryption software for Windows, Linux, Mac, and Java.
Post Reply
bstahl5012
Posts: 3
Joined: Thu Mar 01, 2018 9:07 pm

Encrypt files in folder

Post by bstahl5012 »

I'm a newby with AES Crypt....
Is is it possible and/or how would I Encrypt all files in a Folder?
And Can it be done with PowerShell or would I use a Batch?
Thanks
User avatar
paulej
Posts: 595
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: Encrypt files in folder

Post by paulej »

AES Crypt is intended to encrypt files and will not traverse directories. However, you can select all files in a folder, right-click, and select AES Encrypt to encrypt all of them using the same password. You can also search a folder for files and encrypt all of them you select.

There is a command-line tool called "aescrypt.exe" in C:\Program Files\AESCrpyt that can be used with a batch file or PowerShell script. However, you'd have to write that script, as I don't have one.
bstahl5012
Posts: 3
Joined: Thu Mar 01, 2018 9:07 pm

Re: Encrypt files in folder

Post by bstahl5012 »

Thanks for the reply. We are only going to use the Command Line function of AES Crypt since it is part of a process...

So using PowerShell do you mean something like this?

ForEach-Object {

$app = 'C:\Program Files\AESCrypt_console_v310_x64\aescrypt.exe'
$arg1 = '-e'
$arg2 = '-p password'
$arg3 = 'C:\<path to stuff to be encrypted>\Outbound_ENCRYPT\*'

& $app $arg1 $arg2 $arg3}

This works but I'm having a problem replacing "password" with a variable that I'm piping from a Password generator...
Any ideas?
User avatar
paulej
Posts: 595
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: Encrypt files in folder

Post by paulej »

Yeah, that's the idea. You could also have the encrypted file placed elsewhere using the -o flag.

I'm not a PowerShell user myself, so I can't suggest how to pass in the password. I assume you could somehow pass it as either an environment variable or as an argument to the script. I could do either of those things with a batch file, so no doubt PowerShell is equally capable of doing either.
bstahl5012
Posts: 3
Joined: Thu Mar 01, 2018 9:07 pm

Re: Encrypt files in folder

Post by bstahl5012 »

to pass the password as a variable using Argument in PowerShell to AES this worked...

$arg2 = "-p $CryptPass"
Post Reply