adodb-encrypt-md5.php 849 B

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