Hi Thomas,

Just so you know who I am, I'm the openssl extension maintainer :-)

I'd like to see your patch integrated into a more generic encryption
function call, where the cipher is passed as a parameter.

So, I don't think we will integrate your patch as-is, but do think
we can implement the same functionality using a function something
like this:

mixed openssl_cipher_encrypt(int cipher, string key, string plaindata);
mixed openssl_cipher_decrypt(int cipher, string key, string cryptdata);

The functions would return false on error or the (de)crypted string
on success.
The ciphers would be registered as constants like this:
OPENSSL_CIPHER_BF_CFB64
OPENSSL_CIPHER_XXXXX

Could you log your patch as a feature request using bugs.php.net so
that I can find it when I get around to implementing this?

If you are able, it would be really, really appreciated if you could
help with the groundwork for this: if you can find out how to do this
generic encryption using C code (it doesn't have to work with PHP; it
can be a small hacked up C program) and post it along with your original
patch, it would help a great deal!
I tend to use the source for the openssl command line program as a guide,
so that's where to check first.

To get the idea of what I talking about we want something like this:

CIPHER_METHOD cipher; // This is a pointer to the cipher method

switch(cipher_number) {
case OPENSSL_CIPHER_BF_CFB64:
  cipher = CIPHER_BLOWFISH;
}

CIPHER_Encrypt(cipher, key, data);

So we just need to find out the names and types of the ciphers and
related functions.

Thanks for your contribution!

--Wez.

[Stuff about blowfish encrypt/decrypt was eaten by my MTA]

PS: I've Cc'd this to Derick who is working on a generic encryption
extension for PHP and who might have some comments on the API,
although he is on vacation at the moment.



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to