Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8814953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:15:22+00:00 2026-06-14T04:15:22+00:00

I need to decrypt a message encrypted using RSA but I only have the

  • 0

I need to decrypt a message encrypted using RSA but I only have the Modulus and the Private Exponent as Base64 strings.

My approach was to create a RSAParameter object and import it using the RSACryptoProvider.ImportParameters method:

RSAParameters decryptParameters = new RSAParameters();

// D is the private exponent parameter
decryptParameters.D = Convert.FromBase64String(d);

// n is the Modulus
decryptParameters.Modulus = Convert.FromBase64String(n);

RSACryptoServiceProvider decrypter = new RSACryptoServiceProvider();
try
{
     decrypter.ImportParameters(decryptParameters);
}
catch (Exception ex)
{
    MessageBox.Show(ex.Message);
}

The problem is that I allways get a “Bad Data” CryptographycException.

What am I doing wrong?

Have I to initialize other values in the RSAParameters structure? Which ones? Theoretically, the Private Key used to decrypt messages should be (n, d) being n the Modulus parameter but the implementation seems to need some more info.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:15:24+00:00Added an answer on June 14, 2026 at 4:15 am

    In theory you should only need the modulus and private exponent to decrypt. However API wise, because they use an optimization based on chinese remainder theorem, you need the original primes too, and with those primes also you need to precompute dP,dQ and Qinv.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to decrypt a file which is encrypted using a private key. I
I have an encrypted bit of text that I need to decrypt. It's encrypted
I have some encrypted NSString store in a transformable field. I need to decrypt
I need to encrypt and decrypt short strings (Ex. 'product1234'). I have used mcrypt_encrypt
I need a PHP script to decrypt the RSA encrypted string generated by this
I have to decrypt an encrypted message in C program which has been encrypted
I need to decrypt encrypted POST value strings with the aid of a secret
I need to encrypt and decrypt (using a secret key) documents (namely pdf). Is
I have this function I am using to decrypt values that works fine on
In my current iPhone project I need to decrypt zip files which have been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.