无需言 做自己 业 ,精于勤 荒于嬉.
- OpenSSL 函数 openssl_cms_decrypt Decrypt a CMS message
-
发表日期:2021-07-01 08:55:20 | 来源: | 分类:OpenSSL 函数
-
openssl_cms_decrypt
(PHP 8)
openssl_cms_decrypt — Decrypt a CMS message
说明
openssl_cms_decrypt(
string$input_filename,
string$output_filename,
OpenSSLCertificate|string$certificate,
OpenSSLAsymmetricKey|OpenSSLCertificate|array|string|null$private_key=null,
int$encoding=OPENSSL_ENCODING_SMIME
): boolDecrypts a CMS message.
参数
-
input_filename -
The name of a file containing encrypted content.
-
output_filename -
The name of the file to deposit the decrypted content.
-
certificate -
The name of the file containing a certificate of the recipient.
-
private_key -
The name of the file containing a PKCS#8 key.
-
encoding -
The encoding of the input file. One of
OPENSSL_CMS_SMIME,OPENSLL_CMS_DERorOPENSSL_CMS_PEM.
返回值
成功时返回
true, 或者在失败时返回false。 -
- Hash 函数 hash_final 结束增量哈希,并且返回摘要结果
-
发表日期:2021-07-01 08:55:16 | 来源: | 分类:Hash 函数
-
示例1
<?php $ctx = hash_init('sha1'); hash_update($ctx, 'The quick brown fox jumped over the lazy dog.'); echo hash_final($ctx); ?>
- Hash 函数 hash_copy 拷贝哈希运算上下文
-
发表日期:2021-07-01 08:55:16 | 来源: | 分类:Hash 函数
-
示例1
<?php $context = hash_init("md5"); hash_update($context, "data"); /* 拷贝上下文资源以便继续使用 */ $copy_context = hash_copy($context); echo hash_final($context), "\n"; hash_update($copy_context, "data"); echo hash_final($copy_context), "\n"; ?>
- Hash 函数 hash_init 初始化增量哈希运算上下文
-
发表日期:2021-07-01 08:55:16 | 来源: | 分类:Hash 函数
-
示例1
<?php $ctx = hash_init('md5'); hash_update($ctx, 'The quick brown fox '); hash_update($ctx, 'jumped over the lazy dog.'); echo hash_final($ctx); ?>
- Hash 函数 hash_hmac_file 使用 HMAC 方法和给定文件的内容生成带密钥的哈希值
-
发表日期:2021-07-01 08:55:16 | 来源: | 分类:Hash 函数
-
示例1
<?php /* 创建一个要计算哈希值的文件 */ file_put_contents('example.txt', 'The quick brown fox jumped over the lazy dog.'); echo hash_hmac_file('md5', 'example.txt', 'secret'); ?>
- Hash 函数 hash_hmac 使用 HMAC 方法生成带有密钥的哈希值
-
发表日期:2021-07-01 08:55:16 | 来源: | 分类:Hash 函数
-
示例1
<?php echo hash_hmac('ripemd160', 'The quick brown fox jumped over the lazy dog.', 'secret'); ?>
- Hash 函数 hash_pbkdf2 生成所提供密码的 PBKDF2 密钥导出
-
发表日期:2021-07-01 08:55:16 | 来源: | 分类:Hash 函数
-
示例1
<?php $password = "password"; $iterations = 1000; // 使用 openssl_random_pseudo_bytes(),random_bytes(),或者其他合适的随机数生成函数// 来生成随机初始向量$salt = openssl_random_pseudo_bytes(16, MCRYPT_DEV_URANDOM); $hash = hash_pbkdf2("sha256", $password, $salt, $iterations, 20); echo $hash; ?>
- Hash 函数 hash_update_stream 从打开的流向活跃的哈希运算上下文中填充数据
-
发表日期:2021-07-01 08:55:16 | 来源: | 分类:Hash 函数
-
示例1
<?php $fp = tmpfile(); fwrite($fp, 'The quick brown fox jumped over the lazy dog.'); rewind($fp); $ctx = hash_init('md5'); hash_update_stream($ctx, $fp); echo hash_final($ctx); ?>
- Hash 函数 hash_update 向活跃的哈希运算上下文中填充数据
-
发表日期:2021-07-01 08:55:16 | 来源: | 分类:Hash 函数
-
hash_update
(PHP 5 >= 5.1.2, PHP 7, PHP 8, PECL hash >= 1.1)
hash_update — 向活跃的哈希运算上下文中填充数据
说明
hash_update(HashContext$context, string$data): bool返回值
返回
true。更新日志
版本 说明 7.2.0 接收参数从资源类型修改为 HashContext 对象类型。 参见
- hash_init() - 初始化增量哈希运算上下文
- hash_update_file() - 从文件向活跃的哈希运算上下文中填充数据
- hash_update_stream() - 从打开的流向活跃的哈希运算上下文中填充数据
- hash_final() - 结束增量哈希,并且返回摘要结果
- Hash 函数 hash_update_file 从文件向活跃的哈希运算上下文中填充数据
-
发表日期:2021-07-01 08:55:16 | 来源: | 分类:Hash 函数
-
hash_update_file
(PHP 5 >= 5.1.2, PHP 7, PHP 8, PECL hash >= 1.1)
hash_update_file — 从文件向活跃的哈希运算上下文中填充数据
说明
hash_update_file(HashContext$hcontext, string$filename, resource$scontext=null): bool参数
-
hcontext -
由 hash_init() 函数返回的哈希运算上下文。
-
filename -
要进行哈希运算的文件路径,支持 fopen 封装器。
-
scontext -
由 stream_context_create() 函数返回的流上下文。
返回值
成功时返回
true, 或者在失败时返回false。更新日志
版本 说明 7.2.0 接收参数从资源类型修改为 HashContext 对象类型。 参见
- hash_init() - 初始化增量哈希运算上下文
- hash_update() - 向活跃的哈希运算上下文中填充数据
- hash_update_stream() - 从打开的流向活跃的哈希运算上下文中填充数据
- hash_final() - 结束增量哈希,并且返回摘要结果
- hash() - 生成哈希值 (消息摘要)
- hash_file() - 给指定文件的内容生成哈希值
-
- Hash 函数 hash_equals 可防止时序攻击的字符串比较
-
发表日期:2021-07-01 08:55:16 | 来源: | 分类:Hash 函数
-
示例1
<?php $expected = crypt('12345', '$2a$07$usesomesillystringforsalt$'); $correct = crypt('12345', '$2a$07$usesomesillystringforsalt$'); $incorrect = crypt('apple', '$2a$07$usesomesillystringforsalt$'); var_dump(hash_equals($expected, $correct)); var_dump(hash_equals($expected, $incorrect)); ?>
- Hash 函数 hash 生成哈希值 (消息摘要)
-
发表日期:2021-07-01 08:55:16 | 来源: | 分类:Hash 函数
-
示例1
<?php echo hash('ripemd160', 'The quick brown fox jumped over the lazy dog.'); ?>示例2
<?php function old_tiger($data = "", $width=192, $rounds = 3) { return substr( implode( array_map( function ($h) { return str_pad(bin2hex(strrev($h)), 16, "0"); } , str_split(hash("tiger192,$rounds", $data, true), 8) ) ), 0, 48-(192-$width)/4 ); } echo hash('tiger192,3', 'a-string'), PHP_EOL; echo old_tiger('a-string'), PHP_EOL; ?>
- Hash 函数 hash_file 给指定文件的内容生成哈希值
-
发表日期:2021-07-01 08:55:15 | 来源: | 分类:Hash 函数
-
示例1
<?php /* 创建一个要计算哈希值的文件 */ file_put_contents('example.txt', 'The quick brown fox jumped over the lazy dog.'); echo hash_file('md5', 'example.txt'); ?>
- Hash 函数 hash_algos 返回已注册的哈希算法列表
-
发表日期:2021-07-01 08:55:15 | 来源: | 分类:Hash 函数
-
示例1
<?php print_r(hash_algos()); ?>
- Hash 函数 hash_hmac_algos Return a list of registered hashing algorithms suitable for hash_hmac
-
发表日期:2021-07-01 08:55:15 | 来源: | 分类:Hash 函数
-
示例1
<?php print_r(hash_hmac_algos());
- Hash 函数 hash_hkdf Generate a HKDF key derivation of a supplied key input
-
发表日期:2021-07-01 08:55:15 | 来源: | 分类:Hash 函数
-
示例1
<?php // Generate a random key, and salt to strengthen it during derivation.$inputKey = random_bytes(32); $salt = random_bytes(16); // Derive a pair of separate keys, using the same input created above.$encryptionKey = hash_hkdf('sha256', $inputKey, 32, 'aes-256-encryption', $salt); $authenticationKey = hash_hkdf('sha256', $inputKey, 32, 'sha-256-authentication', $salt); var_dump($encryptionKey !== $authenticationKey); // bool(true)?>
- Zip 函数 zip_entry_open 打开用于读取的目录实体
-
发表日期:2021-07-01 08:55:11 | 来源: | 分类:Zip 函数
-
zip_entry_open
(PHP 4 >= 4.1.0, PHP 5 >= 5.2.0, PHP 7, PHP 8, PECL zip >= 1.0.0)
zip_entry_open — 打开用于读取的目录实体
说明
zip_entry_open(resource$zip, resource$zip_entry, string$mode= ?): bool打开ZIP文件中的目录实体以便后续读取。
参数
-
zip -
由函数zip_open()返回的有效的资源句柄。
-
zip_entry -
由函数zip_read()返回的目录实体。
-
mode -
任何在fopen()处理文档中指定的模式。
注意:
由于ZIP在PHP中只支持读取模式,所以
mode实际上总是被设置为"rb"(其他模式会被忽略)。
返回值
成功时返回
true, 或者在失败时返回false。注意:
与fopen()和其他类似的方法不同,zip_entry_open() 的返回值只用于标示该操作结果,不需要读取或关闭该目录实体。
-
- Zip 函数 zip_entry_name 检索目录项的名称
-
发表日期:2021-07-01 08:55:11 | 来源: | 分类:Zip 函数
-
zip_entry_name
(PHP 4 >= 4.1.0, PHP 5 >= 5.2.0, PHP 7, PHP 8, PECL zip >= 1.0.0)
zip_entry_name — 检索目录项的名称
说明
zip_entry_name(resource$zip_entry): string返回指定目录项的名称。
返回值
目录项的名称。
- Zip 函数 zip_entry_compressionmethod 检索目录实体的压缩方法
-
发表日期:2021-07-01 08:55:11 | 来源: | 分类:Zip 函数
-
zip_entry_compressionmethod
(PHP 4 >= 4.1.0, PHP 5 >= 5.2.0, PHP 7, PHP 8, PECL zip >= 1.0.0)
zip_entry_compressionmethod — 检索目录实体的压缩方法
说明
zip_entry_compressionmethod(resource$zip_entry): string返回由函数
zip_entry确定的目录实体的压缩方法。返回值
压缩方法。
- Zip 函数 zip_read 读取ZIP存档文件中下一项
-
发表日期:2021-07-01 08:55:11 | 来源: | 分类:Zip 函数
-
zip_read
(PHP 4 >= 4.1.0, PHP 5 >= 5.2.0, PHP 7, PHP 8, PECL zip >= 1.0.0)
zip_read — 读取ZIP存档文件中下一项
说明
zip_read(resource$zip): resource读取ZIP存档文件中下一项。
返回值
成功的时候返回该当前实体资源供
zip_entry_...系列函数后续使用; 如果没有更多的读取项,则会返回false如果遇到错误则会返回相应的错误码。参见
- zip_open() - 打开ZIP存档文件
- zip_close() - 关闭一个ZIP档案文件
- zip_entry_open() - 打开用于读取的目录实体
- zip_entry_read() - 读取一个打开了的压缩目录实体
- 前端开发(1)
- 数据库(0)
- PHP(0)
- PHP杂项(34)
- PHP基础-李炎恢系列课程(20)
- 中文函数手册(0)
- 错误处理 函数(13)
- OPcache 函数(6)
- PHP 选项/信息 函数(54)
- Zip 函数(10)
- Hash 函数(15)
- OpenSSL 函数(63)
- Date/Time 函数(51)
- 目录函数(9)
- Fileinfo 函数(6)
- iconv 函数(11)
- 文件系统函数(81)
- 多字节字符串 函数(57)
- GD 和图像处理 函数(114)
- 可交换图像信息(5)
- Math 函数(50)
- 程序执行函数(11)
- PCNTL 函数(23)
- JSON 函数(4)
- SPL 函数(15)
- URL 函数(10)
- cURL 函数(32)
- 网络 函数(33)
- FTP 函数(36)
- Session 函数(23)
- PCRE 函数(11)
- PCRE 正则语法(19)
- 数组 函数(81)
- 类/对象 函数(18)
- 函数处理 函数(13)
- 变量处理 函数(37)
- SimpleXML 函数(3)
- 杂项 函数(31)
- 字符串 函数(101)
- JAVA(0)
- Android(0)
- Linux(0)
- AI大模型(9)
- 其他(0)
宁公网安备 64010402001209号