您现在的位置是:首页 >

rar加密文件如何解密 用ASP写个简单的加密和解密的类实例

火烧 2022-03-20 19:21:04 1056
用ASP写个简单的加密和解密的类实例   用a 写个简单的加密和解密的类 在这个类中简单的实现了一个加密和解密 目的是和大家分享一下 这个类的破解非常简单 看看我的注释就知道是怎么回事了 下次编写一个

用ASP写个简单的加密和解密的类实例  

rar加密文件如何解密 用ASP写个简单的加密和解密的类实例
  用asp写个简单的加密和解密的类 在这个类中简单的实现了一个加密和解密 目的是和大家分享一下 这个类的破解非常简单 看看我的注释就知道是怎么回事了 下次编写一个java的加密和解密的类     class Base Class  rem Const  dim sBASE_ _CHARACTERS 转化码  dim lenString 计算字符串的长度  dim iCount 计数器  dim returnValue 返回值  dim tempChar 缓存字符  dim tempString 缓存字符串  dim paramString 参数字符串  dim temHex 缓存缓存十六进制  dim tempLow 缓存低位  dim tempHigh 缓存高位  dim mod String   dim mod String   dim tempBinary   dim tempByteOne   dim tempByteTwo   dim tempByteThree   dim tempByteFour   dim tempSaveBitsOne   dim tempSaveBitsTwo    ********************************************   begin初始化类   ********************************************  private sub Class_Initialize()  sBASE_ _CHARACTERS = ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +/ end sub   ********************************************   end初始化类   ********************************************   ********************************************   begin销毁类   ********************************************  Private Sub Class_Terminate()  sBASE_ _CHARACTERS= end sub   ********************************************   end销毁类   ********************************************     ********************************************   begin将Ansi编码的字符串进行Base 编码   ********************************************  public function Encode(paramString)  tempString=   returnValue=   lenString=len(paramString)  if lenString< then  Encode=returnValue  else  mod String=lenString mod    补足位数是为了便于计算  if mod String> then  lenString=lenString+ mod String  lenString=lenString   end if     *************************begin  for iCount= to lenString step   tempBinary = Mid(paramString iCount )   response write tempBinary  tempByteOne= Asc(Mid(tempBinary )): tempSaveBitsOne = tempByteOne And   tempByteTwo = Asc(Mid(tempBinary )): tempSaveBitsTwo = tempByteTwo And   tempChar = Asc(Mid(tempBinary ))  tempByteOne = Mid(sBASE_ _CHARACTERS ((tempByteOne And ) ) + )  tempByteTwo = Mid(sBASE_ _CHARACTERS (((tempByteTwo And ) ) Or (tempSaveBitsOne * ) And &HFF) + )  tempByteThree = Mid(sBASE_ _CHARACTERS (((tempChar And ) ) Or (tempSaveBitsTwo * ) And &HFF) + )  tempByteFour = Mid(sBASE_ _CHARACTERS (tempChar And ) + )  tempString = tempByteOne & tempByteTwo & tempByteThree & tempByteFour returnValue=returnValue & tempString next   *************************end   *************************begin处理最后剩余的几个字符  if mod String> then  tempBinary = Mid(paramString iCount mod String)  if mod String= then  tempString = tempBinary & Chr( ) & Chr( ) & Chr( ) 用@号补足位数  else tempString = tempBinary & Chr( ) & Chr( ) 用@号补足位数  end if  returnValue=returnValue & tempString  end if   *************************end处理最后剩余的几个字符  Encode=returnValue end if end function   ********************************************   end将Ansi编码的字符串进行Base 编码   ********************************************   ********************************************   end将Base 编码字符串转换成Ansi编码的字符串   ********************************************  public function Decode(paramString)  tempString=   returnValue=   lenString=len(paramString)  if lenString< then  Decode=returnValue  else  mod String=lenString mod   if mod String > then 字符串长度应当是 的倍数  Decode=returnValue  else begin判断是不是@号  if Mid(paramString lenString ) = @ then  mod String=   end if  if Mid(paramString lenString ) = @ then  mod String=   end if   end判断是不是@号  if mod String> then  lenString=lenString   end if     ******************************begin  for iCount= to lenString step   tempString = Mid(paramString iCount )  tempByteOne = InStr(sBASE_ _CHARACTERS Mid(tempString ))   tempByteTwo = InStr(sBASE_ _CHARACTERS Mid(tempString ))   tempByteThree = InStr(sBASE_ _CHARACTERS Mid(tempString ))   tempByteFour = InStr(sBASE_ _CHARACTERS Mid(tempString ))   tempByteOne = Chr(((tempByteTwo And ) ) Or (tempByteOne * ) And &HFF) tempByteTwo = & Chr(((tempByteThree And ) ) Or (tempByteTwo * ) And &HFF)  tempByteThree = Chr((((tempByteThree And ) * ) And &HFF) Or (tempByteFour And ))  tempString=tempByteOne & tempByteTwo & tempByteThree  returnValue=returnValue & tempString  next   ******************************end   处理最后剩余的几个字符  if mod String > then  tempString=left(right(paramString ) mod String)  returnValue = returnValue & tempString  end if  Decode=returnValue  end if  end if  end function   ********************************************   end将Base 编码字符串转换成Ansi编码的字符串   ********************************************    end class lishixinzhi/Article/program/net/201311/12110  
永远跟党走
  • 如果你觉得本站很棒,可以通过扫码支付打赏哦!

    • 微信收款码
    • 支付宝收款码