Doc #68487 [Com]: blenc_encrypt() expects php source code to not contain any php tags
| From: | pasanen dot tuukka at gmail dot com | Date: | Wed, 17 Aug 2016 11:10:36 +0000 |
| Subject: | Doc #68487 [Com]: blenc_encrypt() expects php source code to not contain any php tags | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-13825@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68487&edit=1
ID: 68487
Comment by: pasanen dot tuukka at gmail dot com
Reported by: czarek dot tomczak at gmail dot com
Summary: blenc_encrypt() expects php source code to not
contain any php tags
Status: Open
Type: Documentation Problem
Package: BLENC
Operating System: Windows 7 64bit
PHP Version: 5.4.35
Block user comment: N
Private report: N
New Comment:
I've been solving this specific problem by myself and have patched version of this at: https://github.com/illuusio/pecl-php-blenc. If
you like to test patched version of blec_encode.php version. It's not 100% working but should
make thinks work.
Previous Comments:
------------------------------------------------------------------------
[2014-11-24 07:04:08] czarek dot tomczak at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.blenc-encrypt
---
Example #1 from manpage encrypts script fine, but when you run the encrypted php script then you get
an error:
Parse error: syntax error, unexpected '<'
in C:\phpdesktop\phpdesktop-chrome\www\my_source_encoded.php on line 1
It seems that blenc_encrypt() expects source code to not contain any php tags. After removing php
opening and closing tags in "my_source_to_protect.php" the encrypted script will run fine.
Tested with BLENC 1.1.4b.
Using Mongoose 3.9 webserver and PHP CGI.
Test script:
---------------
<?php
// This is Example #1 from blenc_encrypt manual page.
$source_code = file_get_contents("my_source_to_protect.php");
$redistributable_key = blenc_encrypt($source_code, "my_source_encoded.php");
$key_file = ini_get('blenc.key_file');
file_put_contents($key_file, $redistributable_key, FILE_APPEND);
?>
Expected result:
----------------
Printing a secret string: XuXuXaaa
Actual result:
--------------
Parse error: syntax error, unexpected '<'
in C:\phpdesktop\phpdesktop-chrome\www\my_source_encoded.php on line 1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68487&edit=1