Jump to content


Encrypting both ways without a library

  • Please log in to reply
1 reply to this topic

#1 Nolongerused3921

  • Members
  • PipPipPip
  • Advanced Member
  • 142 posts

Posted 06 March 2006 - 08:23 AM

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.


#2 wickning1

  • Members
  • PipPipPip
  • Advanced Member
  • 405 posts

Posted 06 March 2006 - 08:31 AM

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.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users