mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 08:28:54 +00:00
Remove obsolete mcrypt example
Closes GH-717.
This commit is contained in:
parent
d335ba69a1
commit
67ae2b943e
2 changed files with 0 additions and 62 deletions
|
@ -41,7 +41,6 @@
|
|||
&reference.mcrypt.setup;
|
||||
&reference.mcrypt.constants;
|
||||
&reference.mcrypt.ciphers;
|
||||
&reference.mcrypt.examples;
|
||||
&reference.mcrypt.reference;
|
||||
|
||||
</book>
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<appendix xml:id="mcrypt.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
Mcrypt can be used to encrypt and decrypt using the above
|
||||
mentioned ciphers. If you linked against <literal>libmcrypt-2.2.x</literal>, the
|
||||
four important mcrypt commands (<function>mcrypt_cfb</function>,
|
||||
<function>mcrypt_cbc</function>, <function>mcrypt_ecb</function>,
|
||||
and <function>mcrypt_ofb</function>) can operate in both modes
|
||||
which are named <constant>MCRYPT_ENCRYPT</constant> and
|
||||
<constant>MCRYPT_DECRYPT</constant>, respectively.
|
||||
</para>
|
||||
<para>
|
||||
If you linked against libmcrypt 2.4.x or 2.5.x, these functions are still
|
||||
available, but it is recommended that you use the advanced functions.
|
||||
<example>
|
||||
<title>Encrypt an input value with <literal>AES</literal> with a 256-bit key under 2.4.x and higher in <literal>CBC</literal> mode</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$key = hash('sha256', 'this is a secret key', true);
|
||||
$input = "Let us meet at 9 o'clock at the secret place.";
|
||||
|
||||
$td = mcrypt_module_open('rijndael-128', '', 'cbc', '');
|
||||
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_DEV_URANDOM);
|
||||
mcrypt_generic_init($td, $key, $iv);
|
||||
$encrypted_data = mcrypt_generic($td, $input);
|
||||
mcrypt_generic_deinit($td);
|
||||
mcrypt_module_close($td);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
This example will give you the encrypted data as a string in
|
||||
<literal>$encrypted_data</literal>. For a full example see
|
||||
<function>mcrypt_module_open</function>.
|
||||
</para>
|
||||
</appendix>
|
||||
|
||||
<!-- 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
|
||||
-->
|
Loading…
Reference in a new issue