<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Encrypts/decrypts data in CBC mode</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ref.mcrypt.html">Mcrypt Functions</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.mcrypt-cfb.html">mcrypt_cfb</a></div> <div class="up"><a href="ref.mcrypt.html">Mcrypt Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.mcrypt-cbc" class="refentry"> <div class="refnamediv"> <h1 class="refname">mcrypt_cbc</h1> <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">mcrypt_cbc</span> — <span class="dc-title">Encrypts/decrypts data in CBC mode</span></p> </div> <div class="refsect1 description" id="refsect1-function.mcrypt-cbc-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">string</span> <span class="methodname"><strong>mcrypt_cbc</strong></span> ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$cipher</code></span> , <span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span> , <span class="methodparam"><span class="type">string</span> <code class="parameter">$data</code></span> , <span class="methodparam"><span class="type">int</span> <code class="parameter">$mode</code></span> [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$iv</code></span> ] )</div> <div class="methodsynopsis dc-description"> <span class="type">string</span> <span class="methodname"><strong>mcrypt_cbc</strong></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$cipher</code></span> , <span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span> , <span class="methodparam"><span class="type">string</span> <code class="parameter">$data</code></span> , <span class="methodparam"><span class="type">int</span> <code class="parameter">$mode</code></span> [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$iv</code></span> ] )</div> <p class="para rdfs-comment"> The first prototype is when linked against libmcrypt 2.2.x, the second when linked against libmcrypt 2.4.x or higher. The <em><code class="parameter">mode</code></em> should be either <strong><code>MCRYPT_ENCRYPT</code></strong> or <strong><code>MCRYPT_DECRYPT</code></strong>. </p> <p class="para"> This function should not be used anymore, see <span class="function"><a href="function.mcrypt-generic.html" class="function">mcrypt_generic()</a></span> and <span class="function"><a href="function.mdecrypt-generic.html" class="function">mdecrypt_generic()</a></span> for replacements. </p> <div class="warning"><strong class="warning">Warning</strong> <p class="simpara">This function has been <em class="emphasis">DEPRECATED</em> as of PHP 5.5.0. Relying on this function is highly discouraged.</p></div> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ref.mcrypt.html">Mcrypt Functions</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.mcrypt-cfb.html">mcrypt_cfb</a></div> <div class="up"><a href="ref.mcrypt.html">Mcrypt Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>