You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

crypt_test.php 593B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. require_once('crypt.php');
  3. require_once('dovecot_crypt.php');
  4. $test = new DovecotCrypt('test');
  5. $test->crypt('CRYPT');
  6. echo "CRYPT:\n\n";
  7. echo "Crypted: ".$test->get()."\n";
  8. if ($test->verify('CRYPT', $test->get())) {
  9. echo "Varified: true\n";
  10. } else {
  11. echo "Varified: false\n";
  12. }
  13. echo "\n";
  14. $test2 = new DovecotCrypt('test2');
  15. $test2->crypt('CRAM-MD5');
  16. echo "CRAM_MD5:\n\n";
  17. echo "Crypted: ".$test2->get()."\n";
  18. if ($test2->verify('CRAM-MD5', $test2->get())) {
  19. echo "Varified: true\n";
  20. } else {
  21. echo "Varified: false\n";
  22. }
  23. echo "\n";
  24. ?>