Skip to content

Instantly share code, notes, and snippets.

@peewpw
Created December 3, 2017 23:40
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save peewpw/2fc092ac51ed4b554d530da8fd93537c to your computer and use it in GitHub Desktop.
Save peewpw/2fc092ac51ed4b554d530da8fd93537c to your computer and use it in GitHub Desktop.
param (
[string]$in = $( Read-Host "Please specify a file to encode with -in" ),
[string]$out = $( Read-Host "Please specify an output file with -out" )
)
if (-Not (Test-Path $in)) { Read-Host "Please specify a valid filepath" }
$str = [System.IO.File]::ReadAllText($in)
$bytes = [System.Text.Encoding]::Ascii.GetBytes($str)
for($i=0; $i -lt $bytes.count; $i++) {
$bytes[$i] = $bytes[$i] -bxor 0x71
}
[Convert]::ToBase64String($bytes) | Out-File $out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment