The function RSA_public_encrypt requires that the variable where encrypted text will be saved, should have a length of RSA_size(*rsa) bytes. Now, I need to know how big could be the text to encrypt, because if I crypt a little string (for example "asdasd"), there's no problem, but if I try with a bigger string, just a portion of it it's crypt.
1 に答える
1
あなたが話していると仮定するとRSA_public_encrypt()
、ドキュメントはそれをかなり明確に述べています:
flenは、PKCS#1 v1.5ベースのパディングモードの場合はRSA_size(rsa)-11未満、RSA_PKCS1_OAEP_PADDINGの場合はRSA_size(rsa)-41未満、RSA_NO_PADDINGの場合は正確にRSA_size(rsa)未満である必要があります。
これらはブロック暗号であることに注意してください。通常、入力をブロックに分割し、ブロックを1つずつ暗号化機能にフィードする必要があります。
于 2012-08-29T11:11:21.677 に答える