Re: openssl_public_encrypt() length limitation

From: Date: Sat, 24 Jan 2004 21:25:15 +0000
Subject: Re: openssl_public_encrypt() length limitation
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-7320@lists.php.net to get a copy of this message
On Sat, 24 Jan 2004 18:26:15 +0000 Timm Friebe <thekid@thekid.de> wrote: > Hello, > > first of all, I'm not into this at all, a colleague at work told me > about this. The following is the problem: When enrypting data with > openssl_public_encrypt(), this goes well up to a certain length > (tested limit: 245 bytes of data to be encrypted), but as of a certain > length(246 bytes), the function returns FALSE with no note whatsoever > why it went wrong. > > Is this expected behaviour? Is the length of the input data limited or > constrained by the length of the public key? In this case, shouldn't > there be a warning? The maximum length of the input depends of the padding mode: PKCS1_PADDING max=rsalength-1 PKCS1_OAEP_PADDING max=rsalength-4 AFAIR :) Everyone with more clue: correct me if I'm wrong :) pierre

« previous php.internals (#7320) next »