mcrypt.constants.html

来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 165 行

HTML
165
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Predefined Constants</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mcrypt.resources.html">Resource Types</a></div> <div class="next" style="text-align: right; float: right;"><a href="mcrypt.ciphers.html">Mcrypt ciphers</a></div> <div class="up"><a href="book.mcrypt.html">Mcrypt</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div> <h1>Predefined Constants</h1> <p class="simpara">The constants below are defined by this extension, andwill only be available when the extension has eitherbeen compiled into PHP or dynamically loaded at runtime.</p> <p class="para">  Mcrypt can operate in four block cipher modes (CBC, OFB, CFB, and  ECB). If linked against libmcrypt-2.4.x or higher the functions can also operate  in the block cipher mode nOFB and in STREAM mode. Below you find a list  with all supported encryption modes together with the constants that are  defines for the encryption mode.  For a more complete reference and  discussion see Applied Cryptography by Schneier (ISBN 0-471-11709-9).  <ul class="itemizedlist">   <li class="listitem">    <span class="simpara">     MCRYPT_MODE_ECB (electronic codebook) is suitable for random data,     such as encrypting other keys. Since data there is short and random,     the disadvantages of ECB have a favorable negative effect.    </span>   </li>   <li class="listitem">    <span class="simpara">     MCRYPT_MODE_CBC (cipher block chaining) is especially suitable for     encrypting files where the security is increased over ECB     significantly.    </span>   </li>   <li class="listitem">    <span class="simpara">     MCRYPT_MODE_CFB (cipher feedback) is the best mode for encrypting byte     streams where single bytes must be encrypted.    </span>   </li>   <li class="listitem">    <span class="simpara">     MCRYPT_MODE_OFB (output feedback, in 8bit) is comparable to CFB, but     can be used in applications where error propagation cannot     be tolerated. It&#039;s insecure (because it operates in 8bit     mode) so it is not recommended to use it.    </span>   </li>   <li class="listitem">    <span class="simpara">     MCRYPT_MODE_NOFB (output feedback, in nbit) is comparable to OFB, but     more secure because it operates on the block size of the algorithm.    </span>   </li>    <li class="listitem">    <span class="simpara">     MCRYPT_MODE_STREAM is an extra mode to include some stream algorithms     like WAKE or RC4.    </span>   </li>   </ul> </p> <p class="para">  Some other mode and random device constants:  <dl>   <dt>    <span class="term">     <b><tt>MCRYPT_ENCRYPT</tt></b>      (<a href="language.types.integer.html" class="type integer">integer</a>)    </span>    <dd>     <span class="simpara">           </span>    </dd>   </dt>   <dt>    <span class="term">     <b><tt>MCRYPT_DECRYPT</tt></b>      (<a href="language.types.integer.html" class="type integer">integer</a>)    </span>    <dd>     <span class="simpara">           </span>    </dd>   </dt>   <dt>    <span class="term">     <b><tt>MCRYPT_DEV_RANDOM</tt></b>      (<a href="language.types.integer.html" class="type integer">integer</a>)    </span>    <dd>     <span class="simpara">           </span>    </dd>   </dt>   <dt>    <span class="term">     <b><tt>MCRYPT_DEV_URANDOM</tt></b>      (<a href="language.types.integer.html" class="type integer">integer</a>)    </span>    <dd>     <span class="simpara">           </span>    </dd>   </dt>   <dt>    <span class="term">     <b><tt>MCRYPT_RAND</tt></b>      (<a href="language.types.integer.html" class="type integer">integer</a>)    </span>    <dd>     <span class="simpara">           </span>    </dd>   </dt>  </dl> </p></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mcrypt.resources.html">Resource Types</a></div> <div class="next" style="text-align: right; float: right;"><a href="mcrypt.ciphers.html">Mcrypt ciphers</a></div> <div class="up"><a href="book.mcrypt.html">Mcrypt</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?