Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47785 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13311 invoked from network); 5 Apr 2010 09:31:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Apr 2010 09:31:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=indeyets@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=indeyets@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.215 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: indeyets@gmail.com X-Host-Fingerprint: 209.85.219.215 mail-ew0-f215.google.com Received: from [209.85.219.215] ([209.85.219.215:54141] helo=mail-ew0-f215.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A8/66-06298-CDDA9BB4 for ; Mon, 05 Apr 2010 05:31:09 -0400 Received: by ewy7 with SMTP id 7so551676ewy.11 for ; Mon, 05 Apr 2010 02:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=NhAljng7vYQvShBFLZlq+Gm3/A9Uxq0L38vt5iazXv4=; b=cJ4UcBLKs6isdYLlUKehOzqYm/QxRxwnpeJmcacqm0YfkJnIdM6957Dgby6p0wKWAr kgA3tvk5Yac+6GTGOywq6p522PaHlc6u4nQceC2L7V2cDIy51QtRhrbQwuLqwxhq96vi j8aWg+9fAH2XIxA86ymL8yYxq3B6pVwhbvLq8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=spMZ5spVuUS9nnL9NmGFQjrhQ95HJJowOD6+i/6PFUF/fj2KfSP+OVkqUW6TcFY66r nY78r6jDejnBi/rGDGKPj05wYp1V7pL/BX0h0xNajRlSlZh8WlzkxW7UDpjZwrVlg/0+ TaZWmzMy1d5Yr0oPVIpJMvrbp6w20esZFYIt4= Received: by 10.213.48.211 with SMTP id s19mr2867626ebf.77.1270459866178; Mon, 05 Apr 2010 02:31:06 -0700 (PDT) Received: from nirvana.lan ([93.185.190.227]) by mx.google.com with ESMTPS id 15sm6209798ewy.8.2010.04.05.02.31.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 05 Apr 2010 02:31:05 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=windows-1252 In-Reply-To: <1C2DBDD3-7E10-4BA5-96BB-149E5927FB53@nixspot.com> Date: Mon, 5 Apr 2010 13:31:03 +0400 Cc: PHP Development Content-Transfer-Encoding: quoted-printable Message-ID: <947083F8-540F-4D2B-ADDC-0C141600CAEA@gmail.com> References: <8C41621B-56E9-4AA7-BAB5-4330683E6C63@railmail.me> <1C2DBDD3-7E10-4BA5-96BB-149E5927FB53@nixspot.com> To: donald sullivan X-Mailer: Apple Mail (2.1078) Subject: Re: [PHP-DEV] unsigned chars From: indeyets@gmail.com (Alexey Zakhlestin) Use "reply all" when writing to mailing-list. On 05.04.2010, at 13:18, donald sullivan wrote: > what i am trying to do is RSA encryption >=20 > I have a working setup doing encryption and decryption at the same = time. i want to store the encrypted value and be able to decrypted it = later >=20 > if i encrypt the data and send the data straight to the decrypt = function it works fine >=20 > int decryptRetVal =3D RSA_public_decrypt(512, Buffer, plainText, = rsaPubKey, RSA_PKCS1_PADDING); >=20 > if i try to send the output of the encryption to the php side for = storage, or even write it to a file and then read that file for = decryption it fails every time >=20 > int decryptRetVal =3D RSA_public_decrypt(512, (unsigned char = *)Z_STRVAL(zret), plainText, rsaPubKey, RSA_PKCS1_PADDING); >=20 > how can i store the encrypted output for later use? well, it should work you don't give details, so I can't say what are you doing wrong. I can give you only generic debugging advices: make sure that the data you store on php-side is equivalent to the data = you expect to get on C-level. If it is not =97 try to locate the step which corrupts the data, etc.=