Need scripts to do public/private encryption/decryption in Powershell


hi,

i can symmetric encryption/decryption in powershell ok don't seem able figure-out doing public/private keys. many moving parts!  have sample code me started?

thanks.

it looks like, in solution, have download assemblies.

here question - looking encrypt rsa, or generate public/private keypair, send off public key , encrypt private?

you can use rsacryptoserviceprovider generate keypair pretty in .net. however, rsa not typically used encrypting large amounts of data - symmetric ciphers (like aes) typically used that.

for example... might run following command:

$rsa = new-object system.security.cryptography.rsacryptoserviceprovider(2048)

now $rsa contain public/private keypair. can export $rsa.toxmlstring($true) | out-file keys.xml

note $true exports public , private  key. $false export private key. should (i believe, else might know better) able use these keys secure password in symmetric cipher.   of course, whoever you're sending need generate keypair.

give try.


g. samuel hays




Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

WIMMount (HSM) causing cluster storage to go redirected (2012r2 DC)

Failed to delete the test record dcdiag-test-record in zone test.com

Azure MFA with Azure AD and RDS