By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,853 Members | 2,144 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,853 IT Pros & Developers. It's quick & easy.

AES Written in PHP?

P: n/a
Is anyone aware of any already-written code I can use that implements
AES-192 in PHP?

BACKGROUND:

I don't have mcrypt compiled into my PHP, and I have an application where I
need to encrypt and decrypt 128 bits (1 block only) using AES-192.

My plan is to implement AES in PHP (directly, as PHP code).

I did a speed test with PHP, and a loop with 10,000 iterations, with each
iteration containing several bitwise manipulations and random number
generations, required 0.11 seconds to complete on my server. I'm sure that
one block of AES is less CPU cycles than that, so the upper limit on the
server time to do one block should be 0.11 seconds of server time. This is
OK for my application.

If somebody has code already, this would be easier ...

Thanks.
--
David T. Ashley (dt*@e3ft.com)
http://www.e3ft.com (Consulting Home Page)
http://www.dtashley.com (Personal Home Page)
http://gpl.e3ft.com (GPL Publications and Projects)
May 16 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
C.
On 16 May, 16:50, "David T. Ashley" <d...@e3ft.comwrote:
Is anyone aware of any already-written code I can use that implements
AES-192 in PHP?
Is this different from RIJNDAEL-192 (available in mcrypt)?

C.
May 16 '07 #2

P: n/a
"C." <co************@gmail.comwrote in message
news:11**********************@p77g2000hsh.googlegr oups.com...
On 16 May, 16:50, "David T. Ashley" <d...@e3ft.comwrote:
>Is anyone aware of any already-written code I can use that implements
AES-192 in PHP?

Is this different from RIJNDAEL-192 (available in mcrypt)?
RIJNDAEL-192 is AES-192. Same thing.

The issue is that I get my PHP packages precompiled, without mcrypt, and it
is my understanding that I'd have to recompile PHP with an extra option to
get mcrypt functionality. I don't want to do that if I don't have to.

Did I get the technical details wrong?

Thanks.
--
David T. Ashley (dt*@e3ft.com)
http://www.e3ft.com (Consulting Home Page)
http://www.dtashley.com (Personal Home Page)
http://gpl.e3ft.com (GPL Publications and Projects)
May 16 '07 #3

P: n/a
At Wed, 16 May 2007 15:37:10 -0400, David T. Ashley let his monkeys type:
"C." <co************@gmail.comwrote in message
news:11**********************@p77g2000hsh.googlegr oups.com...
>On 16 May, 16:50, "David T. Ashley" <d...@e3ft.comwrote:
>>Is anyone aware of any already-written code I can use that implements
AES-192 in PHP?

Is this different from RIJNDAEL-192 (available in mcrypt)?

RIJNDAEL-192 is AES-192. Same thing.

The issue is that I get my PHP packages precompiled, without mcrypt, and it
is my understanding that I'd have to recompile PHP with an extra option to
get mcrypt functionality. I don't want to do that if I don't have to.

Did I get the technical details wrong?

Thanks.
You could load the module from your code using dl(). It is not ideal,
slow, but in the given situation...
http://www.php.net/manual/en/function.dl.php

HTH
Sh.
May 16 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.