<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.mcrypt.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.mcrypt-get-block-size.php',
    1 => 'mcrypt_get_block_size',
    2 => 'Gets the block size of the specified cipher',
  ),
  'up' => 
  array (
    0 => 'ref.mcrypt.php',
    1 => 'Mcrypt Functions',
  ),
  'prev' => 
  array (
    0 => 'function.mcrypt-generic-init.php',
    1 => 'mcrypt_generic_init',
  ),
  'next' => 
  array (
    0 => 'function.mcrypt-get-cipher-name.php',
    1 => 'mcrypt_get_cipher_name',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/mcrypt/functions/mcrypt-get-block-size.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.mcrypt-get-block-size" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mcrypt_get_block_size</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7 &lt; 7.2.0, PECL mcrypt &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">mcrypt_get_block_size</span> &mdash; <span class="dc-title">Gets the block size of the specified cipher</span></p>

 </div>
 <div id="function.mcrypt-get-block-size-refsynopsisdiv">
  <div class="warning"><strong class="warning">Warning</strong><p class="simpara">This function has been
<em>DEPRECATED</em> as of PHP 7.1.0 and
<em>REMOVED</em> as of PHP 7.2.0. Relying on this function
is highly discouraged.</p></div>
 </div>
 <div class="refsect1 description" id="refsect1-function.mcrypt-get-block-size-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mcrypt_get_block_size</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$cipher</code></span>): <span class="type"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <div class="methodsynopsis dc-description"><span class="methodname"><strong>mcrypt_get_block_size</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$cipher</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$mode</code></span>): <span class="type"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="simpara">
   The first prototype is when linked against libmcrypt 2.2.x, the
   second when linked against libmcrypt 2.4.x or 2.5.x.
  </p>
  <p class="simpara">
   <span class="function"><strong>mcrypt_get_block_size()</strong></span> is used to get the
   size of a block of the specified <code class="parameter">cipher</code> (in
   combination with an encryption mode).
  </p>
  <p class="simpara">
   It is more useful to use the <span class="function"><a href="function.mcrypt-enc-get-block-size.php" class="function">mcrypt_enc_get_block_size()</a></span>
   function as this uses the resource returned by
   <span class="function"><a href="function.mcrypt-module-open.php" class="function">mcrypt_module_open()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mcrypt-get-block-size-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">cipher</code></dt>
    <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><code class="parameter">mode</code></dt>
    <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>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mcrypt-get-block-size-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="simpara">
   Returns the algorithm block size in bytes  or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.mcrypt-get-block-size-examples">
  <h3 class="title">Examples</h3>
  <div class="example" id="example-1">
   <p><strong>Example #1 <span class="function"><strong>mcrypt_get_block_size()</strong></span> example</strong></p>
   <div class="example-contents"><p>
    This example shows how to use this function when linked against libmcrypt
    2.4.x and 2.5.x.
   </p></div>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">mcrypt_get_block_size</span><span style="color: #007700">(</span><span style="color: #DD0000">'tripledes'</span><span style="color: #007700">, </span><span style="color: #DD0000">'ecb'</span><span style="color: #007700">); </span><span style="color: #FF8000">// 8<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.mcrypt-get-block-size-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.mcrypt-get-key-size.php" class="function" rel="rdfs-seeAlso">mcrypt_get_key_size()</a> - Gets the key size of the specified cipher</span></li>
   <li><span class="function"><a href="function.mcrypt-enc-get-block-size.php" class="function" rel="rdfs-seeAlso">mcrypt_enc_get_block_size()</a> - Returns the blocksize of the opened algorithm</span></li>
   <li><span class="function"><a href="function.mcrypt-encrypt.php" class="function" rel="rdfs-seeAlso">mcrypt_encrypt()</a> - Encrypts plaintext with given parameters</span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>