mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-26 22:08:55 +00:00

Patch provided by Andrey Gromov. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@340436 c90b9560-bf6c-de11-be94-00142212c4b1
120 lines
3 KiB
XML
120 lines
3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
|
|
<refentry xml:id="function.blenc-encrypt" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>blenc_encrypt</refname>
|
|
<refpurpose>
|
|
Encrypt a PHP script with BLENC.
|
|
</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>blenc_encrypt</methodname>
|
|
<methodparam><type>string</type><parameter>plaintext</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>encodedfile</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>encryption_key</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Encrypt the <parameter>plaintext</parameter> content and write it into <parameter>encodedfile</parameter>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>plaintext</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
A source code to encrypt. Does not need to contain opening/closing PHP tags
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>encodedfile</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
The filename where BLENC will save the encoded source.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>encryption_key</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
The key that BLENC will use to encrypt plaintext content. If not given
|
|
BLENC will create a valid key.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
BLENC will return the redistributable key that must be saved into key_file:
|
|
the path of key_file is specified at runtime with the option blenc.key_file
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>blenc_encrypt</function> example </title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
/* read the PHP source code */
|
|
$source_code = file_get_contents("my_source_to_protect.php");
|
|
|
|
/* create the encrypted version */
|
|
$redistributable_key = blenc_encrypt($source_code, "my_source_encoded.php");
|
|
|
|
/* read which is the key_file */
|
|
$key_file = ini_get('blenc.key_file');
|
|
|
|
/* save the redistributable key */
|
|
file_put_contents($key_file, $redistributable_key, FILE_APPEND);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|