modernaesthetics

RXOR - VB.NET

Jun 7th, 2018
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.80 KB | None | 0 0
  1.     '------------------
  2.     'Creator: aeonhack
  3.     'Site: elitevs.net
  4.     'Created: 9/20/2012
  5.     'Changed: 9/20/2012
  6.     'Version: 1.0.0
  7.     '------------------
  8.     Public Function RXOR(data As Byte(), key As Byte()) As Byte()
  9.         Dim N1 As Integer = 11
  10.         Dim N2 As Integer = 13
  11.         Dim NS As Integer = 257
  12.  
  13.         For I As Integer = 0 To key.Length - 1
  14.             NS += NS Mod (key(I) + 1)
  15.         Next
  16.  
  17.         Dim T(data.Length - 1) As Byte
  18.         For I As Integer = 0 To data.Length - 1
  19.             NS = key(I Mod key.Length) + NS
  20.             N1 = (NS + 5) * (N1 And 255) + (N1 >> 8)
  21.             N2 = (NS + 7) * (N2 And 255) + (N2 >> 8)
  22.             NS = ((N1 << 8) + N2) And 255
  23.  
  24.             T(I) = data(I) Xor CByte(NS)
  25.         Next
  26.  
  27.         Return T
  28.     End Function
Advertisement