Home >php教程 >php手册 >一句php加密字符串的代码,请问能否用批处理实现

一句php加密字符串的代码,请问能否用批处理实现

WBOY
WBOYOriginal
2016-06-06 19:40:341252browse

http://cn2.php.net/manual/en/function.hash-hmac.php 楼上好幽默 这个问题应该不难 ?php $Content = $argv[1]; $SecretKey = $argv[2]; $Signature = urlencode(base64_encode(hash_hmac('sha1', Content, SecretKey,true))); ? 保存成xxx.php文件,然后在

http://cn2.php.net/manual/en/function.hash-hmac.php

楼上好幽默

 

这个问题应该不难

$Content = $argv[1];

$SecretKey = $argv[2];

$Signature = urlencode(base64_encode(hash_hmac('sha1', Content, SecretKey,true)));

?>

保存成xxx.php文件,然后在批处理shell中写

php xxx.php 你的待加密content 加密的key

....

 

简单写一下,你应该明白我的意思

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn