Google
搜索www.dodoakn 搜索DoDoKan

函数:crypt()

crypt

将字符串用 DES 编码加密。

语法: string crypt(string str, string [salt]);

返回值: 字符串

函数种类: 编码处理

内容说明

本函数将字符串用 UNIX 的标准加密 DES 模块加密。这是单向的加密函数,无法解密。欲比对字符串,将已加密的字符串的头二个字符放在 salt 的参数中,再比对加密后的字符串。

更详细的资料请参考 UNIX Manual (man) 中的 crypt。

在一些较新的 UNIX 版本中,除了 DES 之外还提供了其它的加密模块,如 MD5。甚至有些系统还用 MD5 取代 DES。在 salt 参数还有一些变化,端看传给 salt 参数的字符串长度而定:

  • CRYPT_STD_DES - 标准的 DES 编码,输入 2 字符的 salt。
  • CRYPT_EXT_DES - 延伸的 DES 编码,输入 9 字符的 salt。
  • CRYPT_MD5 - MD5 编码,输入 12 字符加上 $1$ 的 salt。
  • CRYPT_BLOWFISH - 延伸的 DES 编码,输入 16 字符加上 $2$ 的 salt。

此外,若不使用 salt 参数,则程序会自动产生。


3 Responses to “函数:crypt()”

  1. mqy8bsh-5el1qqi-tw6qa143-0 http://www.rxsslscripts.com/survivalring/casino-games.html#1
    phentermine
    [url=http://www.freesslscripts.com/t/life-insurance.html#3]life insurance[/url]
    [url]http://www.rxsslscripts.com/survivalring/casino-games.html#4[/url]
    [http://www.slotsgame4u.org#5 slots]
    “online casinos”:http://www.rxsslscripts.com/tinyurl4/online-casinos.html#6
    [LINK http://www.smallurl.info/?r=325#7homeowners insurance[/LINK]

  2. online poker

  3. 2ykl1df-i7ylcyp-tw6qa143-0 http://www.rxsslscripts.com/tinyurl3/poker.html#1
    paxil
    [url=http://www.rxsslscripts.com/urlbounce/online-casino.html#3]online casino[/url]
    [url]http://webalias.com/blackjacks#4[/url]
    [http://www.eaudrey.com/discuss/discuss/00013934.htm#5 roulette]
    “slots”:http://www.smallurl.info/?r=32p#6
    [LINK http://www.rxsslscripts.com/tinyurl3/online-poker.html#7online poker[/LINK]

Leave a Reply