Last active
March 14, 2017 07:55
-
-
Save WimObiwan/fd21232cea6c6190033e69ffba06498d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$key = @{} | |
# First 1-on-1 mapping of all characters | |
for ($i = 0; $i -le 255; $i++) { $key[[char]$i] = [char]$i } | |
#Shift all alphabet characters on character backwards | |
for ($i = [byte][char]'B'; $i -le [byte][char]'Z'; $i++) { $key[[char]$i] = [char]($i - 1) } | |
$key[[char]'A'] = [char]'Z' | |
for ($i = [byte][char]'b'; $i -le [byte][char]'z'; $i++) { $key[[char]$i] = [char]($i - 1) } | |
$key[[char]'a'] = [char]'z' | |
$text = 'Ojfnboe mbbu ifu bdiufstuf wbo ajko upoh ajfo. Ffo jfnboe xffu nffs nbbs hffgu wppsmpqjh ojfut qsjkt. Pg njttdijfo updi xfm? Lfo kjk ef jefoujufju wbo ef npm?' | |
-join ($text.ToCharArray() | foreach { $key[$_] }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment