开发者

Best way to encrypt a directory of files?

开发者 https://www.devze.com 2022-12-23 16:08 出处:网络
I need to programatically encrypt a directory of files, like in a .zip or whatever.Preferably password protected obviously.

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 matte开发者_运维知识库r. I am dictioned in all syntax.


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.


I still say 7-zip is the answer. It hasn't been "cracked".


The OpenSSL library has a variety of block cipher implementations including the well-known AES. It has both a function-call interface (for use with languages like C/C++) and a program-call interface (for use in shell scripts). http://www.openssl.org/


4096-Bit (Open)PGP: 'Pretty Good' Privacy !

GnuPG is the GNU project's complete and free implementation of the OpenPGP standard as defined by RFC4880 . GnuPG allows to encrypt and sign your data and communication, features a versatile key managment system as well as access modules for all kind of public key directories. GnuPG, also known as GPG, is a command line tool with features for easy integration with other applications. A wealth of frontend applications and libraries are available. Version 2 of GnuPG also provides support for S/MIME.

libgcrypt:
http://www.gnupg.org/related_software/libraries.en.html

Edit:
BouncyCastle now has OpenPGP support.
http://www.bouncycastle.org/


Use AES. You'll find implementations in your favourite programming language by asking google for AES encryption + myfavouritelanguage.


If you're using .NET, why not use a free compression framework (http://www.icsharpcode.net/OpenSource/SharpZipLib/) that supports Encryption?

0

精彩评论

暂无评论...
验证码 换一张
取 消