Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function DecodeStringWithXORFromHex()
  2. {
  3.     Param
  4.     (
  5.         $String,
  6.         $Key
  7.     )
  8.  
  9.     While ($Key.Length -lt $String.Length/2)
  10.     {
  11.         $Key+=$Key
  12.     }
  13.  
  14.     $DecodedResult = ""
  15.     for($x = 0; $x -lt ($String.length); $x+=2)
  16.     {
  17.         $xorValueAsHexString = $String.Substring($x, 2)
  18.        
  19.         $value1 = [int]::Parse($xorValueAsHexString,'HexNumber')
  20.        
  21.         $value2 = [byte][char]$Key.Substring($x/2, 1)
  22.  
  23.         $xorValue = $value1 -bxor $value2
  24.  
  25.         $DecodedResult+= [char]$xorValue
  26.     }
  27.     Write-Output $DecodedResult
  28. }
  29.  
  30. $URL = "b6d9ca9fad9791c0a9dac9c1bbdbdb81aacfcc86aac8908cb183cb84f1c8918dadc4da8aad80d28abbc9cdc2ec9d8fd6f3d9d78cb5c8ca9cf3988fd9ea9886d8e79f8fda"
  31. $Stringy = "bf9fddd8eecf87dcbf9bdddce6988bd7ec98da8ebfcf888abb958cd7e69cdf8c"
  32.  
  33. $Key = 'BSides Leeds 2019' ## ? this is whats being hinted at
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement