Advertisement
Washi

Reversed encryption method

Jul 17th, 2017
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.90 KB | None | 0 0
  1.     Public Function Decrypt(StringToDecrypt As String) As String
  2.    
  3.         Dim builder As New StringBuilder()
  4.  
  5.         Dim index = 0
  6.         While index < StringToDecrypt.Length
  7.             Dim length = Integer.Parse(StringToDecrypt(index).ToString())
  8.             Dim strConvertToBase = StringToDecrypt.Substring(index+1, length)
  9.             index += 1 + length
  10.  
  11.             Dim dblWithRandom As Double = 0
  12.             For intCountPower = 0 To length - 1
  13.                 'strConvertToBase = strConvertToBase & Chr(Int(dblWithRandom / (93 ^ intCountPower)) + 33)
  14.                 'dblWithRandom = dblWithRandom Mod 93 ^ intCountPower
  15.                 Dim newRandom = (Asc(strConvertToBase(strConvertToBase.Length - 1 - intCountPower)) - 33) * (93 ^ intCountPower)
  16.                 dblWithRandom += newRandom
  17.             Next
  18.  
  19.             'dblWithRandom = Mid(dblMultiRandom, 1, 2) & intRandomNumber & Mid(dblMultiRandom, 3, 2)
  20.             Dim withRandomString As String = dblWithRandom.ToString()
  21.             Dim multiRandom = Integer.Parse(withRandomString.Substring(0, 2) &  withRandomString.Substring(withRandomString.Length - 2))
  22.             Dim intRandomNumber = Integer.Parse(withRandomString.Substring(2, withRandomString.Length - 4))
  23.            
  24.             'dblMultiRandom = intAddNinetyNine * intRandomNumber
  25.             Dim addNinetyNine = multiRandom / intRandomNumber
  26.  
  27.             'intAddNinetyNine = intInverseAsc + 99
  28.             Dim inverseAsc = addNinetyNine - 99
  29.            
  30.             'intInverseAsc = 256 - intAscCurrentChar
  31.             Dim ascCurrentChar = 256 - inverseAsc
  32.            
  33.             'intAscCurrentChar = Asc(strCurrentChar)
  34.             Dim currentChar = Chr(ascCurrentChar)
  35.            
  36.             'strCurrentChar = Mid(StringToEncrypt, dblCountLength, 1)
  37.             builder.Append(currentChar)
  38.         End While
  39.  
  40.         return builder.ToString()
  41.     End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement