Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 4228

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!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>Decrypts crypttext with given parameters</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.mcrypt-create-iv.html">mcrypt_create_iv</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.mcrypt-ecb.html">mcrypt_ecb</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-decrypt" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mcrypt_decrypt</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.2, PHP 5)</p><p class="refpurpose"><span class="refname">mcrypt_decrypt</span> &mdash; <span class="dc-title">Decrypts crypttext with given parameters</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.mcrypt-decrypt-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><strong>mcrypt_decrypt</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">string</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">
   Decrypts the <em><code class="parameter">data</code></em> and returns the unencrypted data.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.mcrypt-decrypt-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>

     <span class="term"><em><code class="parameter">cipher</code></em></span>
     <dd>

      <p class="para">One of the <strong><code>MCRYPT_ciphername</code></strong> constants, or the name of the algorithm as string.</p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">key</code></em></span>
     <dd>

      <p class="para">
       The key with which the data was encrypted. If it&#039;s smaller
       than the required keysize, it is padded with
       &#039;<em>\0</em>&#039;.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">data</code></em></span>
     <dd>

      <p class="para">
       The data that will be decrypted with the given <em><code class="parameter">cipher</code></em>
       and <em><code class="parameter">mode</code></em>. If the size of the data is not n * blocksize,
       the data will be padded with &#039;<em>\0</em>&#039;.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">mode</code></em></span>
     <dd>

      <p class="para">One of the <strong><code>MCRYPT_MODE_modename</code></strong> constants, or one of the following strings: &quot;ecb&quot;, &quot;cbc&quot;, &quot;cfb&quot;, &quot;ofb&quot;, &quot;nofb&quot; or &quot;stream&quot;.</p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">iv</code></em></span>
     <dd>

      <p class="para">Used for the initialization in CBC, CFB, OFB modes, and in some algorithms in STREAM mode. If you do not supply an IV, while it is needed for an algorithm, the function issues a warning and uses an IV with all its bytes set to &quot;<em>\0</em>&quot;.</p>
     </dd>

    </dt>

   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.mcrypt-decrypt-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns the decrypted data as a string.
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.mcrypt-create-iv.html">mcrypt_create_iv</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.mcrypt-ecb.html">mcrypt_ecb</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>