mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 05:26:57 +08:00
200 lines
5.6 KiB
HTML
200 lines
5.6 KiB
HTML
<!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>解密数据</title>
|
||
</head>
|
||
<body class="docs"><div id="layout">
|
||
<div id="layout-content"><div id="function.openssl-decrypt" class="refentry">
|
||
<div class="refnamediv">
|
||
<h1 class="refname">openssl_decrypt</h1>
|
||
<p class="verinfo">(PHP 5 >= 5.3.0, PHP 7)</p><p class="refpurpose"><span class="refname">openssl_decrypt</span> — <span class="dc-title">解密数据</span></p>
|
||
|
||
</div>
|
||
|
||
<div class="refsect1 description" id="refsect1-function.openssl-decrypt-description">
|
||
<h3 class="title">说明</h3>
|
||
<div class="methodsynopsis dc-description">
|
||
<span class="methodname"><strong>openssl_decrypt</strong></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">$method</code></span>
|
||
, <span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span>
|
||
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$options</code><span class="initializer"> = 0</span></span>
|
||
[, <span class="methodparam"><span class="type">string</span> <code class="parameter">$iv</code><span class="initializer"> = ""</span></span>
|
||
[, <span class="methodparam"><span class="type">string</span> <code class="parameter">$tag</code><span class="initializer"> = ""</span></span>
|
||
[, <span class="methodparam"><span class="type">string</span> <code class="parameter">$aad</code><span class="initializer"> = ""</span></span>
|
||
]]]] ) : <span class="type">string</span></div>
|
||
|
||
<p class="para rdfs-comment">
|
||
采用原始或base64编码的字符串,并使用给定的方法和密钥对其进行解密。
|
||
</p>
|
||
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 parameters" id="refsect1-function.openssl-decrypt-parameters">
|
||
<h3 class="title">参数</h3>
|
||
<p class="para">
|
||
<dl>
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">data</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
将被解密的密文。
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">method</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
加密算法,使用<span class="function"><a href="openssl_get_cipher_methods.html" class="function">openssl_get_cipher_methods()</a></span>函数获取可用的加密算法列表。
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">key</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
密钥。
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">options</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
<code class="parameter">options</code> can be one of
|
||
<strong><code>OPENSSL_RAW_DATA</code></strong>,
|
||
<strong><code>OPENSSL_ZERO_PADDING</code></strong>.
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">iv</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
非空的初始化向量。
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">tag</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
AEAD密码模式中的身份验证标签。 如果是错误的,验证失败,函数返回<strong><code>FALSE</code></strong>.
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">aad</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
额外的认证数据。
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
</dl>
|
||
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 returnvalues" id="refsect1-function.openssl-decrypt-returnvalues">
|
||
<h3 class="title">返回值</h3>
|
||
<p class="para">
|
||
The decrypted string on success 或者在失败时返回 <strong><code>FALSE</code></strong>.
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 errors" id="refsect1-function.openssl-decrypt-errors">
|
||
<h3 class="title">错误/异常</h3>
|
||
<p class="para">
|
||
如果通过<code class="parameter">method</code>参数传递的是一个未知的加密算法,将会抛出一个 <strong><code>E_WARNING</code></strong> 等级的错误。
|
||
</p>
|
||
<p class="para">
|
||
如果通过<code class="parameter">iv</code>参数传递的是一个空值,将会抛出一个 <strong><code>E_WARNING</code></strong> 等级的错误。
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 changelog" id="refsect1-function.openssl-decrypt-changelog">
|
||
<h3 class="title">更新日志</h3>
|
||
<table class="doctable informaltable">
|
||
|
||
<thead>
|
||
<tr>
|
||
<th>版本</th>
|
||
<th>说明</th>
|
||
</tr>
|
||
|
||
</thead>
|
||
|
||
<tbody class="tbody">
|
||
<tr>
|
||
<td>5.3.3</td>
|
||
<td>
|
||
添加 <code class="parameter">iv</code> 参数。
|
||
</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>5.4.0</td>
|
||
<td>
|
||
将 <code class="parameter">raw_output</code> 更改至 <code class="parameter">options</code>。
|
||
</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>7.1.0</td>
|
||
<td>添加了 <code class="parameter">tag</code> 和 <code class="parameter">aad</code> 参数。</td>
|
||
</tr>
|
||
|
||
</tbody>
|
||
|
||
</table>
|
||
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 seealso" id="refsect1-function.openssl-decrypt-seealso">
|
||
<h3 class="title">参见</h3>
|
||
<p class="para">
|
||
<ul class="simplelist">
|
||
<li class="member"><span class="function"><a href="openssl_encrypt.html" class="function" rel="rdfs-seeAlso">openssl_encrypt()</a> - 加密数据</span></li>
|
||
</ul>
|
||
</p>
|
||
</div>
|
||
|
||
|
||
</div></div></div></body></html> |