Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7320 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65519 invoked by uid 1010); 24 Jan 2004 21:25:45 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 65495 invoked from network); 24 Jan 2004 21:25:45 -0000 Received: from unknown (HELO smtp2.netcologne.de) (194.8.194.218) by pb1.pair.com with SMTP; 24 Jan 2004 21:25:45 -0000 Received: from localhost.localdomain (xdsl-213-196-208-63.netcologne.de [213.196.208.63]) by smtp2.netcologne.de (Postfix) with SMTP id AE46E3A06C; Sat, 24 Jan 2004 22:25:29 +0100 (MET) Date: Sat, 24 Jan 2004 22:25:15 +0100 To: Timm Friebe Cc: internals@lists.php.net Message-ID: <20040124222515.71c59b5e.paj@pearfr.org> In-Reply-To: <1074968775.249.21.camel@localhost> References: <1074968775.249.21.camel@localhost> Organization: Freelancer X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i586-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] openssl_public_encrypt() length limitation From: paj@pearfr.org (Pierre-Alain Joye) On Sat, 24 Jan 2004 18:26:15 +0000 Timm Friebe 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