Powershell encryption and decryption

Dear expert

I would like to use Powershell to encrypt a file, then decrypt the file with a key. Is this possible to do? Using RSA 1024keys.
First I need to generate a key file and then I need to use that key file to open the encrypted file.

Who is Participating?
Hasin Ahmed ChoudharyExchange AdministratorCommented:
Try this script https://gallery.technet.microsoft.com/Encryption-and-Decryption-f2476bb8
 It uses openssl.exe toll inside the PS script.

You can try to use any other tool  as in this link: https://www.makeuseof.com/tag/file-encryption-windows-powershell/
WeTiAuthor Commented:
Hi, thanks for the tips, I tried with the openssl way, it's working but you need to have openssl  same version to make things work now, i just tried: openssl 1.1.0h  version encryption and openssl 0.9.8h version. I encrypt the files in 1.1 version and tried to open with a older versin, same encryption method but didn't work, error message: Bad decryption.
WeTiAuthor Commented:
Openssl need to be in same version... or lower the encryption method to make it works. Newer version use a new encyption directory.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.