Hi Herbert,

The second call to ProcessBlock is using 'cipher' when presumably
'cipher1' is intended. Also you are using 'blockLength' for the length
in that call, when it should just be 'encrypted.length'.

Also, what are you trying to do with the data here, encrypt/decrypt it
or sign/verify it? Please check that you don't have the public and
private keys mixed up in the Init calls.

Regards,
Pete Dettman


On 6/9/20 2:29 am, Herbert Falk wrote:
>             IAsymmetricBlockCipher cipher1 = new Pkcs1Encoding(new
> RsaEngine());
>             cipher1.Init(false, rsaPublic);
>             try
>             {
>                 int blockLength = cipher1.GetInputBlockSize();
>                 retValue = cipher.ProcessBlock(encrypted, 0, blockLength);
>             }
>             catch(Exception ex)
>             {
>                 string emsg = ex.ToString();
>             }
>  
> The encryption works, however the decrypt throws the exception {"input
> data too large (Parameter 'inLen')"}.  The blocksize is: 0x00000100 And
> the size of encrypted is: {byte[0x00000100]}
>  
> Any ideas about why the exception is being thrown



Reply via email to