php-general Digest 24 May 2008 12:33:25 -0000 Issue 5476

Topics (messages 274654 through 274657):

Re: PHP authenticating user over SSL
        274654 by: Jay Blanchard
        274655 by: Manuel Lemos

openssl encryption
        274656 by: Christian Lerrahn

Re: autoload issues
        274657 by: Bojan Tesanovic

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
[snip]
Where do I post feature requests for PHP?

I need some functions in PHP to let a user log on to a server with his 
SSL client certificate. I mean, when a user has his own SSL client 
certificate, then a server should be able to log the user in without 
needing user name and password. Wouldn't that be a great improvement in 
PHP? Is it possible at all?
[/snip]

You're going to need client side technology to read the local
certificate and pass the data to the server side PHP process. Likely you
would have to have a cookie as not even JavaScript can read client side
files (security). So the user would download a certificate from a site
that creates a cookie.

--- End Message ---
--- Begin Message ---
Hello,

on 05/23/2008 05:06 PM Gunnar Vestergaard said the following:
> Where do I post feature requests for PHP?
>
> I need some functions in PHP to let a user log on to a server with his
> SSL client certificate. I mean, when a user has his own SSL client
> certificate, then a server should be able to log the user in without
> needing user name and password. Wouldn't that be a great improvement in
> PHP? Is it possible at all?

That is not quite the role of PHP. Apache does the necessary SSL client
verification when you use the directive SSLVerifyClient . Here you may
find more details on what variables to check when the user provides a
valid client certificate.

http://wiki.egee-see.org/index.php/Simple_Apache-SSL_integration_and_DN-based_authentication

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--- End Message ---
--- Begin Message ---
HI,
I'm trying to encrypt and decrypt data in my PHP scripts using the
openssl API. However, while the encryption seems to work, I cannot
decrypt what I encrypted.

The keys I use have been produced the following way.

openssl req -x509 -nodes -days 365  -newkey rsa:4096 -keyout
example.key -out example.crt openssl x509 -in example.crt -pubkey
-noout > example.pub

I now try the following for encryption

$key = file_get_contents('example.pub');
$flag = openssl_public_encrypt($data,$encrypted,$key);

which seems to work fine.

Now, I try to decrypt as

$flag = openssl_private_decrypt($data,$decrypted,$key);
$key = file_get_contents('example.key');

This will result in

error:0407106B:rsa routines:func(113):reason(107)
error:04065072:rsa routines:func(101):reason(114)

Which according to 'openssl errstr' means
error:0407106B:rsa routines:RSA_padding_check_PKCS1_type_2:block type
is not 02 error:04065072:rsa routines:RSA_EAY_PRIVATE_DECRYPT:padding
check failed

Wht am I doing wrong?

I'm using PHP 4.3.9 which I cannot upgrade because I don't have full
control over the server. :(

I've also tried explicitly setting the padding type but to no avail.

Cheers,
Christian

--- End Message ---
--- Begin Message --- Can you be more specific, the structure of directories what encoder did you use can you provide a sample
PHP encoded class/script ...

On May 23, 2008, at 5:27 PM, Joakim Ling wrote:

Anyone have a solution for using autoload with encoded php files?

Bojan Tesanovic
http://www.carster.us/





--- End Message ---

Reply via email to