Doc #68487 [Opn->Sus]: blenc_encrypt() expects php source code to not contain any php tags
| From: | kalle@php.net | Date: | Tue, 10 Jan 2017 08:32:17 +0000 |
| Subject: | Doc #68487 [Opn->Sus]: 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-14323@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
Updated by: kalle@php.net
Reported by: czarek dot tomczak at gmail dot com
Summary: blenc_encrypt() expects php source code to not
contain any php tags
-Status: Open
+Status: Suspended
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'm suspending the reports for BLENC as it doesn't seem to have stalled (looking at both
repositories I could find on git.php.net and github) and it does not seem compatible with any
currently supported version of PHP either. Please unsuspend in case someone takes over this
extension
Previous Comments:
------------------------------------------------------------------------
[2016-08-17 11:10:36] pasanen dot tuukka at gmail dot com
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.
------------------------------------------------------------------------
[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