萬盛學電腦網

 萬盛學電腦網 >> 網絡編程 >> php編程 >> 單向字符串加密的php實例

單向字符串加密的php實例

   

  /**

  * 單向字符串加密算法 不能用作密碼加密

  */

  if (CRYPT_STD_DES == 1)

  {

  echo "Standard DES: ".crypt("hello world")."n";

  }

  else

  {

  echo "Standard DES not supported.n";

  }

  if (CRYPT_EXT_DES == 1)

  {

  echo "Extended DES: ".crypt("hello world")."n";

  }

  else

  {

  echo "Extended DES not supported.n";

  }

  if (CRYPT_MD5 == 1)

  {

  echo "MD5: ".crypt("hello world")."n";

  }

  else

  {

  echo "MD5 not supported.n";

  }

  if (CRYPT_BLOWFISH == 1)

  {

  echo "Blowfish: ".crypt("hello world");

  }

  else

  {

  echo "Blowfish DES not supported.";

  }

  ?>

copyright © 萬盛學電腦網 all rights reserved