C# RSA encryption-decryption with my own key

Tee Phitakgul
2 min readJan 22, 2021

C# RSA encryption-decryption SHA256 1024bit with my own private key, public key — generated with cmd or PowerShell on OpenSSL or RSACryptoServiceProvider XML.

OpenSSL generates the private key and public key.

Example1

1.Create RSA private key 1024

>openssl genrsa -out rsa-private.txt 1024

2.Create RSA public key with private key

>openssl rsa -in .\rsa-private.txt -out rsa-public.txt -pubout -outform PEM

You got a result 2 file in the directory (rsa-private.txt & rsa-public.txt)

Now we will be coding with encryption-decryption

Output

--

--