我在php中使用bcrypt/blowfish,当我将cost参数设置为$ 10(我认为1024轮)时,加密过程需要0.1秒.如果我将它设置为12美元,则需要0.3秒.我的问题是:这是否占用了0.3秒的CPU时间,即如果我有100个用户正在运行此过程,它们是否都需要等待30秒(0.3 x 100)?(编辑:由于双核/多线程处理可能会更短,但即使10秒也是不可接受的).
另外:保留此成本参数有什么好处?有些人推荐16美元,但我的网站上需要5秒钟(由大型虚拟主机托管).
顺便说一句,我使用以下代码来检查它所需的时间:
<?php
// set a password to work with
$var1 = "doodoo1234";
//echo that password onto the screen
echo $var1 . "<br /><br />";
//Start the clock
$time_start = microtime(true);
//Run blowfish function to encrypt the password
$hashedpass = PassHash::blowfishhash($var1);
//stop the clock
$time_end = microtime(true);
//echo the password to the screen
echo $echohashedpass . "<br /><br />";
//Echo the length of the encrypted password to the screen
//(this taught me that blowfish always returns …Run Code Online (Sandbox Code Playgroud) 我的问题是关于会话固定的这个摘要:
Alice 在银行http://unsafe.com/有一个账户。不幸的是,Alice 不是很了解安全。
马洛里要去银行取爱丽丝的钱。
Alice 对 Mallory 有合理的信任度,并且会访问 Mallory 发送给她的链接。
问题:
Q1 - 有没有办法明确阻止站点接受任何会话标识符?
Q2 - 我没有在我的网站上使用 $_GET 变量,所以有没有办法阻止接受来自查询字符串的会话标识符?