laravel5文档介绍

//对 A 密码使用Bcrypt 加密
$password = Hash::make('mima'); //你也可直接使用 bcrypt 的 function
$password = bcrypt('mima'); //对加密的 A 密码进行验证
if (Hash::check('mima', $hashedPassword))
{
// The passwords match...
}
//检查 A 密码是否需要重新加密
if (Hash::needsRehash($hashed))
{
$hashed = Hash::make('secret');
}

目前常用的不可逆加密算法有以下几种:

  1. 一次MD5(使用率很高)
  2. 将密码与一个随机串进行一次MD5
  3. 两次MD5,使用一个随机字符串与密码的md5值再进行一次md5,使用很广泛
  4. PBKDF2算法
  5. bcrypt
  6. 其它加密算法

通常推荐使用 bcrypt 或 PBKDF2 这两种算法来对密码进行加密

无论是bcrypt还是PBKDF2都有各自的忠实拥护者。另外bcrypt不支持超过55个字符的密码短语。

技术还是需要不断地积累,不然只会用前三种。T.T,之后有空继续增加详细解说。

Crypt加密解密

use Crypt;
-----------------------------

var_dump(Crypt::decrypt("eyJpdiI6InF0Q0VGQWZZNERCSVNzbFwvYis1ZDZBPT0iLCJ2YWx1ZSI6IjNFMWNBT044SXlWWlBPdkwwZE11Tnc9PSIsIm1hYyI6ImFhYjc2NzU5NDgzMDA0ODA5Yzk1NzNjYTIwZTJhNzVmMTRkMjI1YmRjM2FjOWNmMzk1MmNiNjgwMTIyMDE4NDQifQ=="));
$jiami = Crypt::encrypt('123456');

http://www.cnblogs.com/xxxxxxx/p/5381673.html

laravel5的Bcrypt加密方式对系统保存密码的更多相关文章

  1. laravel5的Bcrypt加密方式对系统保存密码的小结

    laravel5文档介绍 //对 A 密码使用Bcrypt 加密 $password = Hash::make('secret'); //你也可直接使用 bcrypt 的 function $pass ...

  2. [转]https方式使用git保存密码的方式

    https方式每次都要输入密码,按照如下设置即可输入一次就不用再手输入密码的困扰而且又享受https带来的极速 设置记住密码(默认15分钟): git config --global credenti ...

  3. Spring Security 5.x兼容多种密码加密方式

    1 spring security PasswordEncoder spring security 5不需要配置密码的加密方式,而是用户密码加前缀的方式表明加密方式,如: {MD5}88e2d8cd1 ...

  4. Spring Security项目的搭建以及Spring Security的BCrypt加密

    .personSunflowerP { background: rgba(51, 153, 0, 0.66); border-bottom: 1px solid rgba(0, 102, 0, 1); ...

  5. 解决spring-boot配置文件使用加密方式保存敏感数据启动报错No decryption for FailsafeTextEncryptor. Did you configure the keystore correctly

    spring-boot配置文件使用加密方式保存敏感数据 application.yml spring: datasource: username: dbuser password: '{cipher} ...

  6. [转]加盐hash保存密码的正确方式

    0x00 背景 大多数的web开发者都会遇到设计用户账号系统的需求.账号系统最重要的一个方面就是如何保护用户的密码.一些大公司的用户数据库泄露事件也时有发生,所以我们必须采取一些措施来保护用户的密码, ...

  7. PHP中的6种加密方式

    PHP中的6种加密方式 1. MD5加密 string md5 ( string $str [, bool $raw_output = false ] ) 参数 str  --  原始字符串. raw ...

  8. PHP加密方式。 base!base!base!

    PHP中的加密方式有如下几种 1. MD5加密 string md5 ( string $str [, bool $raw_output = false ] ) 参数 str  --  原始字符串. ...

  9. PHP中的加密方式有如下几种

    1. MD5加密 string md5 ( string $str [, bool $raw_output = false ] ) 参数 str  --  原始字符串. raw_output  --  ...

随机推荐

  1. idea unicode自动转码设置

    idea unicode自动转码设置 File > Settings > Editor > File Encodings 右侧 Properties Files 中 选中 Trans ...

  2. 如何用 Jquery实现OuterHtml

      $(this).get(0) 或者$(this).prop('outerHTML')

  3. SharpDevelop 版本信息

    mscorlib,4.0.0.0,C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll SharpDevelop,5.1.0.4936, ...

  4. 【android】模拟点击某个指定坐标作用在View上

    /** * 模拟点击某个指定坐标作用在View上 * @param view * @param x * @param y */ public void clickView(View view,floa ...

  5. 远程连接Ubuntu桌面配置

    1.打开终端:依次安装 sudo apt-get install xrdp sudo apt-get install vnc4server tightvncserver sudo apt-get in ...

  6. python中的静态成员方法和类成员方法

    Python的静态方法和类成员方法都可以被类或实例访问,两者概念不容易理清,但还是有区别的: 1)静态方法无需传入self参数,类成员方法需传入代表本类的cls参数: 2)从第1条,静态方法是无法访问 ...

  7. 1z0-052 q209_1

    1: You perform differential incremental level 1 backups of your database on each working day and lev ...

  8. Android Studio关于USB device not found的解决的方法

    Android Studio关于USB device not found的解决的方法 我们使用Android Studio进行Android开发时.当我们使用真机进行调试时.非常可能会出现USB de ...

  9. chardet 模块

    #coding:utf-8 #指定本文件编码为utf-8 #python 27 #xiaodeng #chardet模块 #chardet模块下载地址: #1)http://pan.baidu.com ...

  10. c语言转移符和三字母序列

    三字母序列