Jump to content


This topic is now archived and is closed to further replies.


Encrypting both ways without a library

Recommended Posts

I'm currently trying to write a function that will work on all systems (Win/*nix) without any extra PHP modules, that will allow me to both encrypt and decrypt a string.
Now this obviously throws Mcrypt and Md5 out of the running... So what do I use? Are there ANY PHP functions that can encrypt and decrypt, that don't require any extra libraries?
I'd prefer not to write my own encryption class but I will if nothing else exists.


Share this post

Link to post
Share on other sites
If you're using a MySQL database, you can use MySQL's encryption utilities, that's pretty well cross-platform and easy. Just SELECT AES_ENCRYPT('mystring', 'mykey');

If you do it in PHP, you need the mcrypt extension.. pretty tough to get around that, but you can abstract it in your application so that it's easier to port.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.