adodb-encrypt-md5.php 757 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /*
  3. V4.01 23 Oct 2003 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
  4. Contributed by Ross Smith (adodb@netebb.com).
  5. Released under both BSD license and Lesser GPL library license.
  6. Whenever there is any discrepancy between the two licenses,
  7. the BSD license will take precedence.
  8. Set tabs to 4 for best viewing.
  9. */
  10. // security - hide paths
  11. if (!defined('ADODB_SESSION')) die();
  12. include_once ADODB_SESSION . '/crypt.inc.php';
  13. /**
  14. */
  15. class ADODB_Encrypt_MD5 {
  16. /**
  17. */
  18. function write($data, $key) {
  19. $md5crypt =& new MD5Crypt();
  20. return $md5crypt->encrypt($data, $key);
  21. }
  22. /**
  23. */
  24. function read($data, $key) {
  25. $md5crypt =& new MD5Crypt();
  26. return $md5crypt->decrypt($data, $key);
  27. }
  28. }
  29. return 1;
  30. ?>