Jump to content

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.


Thanks
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.