Search code examples
c#.netencryptionaes

AES encrypt folder


Is it possible to encrypt a folder using AES? just like how File.Encrypt(folderName) would do..

All I found in the internet are examples with AES encrypting a file, not a folder..

thanks!


Solution

  • As folders contain a collection of files within it, i very much doubt it without converting the contents into a single file (such as a compressed archive zip/rar/7zip etc).

    If you want to provide a folder name and loop through all the files encrypting it then thats one way otherwise use a zip library to zip the contents of the folder to an archive file and encrypt that (if the zip library doesn't already include AES encryption)