Archived Forum Post

Index of archived forum posts

Question:

RSA Decrypt using Private Key in PEM File

Jul 14 '16 at 12:56

I have short strings that I receive from another Web app that are encrypted with RSA-2048. The keypairs were generated on a CentOS server like this:

ssh-keygen -t rsa -f thekey -N '' -b 2048
cat thekey > ../priv.pem
ssh-keygen -f thekey.pub -e -m pem > ../pub.pem

Can your RSA library use this private key to decrypt strings encrypted using the public key above?

As an example, I encrypted the string "20052829374" using the public key and base64 encoded it (attached) and need to be able to decrypt it using the attached private key from C#.

If you have a code sample, it would be great.


Answer

Here's an example:

Android: RSA Decrypt using PEM

C: RSA Decrypt using PEM

C#: RSA Decrypt using PEM

C# UWP/WinRT: RSA Decrypt using PEM

C++: RSA Decrypt using PEM

Classic ASP: RSA Decrypt using PEM

DataFlex: RSA Decrypt using PEM

Delphi ActiveX: RSA Decrypt using PEM

Delphi DLL: RSA Decrypt using PEM

Java: RSA Decrypt using PEM

Lianja: RSA Decrypt using PEM

MFC: RSA Decrypt using PEM

Node.js: RSA Decrypt using PEM

Objective-C: RSA Decrypt using PEM

Perl: RSA Decrypt using PEM

PHP ActiveX: RSA Decrypt using PEM

PHP Extension: RSA Decrypt using PEM

PowerBuilder: RSA Decrypt using PEM

PowerShell: RSA Decrypt using PEM

PureBasic: RSA Decrypt using PEM

Python: RSA Decrypt using PEM

Ruby: RSA Decrypt using PEM

SQL Server: RSA Decrypt using PEM

Swift: RSA Decrypt using PEM

Tcl: RSA Decrypt using PEM

Unicode C: RSA Decrypt using PEM

Unicode C++: RSA Decrypt using PEM

VB.NET: RSA Decrypt using PEM

VB.NET UWP/WinRT: RSA Decrypt using PEM

VBScript: RSA Decrypt using PEM

Visual Basic 6.0: RSA Decrypt using PEM

Visual FoxPro: RSA Decrypt using PEM

Xojo Plugin: RSA Decrypt using PEM