選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

crypt_test.php 565B

12345678910111213141516171819202122232425262728293031
  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";