草庐IT

retrieve_password_message

全部标签

php - 如何最好地从散列 ('sha512' ,'salt' 升级到 password_* 函数)

我渴望将我的代码迁移到新的password_*PHP原生提供的函数。数据库中现有的哈希已经生成如下:hash('sha512',''.$email.$password);我想将这些移动为由现在推荐的创建的哈希:password_hash($password,PASSWORD_DEFAULT);显然,当用户登录时,我可以借此机会根据他们刚刚提供的密码创建新的哈希值,并将其保存在数据库中。但是,我想避免数据库中必须有两个字段,即一个用于已弃用的哈希,一个用于现代password_hash。相反,我宁愿在每个用户登录时替换旧的。因此,是否可以保留单个数据库字段,并让用户空间代码确定哈希是否旧

php - password_hash() PASSWORD_DEFAULT PHP 5.5

来自password_hash()函数:PASSWORD_DEFAULT-Usethebcryptalgorithm(defaultasofPHP5.5.0).NotethatthisconstantisdesignedtochangeovertimeasnewandstrongeralgorithmsareaddedtoPHP.Forthatreason,thelengthoftheresultfromusingthisidentifiercanchangeovertime.Therefore,itisrecommendedtostoretheresultinadatabasecol

php - Gmail API : Get list of messages labelled with a specific label in php

情况我正在设置GmailAPI对于我的应用程序。我需要导入所有标有特定标签的电子邮件,例如TRASH、SPAM、SENT、UNREAD、STARRED等。我能够获取收件箱电子邮件列表和单条消息信息。我可以获得标签列表以及单个标签信息。但我没有找到如何将它们结合起来。显然,在给定labelId的情况下,没有检索消息列表的特定请求,并且在电子邮件列表中没有labelId的踪迹。请求输出:获取消息列表:array(3){[0]=>array(5){["messageId"]=>string(16)"14ddc24465a9b72e"["messageSnippet"]=>string(14)

php - laravel 5.1 Password::reset 返回 passwords.password

我在Controller中有此功能,但我无法重置密码,因为我想将字符长度更改为5位数字。publicfunctionpostReset(Request$request){$this->validate($request,['token'=>'required','password'=>'required|confirmed|digits:5',]);$credentials=$request->only('email','password','password_confirmation','token');$response=Password::reset($credentials,f

java.sql.SQLException: Access denied for user ‘root‘@‘localhost‘ (using password: YES)报错原因

1.第一个:用户名和密码不匹配,或者是在连接池里多打了空格之类的就是配置文件的问题;2.第二个:可能是用户的权限不够,给他添加权限;授予权限--grantallprivilegesondatabasename.tablenameto'user'@'host'identifiedby'password';--授予myuser用户全局级全部权限:GRANTALLPRIVILEGESON*.*TO'myuser'@'%'IDENTIFIEDBY'mypass'WITHGRANTOPTION;--授予myuser用户针对testdb数据库全部权限:GRANTALLPRIVILEGESONtestdb.

php - 在 password_hash 值上使用准备好的语句有什么意义吗?

当使用password_hash()函数生成散列密码时,为什么我想在将它插入数据库时​​使用准备好的语句?我的假设是我不需要为密码使用准备好的语句,但为了保持一致性,使用一个也没有坏处。附加问题:如果我使用password_hash函数的PASSWORD_DEFAULT参数,它目前将使用bcrypt算法,但将来可以替换为不同的算法。如果我不使用准备好的语句,future的算法是否会使用单引号或其他可能破坏SQL语句的符号? 最佳答案 isthereanyreasonwhyIwouldwanttouseapreparedstateme

php - PHP 5.3.27 中 password_hash 的最佳替代方案?

我一直在互联网上搜索加密数据库密码的最佳选择。我发现password_hash()是最佳选择,但后来我发现它仅适用于PHP5.5+。显然我的主机有5.3.27版。我一直在寻找最佳选择,但找不到任何好的选择。 最佳答案 下面的库为您提供了phphttps://github.com/ircmaxell/password_compat.git 关于php-PHP5.3.27中password_hash的最佳替代方案?,我们在StackOverflow上找到一个类似的问题:

php - 调用未定义的方法 Stripe\Subscription::retrieve()

我在CodeIgniter中使用Stripe,我是这样设置它的:在我的StripeController中,我通过以下方式调用库:require_once(APPPATH.'libraries/stripe/init.php');这是根据Stripe-PHPFatalerror:Class'Stripe\Charge'notfound失败的函数是:functioncancelSubscription($stripeaccount){$customer=\Stripe\Customer::retrieve($stripeaccount);$sub_id=$customer->subscri

php - 严重性 : 8192 Message: Methods with the same name as their class will not be constructors in a future version of PHP;

严重性:8192消息:在未来的PHP版本中,与类同名的方法将不再是构造函数;CI_Pagination有一个已弃用的构造函数文件名:libraries/Pagination.php行号:27classCI_Pagination{var$base_url='';//Thepagewearelinkingtovar$total_rows='';//Totalnumberofitems(databaseresults)var$per_page=10;//Maxnumberofitemsyouwantshownperpagevar$num_links=2;//Numberof"digit"li

PHP 注册 : Auto-generate password or let user choose it

在注册的时候,我在纠结怎么设置用户密码:让用户选择。如果我这样做,我必须执行一些标准(长度、弱点、可能涉及正则表达式等)当你选择这种方式时你通常会做什么,为什么?是否有适用于PHP的库?自动为用户生成密码并将其通过电子邮件发送到他们提供的电子邮件地址。如果没有密码,他们就无法登录,所以这也是电子邮件验证。问题是密码可能太难让用户记住。如果我允许他们将它改成更简单的东西,那就违背了我最初为他们选择它的目的。我还担心在电子邮件中传输密码(作为普通的未散列密码)的行为。我倾向于第二种,但在选择之前更希望得到更明智的答案。可能有些事情我没有注意,比如用户便利性和其他技术问题。你是做什么的?编辑