asp sha1加密

本文详细介绍了ASP.NET中如何使用SHA1算法进行数据加密,包括加密过程、代码示例以及加密的安全性分析,帮助开发者理解并应用SHA1加密技术。
摘要由CSDN通过智能技术生成

 

 


<% 


'string1=jsapi_ticket=sM4AOVdWfPE4DxkXGEs8VMCPGGVi4C3VM0P37wVUCFvkVAy_90u5h9nbSlYy3-Sl-HhTdfl2fzFy1AOcHKP7qg&noncestr=Wm3WZYTPz0wzccnW&timestamp=1414587457&url=http://mp.weixin.qq.com?params=value

'对string1进行sha1签名,得到signature:0f9de62fce790f9a083d5c99e95740ceb90c27ed
'上面来源:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#62

'下面示例中hex_sha1()方法得到的加密和 例子的加密串一直
 

dim string1_ceshi

string1_ceshi="jsapi_ticket=sM4AOVdWfPE4DxkXGEs8VMCPGGVi4C3VM0P37wVUCFvkVAy_90u5h9nbSlYy3-Sl-HhTdfl2fzFy1AOcHKP7qg&noncestr=Wm3WZYTPz0wzccnW&timestamp=1414587457&url=http://mp.weixin.qq.com?params=value"
 
 
response.Write("hex_sha1:")
response.Write(hex_sha1(string1_ceshi))
response.Write("<br>")

response.Write("b64_sha1:")
response.Write(b64_sha1(string1_ceshi))
response.Write("<br>")

response.Write("str_sha1")
response.Write(str_sha1(string1_ceshi))
response.Write("<br>")

response.Write("hex_hmac_sha1")
response.Write(hex_hmac_sha1("hex_hmac_sha1",string1_ceshi))
response.Write("<br>")

response.Write("b64_hmac_sha1")
response.Write(b64_hmac_sha1("b64_hmac_sha1",string1_ceshi))
response.Write("<br>")

response.Write("str_hmac_sha1")
response.Write(str_hmac_sha1("str_hmac_sha1",string1_ceshi))
response.Write("<br>")
 
%>

<script language="jscript" runat="server">
function getjson(str){
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

橙-极纪元JJY.Cheng

客官,1分钱也是爱,给个赏钱吧

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值