douxiuar885064 2013-01-09 11:27
浏览 30
已采纳

PHP crypt函数和算法

I'm using crypt() function but I don't know if my implementation is correct. What kind of algorithm I'm using if I write someting like this :

crypt('PE','12345') 

I read the documentation and I don't know which algorithm is chosen with a five char salt like 12345.

  • 写回答

4条回答 默认 最新

  • dongxia8656 2013-01-09 11:35
    关注

    Depends on the system as the documentation says.

    To determine what your system supports, you can check the values of constants defined by PHP. The constant CRYPT_SALT_LENGTH will display the expected length of the salt string. DES accepts a two-character salt. MD5 accepts 12 characters. You can also check to see whether any of the following flags are set: CRYPT_STD_DES, CRYPT_EXT_DES, CRYPT_MD5, CRYPT_BLOWFISH. To do this, issue a command such as: echo CRYPT_MD5

    A numeral 1 indicates it is supported; a 0 indicates that it is not.

    Consider reading details here http://www.techrepublic.com/article/the-perils-of-using-php-crypt/1058691

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式