Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to encrypt a directory of files?

I need to programatically encrypt a directory of files, like in a .zip or whatever. Preferably password protected obviously.

How can I accomplish this, and WHAT IS the BEST encryption way to do it, if applicable?

Programming language doesn't matter. I am dictioned in all syntax.

like image 958
y2k Avatar asked Dec 07 '22 03:12

y2k


1 Answers

How can I accomplish this, and WHAT IS the BEST encryption way to do it, if applicable?

  • tar and gzip the directory.
  • Generate a random bit stream of equal size to the file
  • Run bitwise XOR on the streams

Only truly secure method is a truly random one time pad.

like image 67
zellio Avatar answered Dec 14 '22 23:12

zellio