Re: openssl module for php

From: Date: Fri, 04 May 2001 20:43:04 +0000
Subject: Re: openssl module for php
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-53961@lists.php.net to get a copy of this message
> On Fri, May 04, 2001 at 09:09:51PM +0100, Wez Furlong wrote: > > On 2001-05-04 20:47:25, "Stig Venaas" <venaas@php.net> wrote: > > > Even though it is 4 functions, I think users will find it easier to > > > work with functions called openssl_public_encrypt, > > > openssl_private_decrypt etc. It also separates them from possible > > > symmetric enryption later on. > > > > So are we looking at openssl_asym_public_encrypt() (or is the asym part > > redundant by implication?). > > I think that's pretty clear, but... But? > > IMHO, I prefer to spell it out - especially to those new to openssl (I'm > > fairly new to it!) it helps to have things spelled out. That way, you > > don't have to be an openssl hacker to benefit from the PHP interface. > > > > > I think it's generally better to not alter arguments, better return it > > > this way. Is it good enough to report errors by returning an empty > > > string? I think so. > > > > Can an empty string become an non-empty string when encrypted? > > If so, when we decrypt it, we will not be able to distinguish > > thecorrectly decrypted empty string from an error condition. > > Good point > > > We could return false (as is the convention), but then everyone would > > have to use === to check it correctly. > > Yes, and not everyone will... > > Sascha also has a point regarding consistency with the existing > functions, and I was the one who chose that interface... The reason > was to have something that looked a bit like the C API, and to make > the interface as clear as possible. > > So, I withdraw that comment (: > > I don't know for sure and I don't care to check right now, do you know > if we always can see if the key is public or private? In that case, we > don't need separate functions. Rather than showing my ignorance, I > should investigate myself I guess (: We could do that, but then we'd have to add something else telling the user this isn't symmetric encryption :) > Well, I think I'll leave this to you, haven't got that much sensible > to say, and I'm busy with something else... I prefer to have it separate, but that's just my personal opinion. Sascha

« previous php.dev (#53961) next »