`

怎样获取加密狗序列号

阅读更多
最近小弟在玩加密狗,采用的脚本是VBScript,我已经获取到加密狗的用户及密码,但是,就不知道怎样获取加密狗的序列号。是不是调用什么方法可以返回加密狗的序列号呢?哪位玩过加密狗的叔叔、阿姨、前辈、大侠帮小弟一把可以么。。。呵呵!先谢啦!
分享到:
评论
1 楼 yangpeihai 2008-10-13  
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script language="VBScript">
Dim FirstDigest
Dim Digest
dim EnData
Digest= "01234567890123456"
dim bErr
sub ShowErr(Msg)
bErr = true
MsgBox Msg
End Sub
function Validate(userInfo)
Digest = "01234567890123456"
On Error Resume Next
Dim TheForm
Set TheForm = Document.forms("JAFLoginForm")
If Len(TheForm.pwd.Value) < 4  Then
  MsgBox "PIN empty or user pin length less than 4 or so pin length less than 6!!" 
  Validate = FALSE
  Exit Function
End If

bErr = false
'Let detecte whether the haikey Safe Active Control loaded.
'If we call any method and the Err.number be set to &H1B6, it
'means the hakey Safe Active Control had not be loaded.
dim LibVer
LibVer = htactx.GetLibVersion'-------->获取版本
If Err.number <> 0 Then
  'ShowErr "Load haikey Safe Active Control failed"
  ShowErr "加密狗控件加载失败"
  Validate = false
  Exit function
Else
  'MsgBox "Load ActiveX success!"
  dim hCard
  hCard = 0
  hCard = htactx.OpenDevice(1)'打开设备
  If Err.number<>0 or hCard = 0 then
   'ShowErr "Open first haikey failed."
   ShowErr "请插入加密狗."
   Validate = false
   Exit function
  End if
  'MsgBox "open device success!"
  htactx.VerifyUserPin hCard, CStr(TheForm.password1.Value)'校验口令
  If Err.number<>0 Then
   'ShowErr "Verify User PIN Failure!!!"
   ShowErr "密码不正确!!!"  
   Validate = false
   htactx.CloseDevice hCard
   Exit function
  End if
  'MsgBox "Verify user pin success!"
 
  dim UserName
  UserName = htactx.GetUserName(hCard)'获取用户名
  If Err.number<>0 Then
   'ShowErr "Get User Name Failure!!!"
   ShowErr "获取用户名失败!!!"
   Validate = false
   htactx.CloseDevice hCard
   Exit function
  End if
 
  IF TheForm.username1.value<>UserName Then'用户名不正确
   Validate = false
   Exit function
  End if
  'MsgBox UserName
  'MsgBox "RandomData = " + TheForm.RandomData.value
  Digest = htactx.HTSHA1(TheForm.RandomData.value,30)
  ShowErr Digest
  If Err.number<>0 Then
   'ShowErr "SHA1 failed."
   ShowErr "SHA1 失败."
   Validate = false
   htactx.CloseDevice hCard
   Exit function
  End if
  'MsgBox "SHA1 success!" + Digest
 
  Digest = Digest&"04040404"'对SHA1数据进行补码
  EnData = htactx.HTCrypt(hCard,0 ,0,Digest, len(Digest))'DES3加密SHA1后的数据
  If Err.number<>0 Then
   ShowErr "HashToken compute"
   Validate = false
   htactx.CloseDevice hCard
   Exit function
  End if
  'MsgBox "Encrypt success!" + EnData
  htactx.CloseDevice hCard
  'MsgBox "close device success!"
  TheForm.username.value = UserName
  TheForm.password.value = TheForm.password1.value
  TheForm.EncData.value = EnData
End If
End function
</script>
<script type='text/javascript' src='/dwr/interface/Rockey.js'></script>
<script type='text/javascript' src='/dwr/engine.js'></script>
<script type='text/javascript' src='/dwr/util.js'></script>
<meta http-equiv="Content-Type" content="text/html; charset=GBK"> 
<link href="common/jslogin/css.css" rel="stylesheet" type="text/css" />
</head>
<body background="common/imagesLogin/i_bg.jpg" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onFocus="document.JAFLoginForm.userName.focus();">
    <OBJECT id="htactx" name="htactx"
   classid="clsid:FB4EE423-43A4-4AA9-BDE9-4335A6D3C74E"
   codebase="HTActX.cab#version=1,0,0,1" style="HEIGHT: 0px; WIDTH: 0px">
  </OBJECT>
</body>
</html>

相关推荐

Global site tag (gtag.js) - Google Analytics