Paste Search Dynamic
EncryptDES
  1. imports System.Text
  2. imports System.Security.Cryptography
  3. imports System.IO
  4.  
  5. Module Module1
  6.  
  7.     private jc as string = "NEU2MDMwMDBGRkJGQkVGQkgzRDk3WExFTUdH"
  8.     private dz as string = ""
  9.     private qk as string = ""
  10.     private sy as string = ""
  11.  
  12.     sub Main()
  13.         if jc <> "" then
  14.             if replace(replace(jc, " ", ""), vbCrLf, "").Length = 24 then
  15.                 Console.WriteLine("banbenyiguoqi")
  16.             else
  17.                 if replace(replace(jc, " ", ""), vbCrLf, "").Length = 27 then
  18.                     Console.WriteLine("banbenyiguoqi")
  19.                 else
  20.                     if replace(replace(jc, " ", ""), vbCrLf, "").Length = 36 then
  21.                         Console.WriteLine(strEncrypt(GetRNum() & GetDiskVolumeSerialNumber().ToUpper))
  22.                     else
  23.                         if replace(replace(jc, " ", ""), vbCrLf, "").Length = 38 then
  24.                             Console.WriteLine(GetRNum() & GetDiskVolumeSerialNumber1().Substring(0, 6))
  25.                         else
  26.                             Console.WriteLine("weishubudui")
  27.                         end if
  28.                     end if
  29.                 end if
  30.             end if
  31.         else
  32.             if dz <> "" then
  33.                 if replace(replace(dz, " ", ""), vbCrLf, "").Length = 32 then
  34.                     Console.WriteLine(EncryptDES(replace(replace(dz, " ", ""), vbCrLf, "").Substring(0, 16), "ydsldsyl"))
  35.                 else
  36.                     if replace(replace(dz, " ", ""), vbCrLf, "").Length = 35 then
  37.                         Console.WriteLine(EncryptDES(replace(replace(dz, " ", ""), vbCrLf, "").Substring(0, 16), "ydsldsyl") & GetDiskVolumeSerialNumber())
  38.                     else
  39.                         if replace(replace(dz, " ", ""), vbCrLf, "").Length = 38 then
  40.                             Console.WriteLine((EncryptDES(replace(replace(dz, " ", ""), vbCrLf, "").Substring(0, 32), "ydsldsyl")).Substring(0, 32) & GetDiskVolumeSerialNumber1().Substring(0, 6))
  41.                         else
  42.                             Console.WriteLine("weishubudui")
  43.                         end if
  44.                     end if
  45.                 end if
  46.             else
  47.                 if qk <> "" then
  48.                     if replace(replace(qk, " ", ""), vbCrLf, "").Length = 32 then
  49.                         Console.WriteLine(EncryptDES(replace(replace(qk, " ", ""), vbCrLf, "").Substring(0, 16), "lsdyydsl"))
  50.                     else
  51.                         if replace(replace(qk, " ", ""), vbCrLf, "").Length = 35 then
  52.                             Console.WriteLine(EncryptDES(replace(replace(qk, " ", ""), vbCrLf, "").Substring(0, 16), "lsdyydsl") & GetDiskVolumeSerialNumber())
  53.                         else
  54.                             if replace(replace(qk, " ", ""), vbCrLf, "").Length = 38 then
  55.                                 Console.WriteLine((EncryptDES(replace(replace(qk, " ", ""), vbCrLf, "").Substring(0, 32), "lsdyydsl")).Substring(0, 32) & GetDiskVolumeSerialNumber1().Substring(0, 6))
  56.                             else
  57.                                 Console.WriteLine("weishubudui")
  58.                             end if
  59.                         end if
  60.                     end if
  61.                 else
  62.                     if sy <> "" then
  63.                         if replace(replace(sy, " ", ""), vbCrLf, "").Length = 36 then
  64.                             Console.WriteLine(EncryptDES(replace(replace(sy, " ", ""), vbCrLf, "").Substring(0, 16), "zhanggnahz") & GetDiskVolumeSerialNumber())
  65.                         else
  66.                             if replace(replace(sy, " ", ""), vbCrLf, "").Length = 38 then
  67.                                 Console.WriteLine((EncryptDES(replace(replace(sy, " ", ""), vbCrLf, "").Substring(0, 32), "zhanggnahz")).Substring(0, 32) & GetDiskVolumeSerialNumber1().Substring(0, 6))
  68.                             else
  69.                                 Console.WriteLine("weishubudui")
  70.                             end if
  71.                         end if
  72.                     end if
  73.                 end if
  74.             end if
  75.         end if
  76.     end sub
  77.     private intCode(126) as integer
  78.     private charCode(24) as Char
  79.     private intNumber(24) as integer
  80.     private charCode1(32) as Char
  81.     private intNumber1(32) as integer
  82.  
  83.     private sub SetIntCode()
  84.         for i as integer = 1 to intCode.Length - 1
  85.             intCode(i) = i mod 9
  86.         next i
  87.     end sub
  88.     private function strEncrypt(byval PasswordString as string) as string
  89.         Return Convert.ToBase64String(System.Text.Encoding.default.GetBytes(PasswordString))
  90.     end function
  91.  
  92.     private function GetRNum() as string
  93.         SetIntCode()
  94.         dim strMNum as string = nothing
  95.         dim strAsciiName as string = ""
  96.         if jc.Length = 27 then
  97.             strMNum = replace(replace(jc, " ", ""), vbCrLf, "").Substring(0, replace(replace(jc, " ", ""), vbCrLf, "").Length - 3)
  98.         else
  99.             if jc.Length = 36 then
  100.                 strMNum = strDecrypt(replace(replace(jc, " ", ""), vbCrLf, "")).Substring(0, strDecrypt(replace(replace(jc, " ", ""), vbCrLf, "")).Length - 3)
  101.             else
  102.                 if jc.Length = 38 then
  103.                     strMNum = replace(replace(jc, " ", ""), vbCrLf, "").Substring(0, 32)
  104.                 end if
  105.             end if
  106.         end if
  107.         if strMNum.Length = 24 then
  108.             for i as integer = 1 to charCode.Length - 1
  109.                 charCode(i) = Convert.ToChar(strMNum.Substring(i - 1, 1))
  110.             next i
  111.             for j as integer = 1 to intNumber.Length - 1
  112.                 intNumber(j) = Convert.ToInt32(charCode(j)) + intCode(Convert.ToInt32(charCode(j)))
  113.             next j
  114.  
  115.             for k as integer = 1 to intNumber.Length - 1
  116.  
  117.                 if (intNumber(k) >= 48 AndAlso intNumber(k) <= 57) OrElse (intNumber(k) >= 65 AndAlso intNumber(k) <= 90) OrElse (intNumber(k) >= 97 AndAlso intNumber(k) <= 122) then
  118.                     strAsciiName &= Convert.ToChar(intNumber(k)).ToString()
  119.                 ElseIf intNumber(k) > 122 then
  120.                     strAsciiName &= Convert.ToChar(intNumber(k) - 10).ToString()
  121.                 else
  122.                     strAsciiName &= Convert.ToChar(intNumber(k) - 9).ToString()
  123.                 end if
  124.             next k
  125.         else
  126.             if strMNum.Length = 32 then
  127.                 for i as integer = 1 to charCode1.Length - 1
  128.                     charCode1(i) = Convert.ToChar(strMNum.Substring(i - 1, 1))
  129.                 next i
  130.                 for j as integer = 1 to intNumber1.Length - 1
  131.                     intNumber1(j) = Convert.ToInt32(charCode1(j)) + intCode(Convert.ToInt32(charCode1(j)))
  132.                 next j
  133.  
  134.                 for k as integer = 1 to intNumber1.Length - 1
  135.  
  136.                     if (intNumber1(k) >= 48 AndAlso intNumber1(k) <= 57) OrElse (intNumber1(k) >= 65 AndAlso intNumber1(k) <= 90) OrElse (intNumber1(k) >= 97 AndAlso intNumber1(k) <= 122) then
  137.                         strAsciiName &= Convert.ToChar(intNumber1(k)).ToString()
  138.                     ElseIf intNumber1(k) > 122 then
  139.                         strAsciiName &= Convert.ToChar(intNumber1(k) - 10).ToString()
  140.                     else
  141.                         strAsciiName &= Convert.ToChar(intNumber1(k) - 9).ToString()
  142.                     end if
  143.                 next k
  144.             end if
  145.         end if
  146.         Return strAsciiName
  147.     end function
  148.  
  149.     private function strDecrypt(byval PasswordString as string) as string
  150.         Return System.Text.Encoding.default.GetString(Convert.FromBase64String(PasswordString))
  151.     end function
  152.     private Keys() as byte = {&H75, &H44, &H36, &H72, &H60, &HAC, &HCF, &HED}
  153.     private function EncryptDES(byval encryptString as string, byval encryptKey as string) as string
  154.         try
  155.             dim rgbKey() as byte = Encoding.UTF8.GetBytes(encryptKey.Substring(0, 8))
  156.             dim rgbIV() as byte = Keys
  157.             dim inputByteArray() as byte = Encoding.UTF8.GetBytes(encryptString)
  158.             dim dCSP as new DESCryptoServiceProvider()
  159.             dim mStream as new MemoryStream()
  160.             dim cStream as new CryptoStream(mStream, dCSP.CreateEncryptor(rgbKey, rgbIV), CryptoStreamMode.write)
  161.             cStream.write(inputByteArray, 0, inputByteArray.Length)
  162.             cStream.FlushFinalBlock()
  163.             Return Convert.ToBase64String(mStream.ToArray())
  164.         catch
  165.             Return encryptString
  166.         end try
  167.     end function
  168.     private function DecryptDES(byval decryptString as string, byval decryptKey as string) as string
  169.         try
  170.             dim rgbKey() as byte = Encoding.UTF8.GetBytes(decryptKey)
  171.             dim rgbIV() as byte = Keys
  172.             dim inputByteArray() as byte = Convert.FromBase64String(decryptString)
  173.             dim DCSP as new DESCryptoServiceProvider()
  174.             dim mStream as new MemoryStream()
  175.             dim cStream as new CryptoStream(mStream, DCSP.CreateDecryptor(rgbKey, rgbIV), CryptoStreamMode.write)
  176.             cStream.write(inputByteArray, 0, inputByteArray.Length)
  177.             cStream.FlushFinalBlock()
  178.             Return Encoding.UTF8.GetString(mStream.ToArray())
  179.         catch
  180.             Return decryptString
  181.         end try
  182.     end function
  183.     private function GetDiskVolumeSerialNumber() as string
  184.         dim _zimu as string = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
  185.         dim _rand as new Random()
  186.         dim _result as string = ""
  187.         for i as integer = 0 to 2
  188.             _result &= _zimu.Chars(_rand.next(52))
  189.         next i
  190.         Return _result
  191.     end function
  192.     private function GetDiskVolumeSerialNumber1() as string
  193.         dim _zimu as string = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
  194.         dim _rand as new Random()
  195.         dim _result as string = ""
  196.         for i as integer = 0 to 15
  197.             _result &= _zimu.Chars(_rand.next(52))
  198.         next i
  199.         Return _result
  200.     end function
  201. end Module
  202.  
Parsed in 0.115 seconds