Re: File encryption under PHP

From: Date: Thu, 01 Apr 2010 20:06:28 +0000
Subject: Re: File encryption under PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-303736@lists.php.net to get a copy of this message
On Thu, Apr 1, 2010 at 3:47 PM, Paul M Foster <paulf@quillandmouse.com> wrote: > Folks: > > If I wanted to encrypt a file in PHP and then write it out to disk > (one-way encryption, requiring a password), what PHP built-ins might you > recommend to encrypt the contents of the file before writing it out to > disk? > > Paul > I use the MCrypt extension to encrypt strings (login hashes in cookies, other such things). I don't see why you couldn't read the file into a string and then use mcrypt. You'd have to play with it though. Like make sure performance doesn't degrade massively for large files (rather than small strings), as well as making sure everything is binary-safe.

« previous php.general (#303736) next »