Skip to content

The data to be decrypted exceeds the maximum for this modulus of 256 bytes. #7

@kmajeed

Description

@kmajeed

Hi

I am trying to decrypt cipher text using a key which was given to me. The key is in PEM format. It looks like

-----BEGIN RSA PRIVATE KEY-----
XXXX Removed this content XXXX
-----END RSA PRIVATE KEY-----

The cipher text if of length 512 chars (Base64). The length of my private key is 1588 chars (Base64)/2048 in bytes. When trying to decrypt this cipher text with private key the function:

byte[] DecryptBytes(string inputString, RSACryptoServiceProvider key)

throws the following exception,

The data to be decrypted exceeds the maximum for this modulus of 256 bytes.

FYI, by putting a breakpoint I can see that the base64BlockSize = 258 bytes
Can you please assist me in fixing this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions