列文虎克发现了什么| 导购员是做什么的| 瘘管是什么症状| 什么是天乙贵人| 善变是什么意思| 拔完智齿吃什么食物好| 圆明园是什么时候被烧的| vmd是什么意思| 看诊是什么意思| 尿蛋白阳性是什么意思| 汤姆福特属于什么档次| 什么动物寿命最短| 岁月蹉跎是什么意思| 生肖本命带红花是什么生肖| 颅内缺血灶是什么病症| 什么地流着| 维多利亚是什么意思| 怀孕了吃什么| 糖尿病的诊断标准是什么| 心阳虚吃什么药| 药物流产后吃什么好| 舌吻是什么| 今天什么时候出梅| 为什么放屁特别臭| 非油炸是什么意思| 自闭症是什么人投胎| 上不下要读什么| 贪污是什么意思| 先心病是什么病| 压车是什么意思| 变异性哮喘咳嗽吃什么药| 为什么晚上不能照镜子| 急救物品五定是什么| 做护士需要什么条件| 土星为什么有光环| 玉兔是什么意思| 特需门诊和专家门诊有什么区别| 阿司匹林肠溶片什么时候吃| 翡翠都有什么颜色| 冲太岁是什么意思| 什么竹子| 类风湿和风湿有什么区别| 湿疹为什么一热就出来| 生扶什么意思| 睾丸潮湿是什么原因| 布朗是什么水果| 水印相机是什么意思| 俄罗斯什么东西值得买| 登对是什么意思| 过敏性鼻炎喷什么药| 梦见别人装修房子是什么预兆| 蒸馏酒是什么酒| tb是什么意思啊| 娃娃鱼用什么呼吸| 为什么会得尿毒症| 为什么没有广东大学| 750金是什么金| 宫颈囊肿是什么意思| 什么是豆粕| 双减是什么意思| 舌头开裂吃什么药| 感冒什么时候能好| 恳请是什么意思| 中国的特工组织叫什么| salsa什么意思| 脑利钠肽前体值高预示什么| 如家是什么内涵| 血热皮肤瘙痒吃什么药| 乳头瘤病毒是什么意思| 肺痿是什么意思| 血小板计数偏低是什么意思| 衢是什么意思| 无菌性前列腺炎吃什么药效果好| cheese是什么意思| 钻牛角尖什么意思| 胳膊上的肌肉叫什么| 梦遗是什么| 宝宝是什么意思| 喉结下面是什么部位| 雨露均沾是什么意思| 减肥期间吃什么最好| 吃什么可以让子宫内膜变薄| 千里共婵娟什么意思| 鬼冢虎属于什么档次| 鹿吃什么| 1970属什么生肖| 保护嗓子长期喝什么茶| 夏天吃什么最好| 安赛蜜是什么东西| 数据中心是什么| 喝什么减肥| 纯牛奶什么时候喝最好| 张予曦为什么像混血| 十月23日是什么星座| cf是什么| guess是什么品牌| 十二月十四日是什么星座| 彩超是检查什么的| 肝的作用和功能是什么| 蒸米饭时加什么好吃| 褐色分泌物是什么原因引起的| 鬼子红药店里叫什么药| 天花是什么| 中尉是什么级别| 音节是指什么| 金牛后面是什么星座| 懊恼是什么意思| 隐翅虫长什么样子| 照护保险是什么| 高血压吃什么食物| 12月18号是什么星座| 爸爸的姥姥叫什么| 湿疹擦什么药好| 潘氏试验阳性说明什么| 粉丝是什么做的| 有什么笑话| 是什么词性| 泄气的意思是什么| 骨髓水肿吃什么消炎药| 眼力见是什么意思| 男人下面有异味什么原因| 美丽的邂逅是什么意思| 10月什么星座| 7.14什么星座| 不领情是什么意思| 佳偶天成是什么意思| 眼皮老是跳是什么原因| 蔓越莓有什么功效| 护理专业是干什么的| 吃了虾不能吃什么水果| 胖子适合什么发型| 全麦粉和小麦粉的区别是什么| 西瓜又什么又什么填空| 隐形眼镜没有护理液用什么代替| vintage什么意思| 久旱逢甘露是什么意思| 食道肿瘤有什么症状| rainbow什么意思| 水煮鱼片用什么鱼| 玄胡又叫什么| 补肝血吃什么药| 9.21是什么星座| 七月22号是什么星座| 吃什么中药能降血压| 哥哥的儿子叫什么| 左肋骨下面是什么器官| 早搏是什么感觉| 七月有什么节日| 脂肪肝什么症状| 1989是什么生肖| guess什么意思| 四离日是什么意思| 天麻是什么样子| 锌是什么| 青春痘用什么药膏擦最好呢| 什么是植物神经| 睡眠好的人说明什么| 柏拉图爱情是什么意思| 每天流鼻血是什么原因| 胆固醇高是什么引起的| 雪藏是什么意思| 洋地黄中毒首选什么药| 孕妇适合喝什么牛奶| 什么匆匆| 蜂王浆有什么好处| 二甲双胍缓释片什么时候吃最好| 中管干部是什么级别| 开塞露是干什么用的| 孤独的最高境界是什么| 谷氨酰基转移酶高是什么原因| 总胆汁酸是什么意思| 女人一般什么时候容易怀孕| 婴儿第一次发烧叫什么| 胸痛应该挂什么科| 龙的五行属性是什么| 重庆沱茶属于什么茶| 女性尿道炎吃什么药| 百香果和什么搭配好喝| 电商属于什么行业| 什么叫打飞机| 戒断反应什么意思| 掌纹多而乱代表什么| 丙氨酸氨基转移酶高是什么原因| 世界第一长河是什么河| 女人下嘴唇厚代表什么| 疳积有什么症状| 眉头长痘痘是因为什么原因引起的| 高处不胜寒的胜是什么意思| 热伤风是什么意思| 血糖高吃什么主食| 球蛋白高是什么原因| 喉咙痒干咳吃什么药| 糖耐是检查什么| 通马桶的工具叫什么| 黄色裤子搭配什么颜色上衣| 枕头什么牌子好| 肖像是什么意思| 炮机是什么| 有肾病的人吃什么好| 灰色裤子配什么上衣好看| 笑什么如花| 黄色分泌物是什么原因| 糖尿病吃什么水果好| 巳时五行属什么| 嘴苦口臭是什么原因造成的| 喝酒上头是什么原因| 喝山楂水有什么功效与作用| 慢性浅表性胃炎吃什么药| 红米饭是什么米| 为什么叫香港脚| 脚有点浮肿是什么原因| 牙疼吃什么药止痛快| 胃胀吃什么水果| 少字五行属什么| 考试前吃巧克力有什么好处| 空气过敏是什么症状| 志字五行属什么| 海参什么样的好| alds是什么病| 用什么可以解开所有的谜| 空调出风小没劲什么原因| 玻璃酸钠是什么| msgm是什么品牌| 芮字五行属什么| 国家三有保护动物是什么意思| 自相矛盾的道理是什么| 2000年属什么生肖| 老好人是什么意思| 什么品种的榴莲最好吃| 布洛芬什么时候起效| 人工降雨的原理是什么| 颈椎退行性变是什么意思| 鼻头出汗是什么原因| 手麻木吃什么药| 双喜临门是什么生肖| 常州为什么叫龙城| 儿童湿疹用什么药膏| 甘油三酯高不能吃什么| 石敢当是什么神| 什么是人设| 心脏是由什么组织构成的| 颈部淋巴结肿大是什么原因| 更年期综合征吃什么药| 胸口疼痛吃什么药| ba是什么| 负责任是什么意思| 什么花不用浇水| 身上有斑点是什么原因| 筋膜炎是什么症状| 波罗蜜多什么意思| 927是什么意思| 蚊子不咬什么体质的人| 投诉快递打什么电话| 女人脚心发热吃什么药| 红参有什么功效| 超敏c反应蛋白偏高说明什么| 分别心是什么意思| 诸葛亮是什么星座| 生育能力检查挂什么科| dha什么时间段吃最好| 六月二十三号是什么星座| 想请假找什么理由好| 什么榴莲好吃| 晚上九点多是什么时辰| 百度
rfc:hash_pbkdf2

湖北绘制“互联网+制造业”新蓝图

百度 女上位什么意思

This RFC proposes adding a hash_pbkdf2 function to the hash package

Introduction

The purpose of this RFC is to add the PBKDF2 algorithm to the available hashing functions as a C implementation.

Why do we need PBKDF2?

PBKDF2 is defined in RFC2898 as a method for implementing password based cryptographic needs. These needs can include password storage, password derivation into a key (for encryption) or secure signatures. Additionally, it's NIST Recommended for password storage.

Adding a core implementation of the PBKDF2 algorithm will enable PHP projects to utilize a fast implementation of the algorithm, putting them on a more level ground for attackers. Since the C implementation is more efficient, more rounds can be computed for the same computational cost compared to a PHP land implementation. This enables higher iteration counts to be used, providing more security with less impact to the overall performance of the application.

Projects and Software That Currently Use PBKDF2

  • WPA and WPA2 for key derivation from password
  • OpenDocument encryption (OpenOffice.org)
  • WinZip AES encryption
  • 1Password
  • LastPass
  • Apple iOS
  • Blackberry Backup Encryption
  • Django Python Framework

$algo

The way hash_pbkdf2 is written, any currently supported hash_algos() algorithm can be used as the base for the algorithm. This means that it's up to the developer to choose the appropriate algorithm to use when using the function. Here are a few of the popular algorithms and some recomendations around them. It should be noted that any cryptographic hash algorithm that's supported can be used successfully with PBKDF2 (CRC32 is *not* cryptographic, therefore it should not be used).

  1. SHA512 - This is currently one of the strongest algorithms available in PHP. It makes a good primitive for *hash_pbkdf2*
  2. SHA256 - This is also plenty strong enough for use as the basis for PBKDF2.

A note on other popular algorithms: SHA1 and MD5 - Both are actually strong enough for effective use in PBKDF2. The reason is that the known attack vectors against the algorithm require knowledge of the input string being hashed. Therefore, an iterated algorithm such as PBKDF2 will be immune to the known attack vectors. That means it's OK to use for this task. With that said, the recommended approach is to use SHA512 or SHA256 instead, as the base algorithms are stronger. But it's not necessarily *bad* to use SHA1 or MD5.

$salt

The salt parameter should be a random string containing at least 64 bits of entropy. That means when generated from a function like *mcrypt_create_iv*, at least 8 bytes long. But for salts that consist of only *a-zA-Z0-9* (or are base_64 encoded), the minimum length should be at least 11 characters. It should be generated random for each password that's hashed, and stored along side the generated key.

$iterations

The iterations parameter provides the ability to *tune* the algorithm for different servers and needs. For most web uses, a minimum value of *1000* is recommended. However, as hardware varies greatly, testing should be done to find an iteration count that yields a function runtime of between 0.1 and 0.5 seconds (depending again on application). On higher end servers, this can be as much as 20,000 to 50,000 iterations (also depending on the hash algo used).

It's better to use the highest iteration count possible, as it will only increase the resistance to brute forcing.

$length

The length parameter indicates the length of the returned key. The default value for length is the length of the hash algo's output. However, this can be increased or decreased as necessary. For example, if you're using PBKDF2 to generate a password-based key for use in an encryption routine such as RIJNDAEL 256, which expects a 256 bit key, you would want to pass the length parameter as 256/8 (to get the byte length), and set *$raw_output* to *true*.

$raw_output

This parameter behaves just like the other *hash_* functions. If set to *true*, the function will return a binary string (chr 0-255). If set to *false*, the function will hex encode the result prior to returning it.

Example

Let's say you wanted to encrypt a file using a password. The password shouldn't be applied directly to the encryption function, but should be derived first.

encryption.php
<?php
$password = "foo";
$data = "testing this out";
$salt = mcrypt_create_iv(16, MCRYPT_DEV_URANDOM);
$key = hash_pbkdf2("sha512", $password, $salt, 5000, 16, true);
// $key will be full-byte 0-255 data
 
$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_DEV_URANDOM);
 
$ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $data, MCRYPT_MODE_CBC, $iv);
?>

Or for storing passwords (BCrypt is recommended, but there are use-cases for PBKDF2, such as when NIST compliance is mandated):

password.php
<?php
$password = "foo";
$salt = mcrypt_create_iv(16, MCRYPT_DEV_URANDOM);
$hash = hash_pbkdf2("sha512", $password, $salt, 5000, 32);
 
// $hash will be a hex encoded string
?>

Proposal and Patch

The proposal is to add a hash_pbkdf2() function to the hash extension in core. The proposed function has a signature:

string hash_pbkdf2(string algo, string password, string salt, int iterations [, int length = 0, bool raw_output = false])

The patch is available as a pull request to trunk.

This RFC intends to add this functionality to master (5.5) only.

Vote

Vote begins on 2012/07/02 and ends on 2012/07/09. This vote is to include the new function in master only (5.5).

rfc/hash_pbkdf2
Real name Yes? No?
dragoonis (dragoonis)  
hradtke (hradtke)  
ircmaxell (ircmaxell)  
kriscraig (kriscraig)  
lynch (lynch)  
nikic (nikic)  
rasmus (rasmus)  
shm (shm)  
stas (stas)  
Final result: 9 0
This poll has been closed.

More about PBKDF2

Changelog

  • 0.1 - Initial Version
  • 0.2 - Proposed
  • 0.3 - Added Parameter Information
  • 0.4 - Reworded to target master only, removing 5.4 section
  • 1.0 - Moving to Accepted state
rfc/hash_pbkdf2.txt · Last modified: by 127.0.0.1

?
寿眉茶属于什么茶 一九八八年属什么生肖 屁股上长痘痘是什么情况 甲状腺结节低回声什么意思 降压药什么时候吃比较好
蛇进家是什么意思 属蛇的人适合佩戴什么 中国海警是什么编制 为什么上小厕会有刺痛感 八十岁叫什么之年
707是什么意思 降调针什么时候打 磁共振是检查什么 凤梨跟菠萝有什么区别 慢性胃炎吃什么中成药
一直吐是什么原因 夏至要吃什么 松花粉对肝有什么好处 爱吐口水是什么原因 甲亢病是一种什么病
脂肪瘤吃什么药可以消除adwl56.com 什么药治便秘最好最快hcv8jop8ns1r.cn 医保什么时候到账hcv9jop2ns0r.cn 氯化钠是什么东西hcv8jop1ns9r.cn 安徒生被誉为什么hcv9jop7ns4r.cn
肌肉萎缩挂什么科hcv8jop9ns2r.cn 小腹痛是什么原因hcv8jop9ns7r.cn 口腔扁平苔藓是什么原因造成的hcv8jop1ns2r.cn 拉抽屉是什么现象imcecn.com 邮件号码是什么wmyky.com
opt是什么hcv9jop5ns3r.cn 盆腔静脉石是什么意思hcv9jop2ns0r.cn 我要的是什么hcv8jop2ns4r.cn 做肠镜要挂什么科sscsqa.com 小孩子长白头发是什么原因hcv8jop4ns5r.cn
马与什么属相相克相冲hcv8jop9ns0r.cn 吃什么可以变白hcv7jop5ns6r.cn 柬埔寨是什么国家hcv9jop2ns6r.cn 得宫颈癌的前兆是什么weuuu.com 甲低是什么原因造成的hcv8jop5ns9r.cn
百度