My Photos

www.flickr.com
This is a Flickr badge showing public photos and videos from coogle. Make your own badge here.

Quicksearch

BLENC 1.0 Alpha Released!

Thursday, June 3. 2004

Back in Vancouver I first brought up the usefulness of a PHP extension which ran encrypted PHP scripts transparently as part of what was then called the philter extension. Since then, I have moved away from the philter extension and taken my work in a more focused direction. Today the public gets its first glance at this work with the alpha release of the BLENC extension in the PHP PECL Repository. To my knowledge this alpha should work on versions of PHP 4.3.0+ and higher, although honestly it was only tested in PHP 5.0 RC3. Using BLENC is really simple, as it only has one function:

blenc_encrypt($input_data, $output_file [, $key]);

The $input_data parameter is a string representing the data to encode (in general this would be a PHP script loaded using the file_get_contents function). The $output_file parameter is the filename to write the encrypted script to (i.e. myscript.phpe), and the third optional parameter $key is the key to encrypt the PHP script with. If no key is provided, a random one will be generated.

Once an encrypted PHP script has been generated, the key to decrypt it must be stored in the key file in order for the PHP script to be executed. These keys are stored in the text file specified by the blenc.key_file php.ini
configuration directive (one per line, default /usr/local/etc/blenckeys).
Assuming you have a valid decryption key in your key file, the PHP script will execute as if it was any other PHP script. However, if you do not have a valid decryption key you will receieve a message such as the following:

Fatal error: Validation of script 'encrypted.phpe' failed, cannot execute.

Let me know if there are any problems using it! Have fun!
Bookmark BLENC 1.0 Alpha Released!  at del.icio.us Digg BLENC 1.0 Alpha Released! Bloglines BLENC 1.0 Alpha Released! Technorati BLENC 1.0 Alpha Released! Fark this: BLENC 1.0 Alpha Released! Bookmark BLENC 1.0 Alpha Released!  at YahooMyWeb Bookmark BLENC 1.0 Alpha Released!  at Furl.net Bookmark BLENC 1.0 Alpha Released!  at reddit.com Bookmark BLENC 1.0 Alpha Released!  at blinklist.com Bookmark BLENC 1.0 Alpha Released!  at Spurl.net Bookmark BLENC 1.0 Alpha Released!  at NewsVine Bookmark BLENC 1.0 Alpha Released!  at Simpy.com Bookmark BLENC 1.0 Alpha Released!  at blogmarks Bookmark BLENC 1.0 Alpha Released!  with wists Bookmark BLENC 1.0 Alpha Released!  at Ma.gnolia.com wong it! Bookmark using any bookmark manager!

Trackbacks

No Trackbacks

Comments
Display comments as (Linear | Threaded)

No comments

The author does not allow comments to this entry