At 09:51 PM 3/4/2003 -0800, you wrote:
PROBLEM :I had been trying to encrypt and decrypt data using RSA algorithm it works well till 80 characters but after that it shows abnormal program termination exact error message :Abnormal program Termination Code Sample:

<snip>


 RSAES_OAEP_SHA_Decryptor priv(randPool, keyLength);
 HexEncoder privFile(new FileSink(privFilename));
 priv.DEREncode(privFile);
 privFile.MessageEnd();

 RSAES_OAEP_SHA_Encryptor pub(priv);
 HexEncoder pubFile(new FileSink(pubFilename));
 pub.DEREncode(pubFile);
 pubFile.MessageEnd();
}

I am no expert, so I hope this is not incorrect, but I think 80 is your max bytes per block. RSA + OAEP has padding. When you have a 1024-bit key you get 128 bytes per message minus the header + padding. 48 bytes seems a little high, but certainly possible. When you are encrypting long strings you have to break them up into blocks. Turn your encrypt and decrypt into a loop using MaxPlainTextLength for the most you can encrypt in one call. I am not familiar with the PK_EncryptorFilter, so if that is supposed to handle arbitrary length messages and do what I suggest internally, my apologies and ignore this message.
HTH.
michael




Reply via email to