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

  • Home
  • SEARCH
  • 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 8252827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:40:09+00:00 2026-06-08T00:40:09+00:00

Possible Duplicate: RSA Encryption, getting bad length I am trying to encrypt a large

  • 0

Possible Duplicate:
RSA Encryption, getting bad length

I am trying to encrypt a large string using RSA. .NET’s default implementation lets me encrypt easily small strings, but when I pass large one it throws a CryptographyException: Bad length.

I would like to overcome this, but the problem is that I need to pass the encypted string to another application which I cannot modify (because it’s not mine 😉

So is there an RSA implementation which I can use to load X509 Public Key and then encrypt large strings?

Thank you

  • 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-08T00:40:11+00:00Added an answer on June 8, 2026 at 12:40 am

    You will need to contrive something in order to accomplish this, perhaps by splitting it into blocks and encrypting each block.

    It’s not working because the plaintext length in RSA encryption is limited by the length of the key, i.e. it is impossible to encrypt a piece of data larger than the key used to encrypt it. Generally, a one-off exchange of a symmetric key is performed with RSA, and an agreed-upon symmetric algorithm is used from there.

    Also, RSA is (compared to symmetric algorithms) very computationally expensive and breaking large data into many dozens (perhaps hundreds?) of small blocks would suffer terrible performance problems, you’d probably only be able to encrypt a few megabytes per second.

    Strongly consider an alternate approach.

    Edit: Also, consult the documentation of the program that must accept these encrypted strings, because it doesn’t help you to use some nonstandard way of encrypting them if the program will be unable to decrypt them.

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

Sidebar

Related Questions

Possible Duplicate: How do I make a request using HTTP basic authentication with PHP
Possible Duplicate: regex for URL including query string I have a text or message.
Possible Duplicate: Why is String.Concat not optimized to StringBuilder.Append? One day I was ranting
Possible Duplicate: std::string and its automatic memory resizing I am just curious, how are
Possible Duplicate: Difference of create Index by using include column or not using Edit:
Possible Duplicate: Parse C# string to DateTime I am facing a problem while converting
Possible Duplicate: .NET Enumeration allows comma in the last field public enum SubPackageBackupModes {
Possible Duplicate: .NET - What’s the best way to implement a catch all exceptions
Possible Duplicate: How do you send email from a Java app using Gmail? How
Possible Duplicate: Convert a long hex string in to int array with sscanf I

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.