Page 1 of 1

simple encrypt/decrypt

Posted: Fri May 14, 2010 4:03 am
by comm
Hello!
I was wondering if there is any simple encrypt/decrypt module in PHP
Actually I wanted to have few simple features:
- encrypt/decrypt few files/directories in one package
- decrypt one selected file from package
- browse files in package

It reminds me Archives in windows where you can encrypt archive
But in Linux as I known you cant do that

I was using tar with gpg but this is wasn't to comfortable
because gpg doesn't support browse and decrypt only one item from many

Encrypt can be very simple and weak
Thanks

Re: simple encrypt/decrypt

Posted: Fri May 14, 2010 6:04 am
by Apollo
Storing multiple files into one archive, and encrypting data, are two completely different tasks.
Sure, they're typically combined when creating protected archives, but from PHP's point of view, are you sure you need it both together?

Besides, exactly what do you mean with 'browse files in package' when you are looking for a PHP module?

Anyway, you may wanna take a look at PHP's mcrypt functions and the ZipArchive class.

By the way, of course there are tons of programs that can do this in Linux as well, including free and open source solutions like 7-zip or PeaZip.

Re: simple encrypt/decrypt

Posted: Fri May 14, 2010 8:58 am
by comm
fortunately ZipArchive doest support encrypting

"browse in the package"
It is feature that helps me get list of files in the package and decrypt only few of them

Re: simple encrypt/decrypt

Posted: Fri May 14, 2010 1:50 pm
by Weirdan
comm wrote:fortunately ZipArchive doest support encrypting

"browse in the package"
It is feature that helps me get list of files in the package and decrypt only few of them
And what prevents you from encrypting files individually before putting them to zip archive? This would allow to list contents and extract individual files (you will need to decrypt the after extraction).

Re: simple encrypt/decrypt

Posted: Sun May 16, 2010 1:04 pm
by kaisellgren
I think he wants to encrypt the contents based on the official Zip format/standard. That is, you could extract the archive using your desktop application by providing the password, which PHP used to encrypt the archive.