Solved

Automate file compression and encryption using zip, php on Linux OS

Posted on 2007-04-03
4
365 Views
Last Modified: 2013-12-01
I want to have a script preferably php on a linux OS:

generate a random password
Zip a fixed list of files and encrypt with the above password
move the file to a specified location
generate an email with the link to the location above and ebed the password created above
send the email
create a cron job or other scheduled entry to remove the file a fixed time in the future

I can complete parts of this from my shell scripting days but I'm not sure of the most efficient way to do this in php
Your insights are greatly appreciated
0
Comment
Question by:jerrylmclaughlin
4 Comments
 
LVL 19

Accepted Solution

by:
Michael701 earned 300 total points
ID: 18847599
What version of PHP?

Take a look at the zip library.

http://www.php.net/zip

Michael
0
 

Author Comment

by:jerrylmclaughlin
ID: 18847752
PHP 4.4.6
0
 
LVL 48

Assisted Solution

by:hernst42
hernst42 earned 100 total points
ID: 18848913
AFAIK there is no php-extension lib which is capable of creating zips with passwords, so generating the zip must be done via shell. You can use php to build the password, filelists, ... and use exec to create the zip with the external program. So in php it is often easier/more readable to add the error-handling and checking than in shell-scripts. If you have a intereaction with the user php is better to use as it has a easy way to access the parameters from the script.
0
 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 100 total points
ID: 18862628
actually these are 2 script s you need: one for encryption and one for cron

> . but I'm not sure of the most efficient way to do this in php ..
I guess you better do it with a shell, or switch to a better CGI language (perl, python, java, not sure for ruby) which support libs for compression and encryption. The cron still will be a simple shell.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now