From the Powershell console, I enter the following 4 lines one at a time.
$rsa = New-Object System.Security.Cryptography.RSACryptoServiceProvider(1024) $PrivateKey = $rsa.ToXmlString($true) $PublicKey = $rsa.ToXmlString($false) $OriginalText = "Now is the time."
How do I test encrypting and decrypting?
The next 2 lines are pseudo code:
$EncryptedText = $rsa.Encrypt($OriginalText, $PrivateKey) $DecryptedText = $rsa.Decrypt($EncryptedText, $PublicKey)
Sorry if this is not what the intended use was for asymmetric encryption. But I like the idea of being able to encrypt a string with one key and decrypt it with another.
Thank you for your help.