本文章转载自 http://blog.reneorban.com/2014/10/hash-and-salt-umbraco-passwords.html

By default right now (I'm testing on version 7.1.4) Umbraco one way hashes both Member and User passwords for you.  However also by default it will not salt your passwords.  Salting passwords is nearly as important as hashing in the first place.  For example if "johny48@email.com" was to sign up for your website with the password "test" it would by default produce a entry in the database like this:

As you can see the password is hashed to the value "W477AMlLwwJQeAGlPZKiEILr8TA=".  However there is no salt on this password, so if "kate39@example.com" came along and also registered using the password "test" we would get the same hash value:

This is not very good from a security point view.  These values could very easily be rainbow tabled (just type "W477AMlLwwJQeAGlPZKiEILr8TA=" into google and you will most likely find the original value).

Enabling Password salting

Umbraco actually supports hashing and salting as standard and its very easy to enable.  Within your Web.Config file you will find a node called "membership".  Under this node you will find two providers named "UmbracoMembershipProvider" and "UsersMembershipProvider".  By default these will have the attribute "passwordFormat" set to "Hashed" - brilliant!  However there is a second option named "useLegacyEncoding" that by default it is set to "True".  This is what causes the non salted passwords. To enable salting simply set "useLegacyEncoding" to "False". You can see what this will do by looking at their code on their GitHub
 
After setting "useLegacyEncoding" to "False" I can update my members password to "test" again and we will be generated two completely different hash values.
 
 

The Catch

Now there is a catch to this.  Because we have changed the way that passwords are validated and stored poor johny48 and kate39 will no longer be able to log into our site.  They will have to update/change their passwords before their able to once again login.  
 
So if you have a existing site with members and users this might cause you a few problems...However if your starting a site fresh this really is a must.
 
Additionally because there are two different membership providers you could enable salting for just members and not users or vice versa.

Hash和Salt Umbraco 默认的password存储方式的更多相关文章

  1. JMS学习(七)-ActiveMQ消息的持久存储方式之KahaDB存储

    一,介绍 自ActiveMQ5.4以来,KahaDB成为了ActiveMQ默认的持久化存储方式.相比于原来的AMQ存储方式,官方宣称KahaDB使用了更少的文件描述符,并且提供了更快的存储恢复机制. ...

  2. 关于 Spring Security 5 默认使用 Password Hash 算法

    账户密码存储的安全性是一个很老的话题,但还是会频频发生,一般的做法是 SHA256(userInputpwd+globalsalt+usersalt) 并设置密码时时要求长度与大小写组合,一般这样设计 ...

  3. Elasticsearch之重要核心概念(cluster(集群)、shards(分配)、replicas(索引副本)、recovery(据恢复或叫数据重新分布)、gateway(es索引的持久化存储方式)、discovery.zen(es的自动发现节点机制机制)、Transport(内部节点或集群与客户端的交互方式)、settings(修改索引库默认配置)和mappings)

    Elasticsearch之重要核心概念如下: 1.cluster 代表一个集群,集群中有多个节点,其中有一个为主节点,这个主节点是可以通过选举产生的,主从节点是对于集群内部来说的.es的一个概念就是 ...

  4. Redis简介、与memcached比较、存储方式、应用场景、生产经验教训、安全设置、key的建议、安装和常用数据类型介绍、ServiceStack.Redis使用(1)

    1.NOSQL简介 nosql的产生并不是要彻底的代替关系型数据库,而是作为传统关系型数据库的一个补充. Facebook和360使用Cassandra来存储海量社交数据 Twitter在其url抓取 ...

  5. WPF中的DependencyProperty存储方式详解

    前言 接触WPF有一段时间了,之前虽然也经常使用,但是对于DependencyProperty一直处于一知半解的状态.今天花了整整一下午将这个概念梳理了一下,自觉对这个概念有了较为清晰的认识,之前很多 ...

  6. Android编程中的5种数据存储方式

    Android编程中的5种数据存储方式 作者:牛奶.不加糖 字体:[增加 减小] 类型:转载 时间:2015-12-03我要评论 这篇文章主要介绍了Android编程中的5种数据存储方式,结合实例形式 ...

  7. Python3编写网络爬虫11-数据存储方式四-关系型数据库存储

    关系型数据库存储 关系型数据库是基于关系模型的数据库,而关系模型是通过二维表保存的,所以它的存储方式就是行列组成的表.每一列是一个字段,每一行是一条记录.表可以看作某个实体的集合,而实体之间存在联系, ...

  8. [Android]Android数据的四种存储方式

    存储方式 Android提供以下四种存储方式: SharePreference SQLite File ContentProvider Android系统中数据基本都是私有的,一般存放在“data/d ...

  9. [转][Android]Android数据的四种存储方式

    android.database.sqlite类 SQLiteQueryBuilder java.lang.Object android.database.sqlite.SQLiteQueryBuil ...

随机推荐

  1. 关于EasyRTSPClient、EasyPlayer RTSP流重连问题的解释

    EasyPlayer.EasyRTSPClient是如何设计重连的 首先大概解释一下EasyRTSPClient与EasyPlayer间的关系:EasyRTSPClient是一个专门用于与RTSP流媒 ...

  2. input file 选择Excel文件 相关操作

    1.HTML代码 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebFo ...

  3. Qt中的通用模板算法QtAlgorithms(qDeleteAll,qBinaryFind,qCountLeadingZeroBits,qPopulationCount,qFill,qSwap,qSort)

    Qt在<QtAlgorithms>头文件中为我们提供了一系列的全局模板方法,这些模板方法主要用于容器操作,比如qDeleteAll().其在Qt中的声明如下: void qDeleteAl ...

  4. Delphi 完全时尚手册之 Visual Style 篇

    这里先说说两个概念:Theme(主题)和 Visual Style .Theme 最早出现在 Microsoft Plus! for Windows 95 中,是 Windows 中 Wallpape ...

  5. PHP中的排序函数sort、asort、rsort、krsort、ksort区别分析(转)

    sort() 函数用于对数组单元从低到高进行排序. rsort() 函数用于对数组单元从高到低进行排序. asort() 函数用于对数组单元从低到高进行排序并保持索引关系. arsort() 函数用于 ...

  6. Qt & MySQL

    Qt中如何进行MySQL连接与操作步骤: 1.向工程中的.pro文件增加QT += sql; 2.写一个通用的数据库连接类(Connect),一个static方法(CreateConnection), ...

  7. 在Spring中基于JDBC进行数据访问时如何控制超时

    超时分类 超时根据作用域可做如下层级划分: Transaction Timeout > Statement Timeout > JDBC Driver Socket Timeout Tra ...

  8. wamp server 安装后 Apache80端口占用

    提示:Your port 80 is actually used by :Server: Microsoft-HTTPAPI/2.0 解决方案:计算机->右键管理->服务和应用程序-> ...

  9. HDU4825 Xor Sum —— Trie树

    题目链接:https://vjudge.net/problem/HDU-4825 Xor Sum Time Limit: 2000/1000 MS (Java/Others)    Memory Li ...

  10. Codeforces 854B Maxim Buys an Apartment:贪心

    题目链接:http://codeforces.com/contest/854/problem/B 题意: 有n栋房子从1到n排成一排,有k栋房子已经被售出. 现在你要买一栋“好房子”. 一栋房子是“好 ...