Month: April 2015

  • Encrypting strings with custom keys in powershell

    Since the ConvertTo-SecureString is not really secure, and neither is the EncodedCommand (base64string) I made two short functions to encrypt and decrypt strings in order to send them across the void unharmed. Function Encrypt-String{ Param( [Parameter( Mandatory=$True, Position=0, ValueFromPipeLine=$true )] [Alias(“String”)] [String]$PlainTextString, [Parameter( Mandatory=$True, Position=1 )] [Alias(“Key”)] [byte[]]$EncryptionKey ) Try{ $secureString = Convertto-SecureString $PlainTextString -AsPlainText…