为什么虚无是第一通用厄运太刀是第几期的啊,难道被动加的

实达AR-5400+ 用后面进纸打印收费发票,打完第一张,机器自动又前进了一张,接着在打,打的第三张,第二张直接跳过去了,是什么原因?,维修资料,实达(star),苏州,苏州实达(star)打印机维修站,苏州实达(star)打印机售后服务中心,实达(star)打印机维修,实达(star)传真机维修,实达(star)复印机维修,实达(star)硒鼓上门加粉,实达(star)打印机耗材批发&零售,(苏州,昆山,吴江,太仓,常熟,张家港),实达(star)打印机维修论坛,实达(star)说明书,实达(star)用户手册,实达(star)维修手册,实达(star)清零软件,驱动程序下载,通用驱动程序下载,FAQ问答,知道,苏州办公耗材网,oesell.com,,
实达AR-5400+ 用后面进纸打印收费发票,打完第一张,机器自动又前进了一张,接着在打,打的第三张,第二张直接跳过去了,是什么原因?
http://www.oesell.com  来源:oesell.com
 选稿:admin  文字大小:
实达AR-5400+ 用后面进纸打印收费发票,打完第一张,机器自动又前进了一张,接着在打,打的第三张,第二张直接跳过去了,是什么原因? 售后技术交流平台 && 21:05:06&&&&&设置问题,重新设置发票的高度,宽度再打印
网友相关回复如下:(以下网友回复只代表网友个人观点,不代表苏州办公耗材网观点)
热门图文资料
佳能IR6000 双面复印时卡纸,打
佳能PG-830等墨盒加墨方法加墨方
EPSON LQ-730K 微调设置
佳能IP3680
hp1020 打印黑点非常多,问题原
相关技术资料链接(20条)¤&¤&¤&¤&¤&¤&¤&¤&¤&¤&¤&¤&¤&¤&
最新技术资料
?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&
推荐技术资料
?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&
网友热门关注
?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&?&靳东的第一任老婆江姗 难道老干部靳东也是二婚? - 妈妈育儿网
> 靳东的第一任老婆是江姗吗
靳东的第一任老婆江姗 难道老干部靳东也是二婚?
说起老干部,一般来说首先大家想到的就是霍建华和靳东了吧。靳东最近几部的影视作品也是没完美的诠释了什么叫老干部。不过除了演戏,靳东在戏中的角色外,我们很少有看到关于靳东私人感情方面的新闻。鲜少有关于靳东的绯闻产生。
不过,此前有消息传出,老干部靳东竟然离过婚,和现任妻子竟然已是二婚了?还传靳东的第一任老婆是江珊,而现任妻子李佳是第二任妻子。那到底传言是否属实呢?还是只是网上传播的谣言呢?就让我们一起来扒一扒,了解一下真相吧。
靳东的第一任老婆江姗
网传靳东与江珊两人在演《悲情母子》的时候因戏生情,当时靳东的演艺生涯不温不火,一直没能够红起来,后来,两人出热恋期时,还准备移居美国。但是后来两人却分手了。而后靳东江姗分手原因有人爆了出来,原因是江姗的女儿强力反对,不赞成靳东与江姗恋情,无奈之下两人断绝爱情关系,江姗则去到国外定居。
靳东的第一任老婆江姗
过后,2010年初,靳东与李佳共同出演《青春不言败》时,二人共坠爱河。有传言称因此导致李佳闪电离婚。
曾经靳东在胡玫执导的电视剧《开天辟地》中饰演重要角色,该剧一位主创人员私下里告诉记者:&总有一个脸上长痘痘的女孩来找靳东,开始我们都不认识,后来才听说是黄晓明他们班同学,俩人一凑一块就神神秘秘的。&
靳东的第一任老婆江姗
上一篇: 下一篇:
学龄前教育视频查看: 回复:20
上汽通用金融贷款的第一个收到扣手续费275怎么回事啊?[待解决]
rel="nofollow" href="http://my.pcauto.com.cn/9792000/fan/"
target="_blank" rel="nofollow" id="follow粉丝
rel="nofollow" href="http://my.pcauto.com.cn/9792000/pick/"
target="_blank" rel="nofollow" id="fan精华
最后修改IP: 192.168.240.196
您好,精华帖至少要有15张图片,文字不少200个字!并且是原创内容,布局合理。
楼主 电梯直达 楼
【上汽通用金融】友情提醒:我司将于明天开始根据汽车贷款合同13.3(5)扣除275元作为办理抵&押登记和注销的手续费,请及时存款。这就是我收到的短信,两年八万无息贷款的...275是什么东西?每个月都要多扣吗?坑爹的玩意儿啊!
如果你对以下车友回答满意,请设置一个推荐答案!
申请精华帖
您的申请已经提交,请耐心等待审核
1、审核通常是1-3个工作日 2、审核结果我们会通过系统消息给您答复
申请精华帖
您已经超过申请限制,不可再申请
您的申请连续三次被驳回,已经无法再申请精华帖,谢谢你对我们的支持!如有疑问,可以 投诉/建议&&
申请精华帖
您有发现精华的慧眼,赞一个!
1、我们会在1-3个工作日内完成审核
申请精华帖
此贴已经申请精华中,谢谢您的支持!
1、我们会在1-3个工作日内完成审核
申请精华帖
您好,该帖子经过审核后,发现内容不符合精华要求,无法申请成为精华,谢谢你的支持!
申请精华帖
抱歉,帖子还没达到精华标准
精华帖至少要有15张图片,文字不少于200个字!您的帖子未达到要求,不能申请精华。 查看精华帖标准
rel="nofollow" href="http://my.pcauto.com.cn/9132193/fan/"
target="_blank" rel="nofollow" id="follow粉丝
rel="nofollow" href="http://my.pcauto.com.cn/9132193/pick/"
target="_blank" rel="nofollow" id="fan精华
最后修改IP: 192.168.240.196
就第一个月扣,大绿本保管费,4s店没跟你说啊
rel="nofollow" href="http://my.pcauto.com.cn/9792000/fan/"
target="_blank" rel="nofollow" id="follow粉丝
rel="nofollow" href="http://my.pcauto.com.cn/9792000/pick/"
target="_blank" rel="nofollow" id="fan精华
最后修改IP: 192.168.240.196
木有...贷款真是各种坑,永远没有卖的精,就扣一次是吧
rel="nofollow" href="http://my.pcauto.com.cn/9132193/fan/"
target="_blank" rel="nofollow" id="follow粉丝
rel="nofollow" href="http://my.pcauto.com.cn/9132193/pick/"
target="_blank" rel="nofollow" id="fan精华
最后修改IP: 192.168.240.196
是的,放心
rel="nofollow" href="http://my.pcauto.com.cn/8054342/fan/"
target="_blank" rel="nofollow" id="follow粉丝
rel="nofollow" href="http://my.pcauto.com.cn/8054342/pick/"
target="_blank" rel="nofollow" id="fan精华
最后修改IP: 192.168.240.196
贷款要啥东西啊哥?
rel="nofollow" href="http://my.pcauto.com.cn/6970705/fan/"
target="_blank" rel="nofollow" id="follow粉丝
rel="nofollow" href="http://my.pcauto.com.cn/6970705/pick/"
target="_blank" rel="nofollow" id="fan精华
最后修改IP: 192.168.240.196
楼主贷款多久放款的?我刚通过初审,急得难受
rel="nofollow" href="http://my.pcauto.com.cn/6485720/fan/"
target="_blank" rel="nofollow" id="follow粉丝
rel="nofollow" href="http://my.pcauto.com.cn/6485720/pick/"
target="_blank" rel="nofollow" id="fan精华
最后修改IP: 192.168.240.196
交首付的时候就把这个月的贷款一起交上?
rel="nofollow" href="http://my.pcauto.com.cn//fan/"
target="_blank" rel="nofollow" id="follow粉丝
rel="nofollow" href="http://my.pcauto.com.cn//pick/"
target="_blank" rel="nofollow" id="fan精华
最后修改IP: 192.168.240.196
我也要扣,只加一个月
rel="nofollow" href="http://my.pcauto.com.cn/9792000/fan/"
target="_blank" rel="nofollow" id="follow粉丝
rel="nofollow" href="http://my.pcauto.com.cn/9792000/pick/"
target="_blank" rel="nofollow" id="fan精华
最后修改IP: 192.168.240.196
rel="nofollow" href="http://my.pcauto.com.cn//fan/"
target="_blank" rel="nofollow" id="follow粉丝
rel="nofollow" href="http://my.pcauto.com.cn//pick/"
target="_blank" rel="nofollow" id="fan精华
荣威550 …
荣威550 2010款 550 1.8 MT 世博风尚版
最后修改IP: 192.168.240.196
无息贷款是个大坑,通用贴息4儿子挖坑,车提回家要比现款多付大几仟块,我真是死后悔了!奉劝买车的朋友能不按揭千万别走按揭,巨坑!!!
rel="nofollow" href="http://my.pcauto.com.cn//fan/"
target="_blank" rel="nofollow" id="follow粉丝
rel="nofollow" href="http://my.pcauto.com.cn//pick/"
target="_blank" rel="nofollow" id="fan精华
最后修改IP: 192.168.240.196
就是一个抵押解封的价格&&提前收取的
rel="nofollow" href="http://my.pcauto.com.cn//fan/"
target="_blank" rel="nofollow" id="follow粉丝
rel="nofollow" href="http://my.pcauto.com.cn//pick/"
target="_blank" rel="nofollow" id="fan精华
最后修改IP: 192.168.240.196
我的就手续费&&别的什么没有&&相对来讲&八万块&&两年三千的利息上哪找去!
rel="nofollow" href="http://my.pcauto.com.cn/6760095/fan/"
target="_blank" rel="nofollow" id="follow粉丝
rel="nofollow" href="http://my.pcauto.com.cn/6760095/pick/"
target="_blank" rel="nofollow" id="fan精华
最后修改IP: 192.168.240.196
我也收到短信了,有点生气,贷款的时候也没告诉我要收手续费啊
rel="nofollow" href="http://my.pcauto.com.cn//fan/"
target="_blank" rel="nofollow" id="follow粉丝
rel="nofollow" href="http://my.pcauto.com.cn//pick/"
target="_blank" rel="nofollow" id="fan精华
最后修改IP: 192.168.240.196
我八万块给别人用,两分的利息,一个月就能收回1600块,一年就接近两万块了
rel="nofollow" href="http://my.pcauto.com.cn//fan/"
target="_blank" rel="nofollow" id="follow粉丝
rel="nofollow" href="http://my.pcauto.com.cn//pick/"
target="_blank" rel="nofollow" id="fan精华
最后修改IP: 192.168.240.196
我贷款的时候人家跟我说了&说是四百&&最后是收275
rel="nofollow" href="http://my.pcauto.com.cn/6760095/fan/"
target="_blank" rel="nofollow" id="follow粉丝
rel="nofollow" href="http://my.pcauto.com.cn/6760095/pick/"
target="_blank" rel="nofollow" id="fan精华
最后修改IP: 192.168.240.196
根本就没人和我说过。。。275后加一箱油了
rel="nofollow" href="http://my.pcauto.com.cn//fan/"
target="_blank" rel="nofollow" id="follow粉丝
rel="nofollow" href="http://my.pcauto.com.cn//pick/"
target="_blank" rel="nofollow" id="fan精华
荣威550 …
荣威550 2010款 550 1.8 MT 世博风尚版
最后修改IP: 192.168.240.196
走按揭你必须在4儿子那里买两年保险,每年比外面买多付一仟多!
rel="nofollow" href="http://my.pcauto.com.cn/6652965/fan/"
target="_blank" rel="nofollow" id="follow粉丝
rel="nofollow" href="http://my.pcauto.com.cn/6652965/pick/"
target="_blank" rel="nofollow" id="fan精华
最后修改IP: 192.168.240.196
很快就批下来了&我的是上午初审,下午就通知我,等提车放款了
rel="nofollow" href="http://my.pcauto.com.cn//fan/"
target="_blank" rel="nofollow" id="follow粉丝
rel="nofollow" href="http://my.pcauto.com.cn//pick/"
target="_blank" rel="nofollow" id="fan精华
最后修改IP: 192.168.240.196
第一年是多了一点,因为是全险,第二年可以打折,不过我就是在外面买的话我也是买全险,安心
只可添加一张图片,多张图片请选高级模式
您需要登录后才可以发帖&&&&&&│&&&&│&&&&
新用户注册有机会领99元现金红包(限时活动)
科鲁兹更多相关问题博客分类:
在涉及到密码存储问题上,应该加密/生成密码摘要存储,而不是存储明文密码。比如之前的600w csdn账号泄露对用户可能造成很大损失,因此应加密/生成不可逆的摘要方式存储。
5.1 编码/解码
Shiro提供了base64和16进制字符串编码/解码的API支持,方便一些编码解码操作。Shiro内部的一些数据的存储/表示都使用了base64和16进制字符串。
String str = "hello";
String base64Encoded = Base64.encodeToString(str.getBytes());
String str2 = Base64.decodeToString(base64Encoded);
Assert.assertEquals(str, str2);
通过如上方式可以进行base64编码/解码操作,更多API请参考其Javadoc。
String str = "hello";
String base64Encoded = Hex.encodeToString(str.getBytes());
String str2 = new String(Hex.decode(base64Encoded.getBytes()));
Assert.assertEquals(str, str2);
通过如上方式可以进行16进制字符串编码/解码操作,更多API请参考其Javadoc。
还有一个可能经常用到的类CodecSupport,提供了toBytes(str, "utf-8") / toString(bytes, "utf-8")用于在byte数组/String之间转换。
5.2 散列算法
散列算法一般用于生成数据的摘要信息,是一种不可逆的算法,一般适合存储密码之类的数据,常见的散列算法如MD5、SHA等。一般进行散列时最好提供一个salt(盐),比如加密密码“admin”,产生的散列值是“a5ae4a801fc3”,可以到一些md5解密网站很容易的通过散列值得到密码“admin”,即如果直接对密码进行散列相对来说破解更容易,此时我们可以加一些只有系统知道的干扰数据,如用户名和ID(即盐);这样散列的对象是“密码+用户名+ID”,这样生成的散列值相对来说更难破解。
String str = "hello";
String salt = "123";
String md5 = new Md5Hash(str, salt).toString();//还可以转换为 toBase64()/toHex()
如上代码通过盐“123”MD5散列“hello”。另外散列时还可以指定散列次数,如2次表示:md5(md5(str)):“new Md5Hash(str, salt, 2).toString()”。
String str = "hello";
String salt = "123";
String sha1 = new Sha256Hash(str, salt).toString();
使用SHA256算法生成相应的散列数据,另外还有如SHA1、SHA512算法。
Shiro还提供了通用的散列支持:
String str = "hello";
String salt = "123";
//内部使用MessageDigest
String simpleHash = new SimpleHash("SHA-1", str, salt).toString();
通过调用SimpleHash时指定散列算法,其内部使用了Java的MessageDigest实现。
为了方便使用,Shiro提供了HashService,默认提供了DefaultHashService实现。
DefaultHashService hashService = new DefaultHashService(); //默认算法SHA-512
hashService.setHashAlgorithmName("SHA-512");
hashService.setPrivateSalt(new SimpleByteSource("123")); //私盐,默认无
hashService.setGeneratePublicSalt(true);//是否生成公盐,默认false
hashService.setRandomNumberGenerator(new SecureRandomNumberGenerator());//用于生成公盐。默认就这个
hashService.setHashIterations(1); //生成Hash值的迭代次数
HashRequest request = new HashRequest.Builder()
.setAlgorithmName("MD5").setSource(ByteSource.Util.bytes("hello"))
.setSalt(ByteSource.Util.bytes("123")).setIterations(2).build();
String hex = hashService.computeHash(request).toHex();
1、首先创建一个DefaultHashService,默认使用SHA-512算法;
2、可以通过hashAlgorithmName属性修改算法;
3、可以通过privateSalt设置一个私盐,其在散列时自动与用户传入的公盐混合产生一个新盐;
4、可以通过generatePublicSalt属性在用户没有传入公盐的情况下是否生成公盐;
5、可以设置randomNumberGenerator用于生成公盐;
6、可以设置hashIterations属性来修改默认加密迭代次数;
7、需要构建一个HashRequest,传入算法、数据、公盐、迭代次数。
SecureRandomNumberGenerator用于生成一个随机数:
SecureRandomNumberGenerator randomNumberGenerator =
new SecureRandomNumberGenerator();
randomNumberGenerator.setSeed("123".getBytes());
String hex = randomNumberGenerator.nextBytes().toHex();
5.3 加密/解密
Shiro还提供对称式加密/解密算法的支持,如AES、Blowfish等;当前还没有提供对非对称加密/解密算法支持,未来版本可能提供。
AES算法实现:
AesCipherService aesCipherService = new AesCipherService();
aesCipherService.setKeySize(128); //设置key长度
Key key = aesCipherService.generateNewKey();
String text = "hello";
String encrptText =
aesCipherService.encrypt(text.getBytes(), key.getEncoded()).toHex();
String text2 =
new String(aesCipherService.decrypt(Hex.decode(encrptText), key.getEncoded()).getBytes());
Assert.assertEquals(text, text2);
更多算法请参考示例com.github.zhangkaitao.shiro.chapter5.hash.CodecAndCryptoTest。
5.4 PasswordService/CredentialsMatcher
Shiro提供了PasswordService及CredentialsMatcher用于提供加密密码及验证密码服务。
public interface PasswordService {
//输入明文密码得到密文密码
String encryptPassword(Object plaintextPassword) throws IllegalArgumentE
public interface CredentialsMatcher {
//匹配用户输入的token的凭证(未加密)与系统提供的凭证(已加密)
boolean doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info);
Shiro默认提供了PasswordService实现DefaultPasswordService;CredentialsMatcher实现PasswordMatcher及HashedCredentialsMatcher(更强大)。
DefaultPasswordService配合PasswordMatcher实现简单的密码加密与验证服务
1、定义Realm(com.github.zhangkaitao.shiro.chapter5.hash.realm.MyRealm)
public class MyRealm extends AuthorizingRealm {
private PasswordService passwordS
public void setPasswordService(PasswordService passwordService) {
this.passwordService = passwordS
//省略doGetAuthorizationInfo,具体看代码
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
return new SimpleAuthenticationInfo(
passwordService.encryptPassword("123"),
getName());
为了方便,直接注入一个passwordService来加密密码,实际使用时需要在Service层使用passwordService加密密码并存到数据库。
2、ini配置(shiro-passwordservice.ini)
passwordService=org.apache.shiro.authc.credential.DefaultPasswordService
hashService=org.apache.shiro.crypto.hash.DefaultHashService
passwordService.hashService=$hashService
hashFormat=org.apache.shiro.crypto.hash.format.Shiro1CryptFormat
passwordService.hashFormat=$hashFormat
hashFormatFactory=org.apache.shiro.crypto.hash.format.DefaultHashFormatFactory
passwordService.hashFormatFactory=$hashFormatFactory
passwordMatcher=org.apache.shiro.authc.credential.PasswordMatcher
passwordMatcher.passwordService=$passwordService
myRealm=com.github.zhangkaitao.shiro.chapter5.hash.realm.MyRealm
myRealm.passwordService=$passwordService
myRealm.credentialsMatcher=$passwordMatcher
securityManager.realms=$myRealm
2.1、passwordService使用DefaultPasswordService,如果有必要也可以自定义;
2.2、hashService定义散列密码使用的HashService,默认使用DefaultHashService(默认SHA-256算法);
2.3、hashFormat用于对散列出的值进行格式化,默认使用Shiro1CryptFormat,另外提供了Base64Format和HexFormat,对于有salt的密码请自定义实现ParsableHashFormat然后把salt格式化到散列值中;
2.4、hashFormatFactory用于根据散列值得到散列的密码和salt;因为如果使用如SHA算法,那么会生成一个salt,此salt需要保存到散列后的值中以便之后与传入的密码比较时使用;默认使用DefaultHashFormatFactory;
2.5、passwordMatcher使用PasswordMatcher,其是一个CredentialsMatcher实现;
2.6、将credentialsMatcher赋值给myRealm,myRealm间接继承了AuthenticatingRealm,其在调用getAuthenticationInfo方法获取到AuthenticationInfo信息后,会使用credentialsMatcher来验证凭据是否匹配,如果不匹配将抛出IncorrectCredentialsException异常。
3、测试用例请参考com.github.zhangkaitao.shiro.chapter5.hash.PasswordTest。
另外可以参考配置shiro-jdbc-passwordservice.ini,提供了JdbcRealm的测试用例,测试前请先调用sql/shiro-init-data.sql初始化用户数据。
如上方式的缺点是:salt保存在散列值中;没有实现如密码重试次数限制。
HashedCredentialsMatcher实现密码验证服务
Shiro提供了CredentialsMatcher的散列实现HashedCredentialsMatcher,和之前的PasswordMatcher不同的是,它只用于密码验证,且可以提供自己的盐,而不是随机生成盐,且生成密码散列值的算法需要自己写,因为能提供自己的盐。
1、生成密码散列值
此处我们使用MD5算法,“密码+盐(用户名+随机数)”的方式生成散列值:
String algorithmName = "md5";
String username = "liu";
String password = "123";
String salt1 =
String salt2 = new SecureRandomNumberGenerator().nextBytes().toHex();
int hashIterations = 2;
SimpleHash hash = new SimpleHash(algorithmName, password, salt1 + salt2, hashIterations);
String encodedPassword = hash.toHex();
如果要写用户模块,需要在新增用户/重置密码时使用如上算法保存密码,将生成的密码及salt2存入数据库(因为我们的散列算法是:md5(md5(密码+username+salt2)))。
2、生成Realm(com.github.zhangkaitao.shiro.chapter5.hash.realm.MyRealm2)
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
String username = "liu"; //用户名及salt1
String password = "202cb962ac152d234b70"; //加密后的密码
String salt2 = "202cb962ac152d234b70";
SimpleAuthenticationInfo ai =
new SimpleAuthenticationInfo(username, password, getName());
ai.setCredentialsSalt(ByteSource.Util.bytes(username+salt2)); //盐是用户名+随机数
此处就是把步骤1中生成的相应数据组装为SimpleAuthenticationInfo,通过SimpleAuthenticationInfo的credentialsSalt设置盐,HashedCredentialsMatcher会自动识别这个盐。
如果使用JdbcRealm,需要修改获取用户信息(包括盐)的sql:“select password, password_salt from users where username = ?”,而我们的盐是由username+password_salt组成,所以需要通过如下ini配置(shiro-jdbc-hashedCredentialsMatcher.ini)修改:
jdbcRealm.saltStyle=COLUMN
jdbcRealm.authenticationQuery=select password, concat(username,password_salt) from users where username = ?
jdbcRealm.credentialsMatcher=$credentialsMatcher
1、saltStyle表示使用密码+盐的机制,authenticationQuery第一列是密码,第二列是盐;
2、通过authenticationQuery指定密码及盐查询SQL;
此处还要注意Shiro默认使用了apache commons BeanUtils,默认是不进行Enum类型转型的,此时需要自己注册一个Enum转换器“BeanUtilsBean.getInstance().getConvertUtils().register(new EnumConverter(), JdbcRealm.SaltStyle.class);”具体请参考示例“com.github.zhangkaitao.shiro.chapter5.hash.PasswordTest”中的代码。
另外可以参考配置shiro-jdbc-passwordservice.ini,提供了JdbcRealm的测试用例,测试前请先调用sql/shiro-init-data.sql初始化用户数据。
3、ini配置(shiro-hashedCredentialsMatcher.ini)
credentialsMatcher=org.apache.shiro.authc.credential.HashedCredentialsMatcher
credentialsMatcher.hashAlgorithmName=md5
credentialsMatcher.hashIterations=2
credentialsMatcher.storedCredentialsHexEncoded=true
myRealm=com.github.zhangkaitao.shiro.chapter5.hash.realm.MyRealm2
myRealm.credentialsMatcher=$credentialsMatcher
securityManager.realms=$myRealm
1、通过credentialsMatcher.hashAlgorithmName=md5指定散列算法为md5,需要和生成密码时的一样;
2、credentialsMatcher.hashIterations=2,散列迭代次数,需要和生成密码时的意义;
3、credentialsMatcher.storedCredentialsHexEncoded=true表示是否存储散列后的密码为16进制,需要和生成密码时的一样,默认是base64;
此处最需要注意的就是HashedCredentialsMatcher的算法需要和生成密码时的算法一样。另外HashedCredentialsMatcher会自动根据AuthenticationInfo的类型是否是SaltedAuthenticationInfo来获取credentialsSalt盐。
4、测试用例请参考com.github.zhangkaitao.shiro.chapter5.hash.PasswordTest。
密码重试次数限制
如在1个小时内密码最多重试5次,如果尝试次数超过5次就锁定1小时,1小时后可再次重试,如果还是重试失败,可以锁定如1天,以此类推,防止密码被暴力破解。我们通过继承HashedCredentialsMatcher,且使用Ehcache记录重试次数和超时时间。
com.github.zhangkaitao.shiro.chapter5.hash.credentials.RetryLimitHashedCredentialsMatcher:
public boolean doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info) {
String username = (String)token.getPrincipal();
//retry count + 1
Element element = passwordRetryCache.get(username);
if(element == null) {
element = new Element(username , new AtomicInteger(0));
passwordRetryCache.put(element);
AtomicInteger retryCount = (AtomicInteger)element.getObjectValue();
if(retryCount.incrementAndGet() & 5) {
//if retry count & 5 throw
throw new ExcessiveAttemptsException();
boolean matches = super.doCredentialsMatch(token, info);
if(matches) {
//clear retry count
passwordRetryCache.remove(username);
如上代码逻辑比较简单,即如果密码输入正确清除cache中的记录;否则cache中的重试次数+1,如果超出5次那么抛出异常表示超出重试次数了。
示例源代码:;可加群探讨Spring/Shiro技术。
浏览 135990
看作者的文章 基本看不懂 。不否认作者的编程水平,但是教程写的确实烂,毫无讲解功力,根本不适合初学者。您这话说的好酸。。。。真觉得人家讲解的不怎么样,你也写一个出来,让我们观摩观摩下,看看您口中的‘上乘之作’是什么样的呗?发表自己的意见是好事,但对别人的尊重是大前提。人家讲的不好的地方,你大可就着自己的想法将相关内容复述一遍,发在评论里,不对大家都有益嘛?最后,力挺作者,,对于把shiro弄明白点这事儿,还得编撸代码边看的操作辅助才行
找到原因了,代码少抄了一句。BeanUtilsBean.getInstance().getConvertUtils().register(new EnumConverter(), JdbcRealm.SaltStyle.class);
加了这项,还报错,org.apache.shiro.config.ConfigurationException: Unable to set property 'saltStyle' with value [COLUMN] on object of type org.apache.shiro.realm.jdbc.JdbcRealm.& If 'COLUMN' is a reference to another (previously defined) object, prefix it with '$' to indicate that the referenced object should be used as the actual value.& For example, $COLUMN
为什么我验证“login("classpath:shiro-jdbc-passwordservice.ini", "wu", "123");”会出现“IncorrectCredentialsException”,明明MyRealm直接返回成功。。。 你sql语句执行了吗?
楼主的文章写了好些年了,现在还来打扰有些不好意思。关于 publicSalt 和 privateSalt;privateSalt 手动传入,isGeneratePublicSalt == true;时 如果publicSalt 没有传入,则生成一个随机的publicSalt 。& 然后 publicSalt& + privateSalt =&&&再然后 source(例如用户名) + salt 得到hash结果。如果 algorithmName == MD5,因为算法不可逆,那该怎么验证某个 用户名 呢。难道 随机生成的 publicSalt 会被保存吗?如果不保存,该如何验证某个用户名呢?如果保存了,那保存到哪了呢?谢谢解答,不胜感激。要保存,如果是涉及到密码 则要落到db;如果是登录cookie之类的,redis即可,丢了也无所谓;比如滴滴的大家用一个秘钥;
大爷的吵啥? & (1)谁能告诉我啥是公盐?私盐好理解,没人一个嘛,这个公盐是什么一般用在什么情况下。(2)还有第三章中的资源:操作:实例&&& 这个实例指的是什么。瞎叨叨不如帮我解决个问题大爷们& 公盐你就相对当公钥来看不就懂了?实际上只是叫法不同而已,如果你连公钥和私钥都不明白的话,建议还是先了解一下密码学吧
& 上一页 1
jinnianshilongnian
浏览量:1858409
浏览量:2348358
浏览量:4741494
浏览量:189233
浏览量:1348760
浏览量:198073
浏览量:4291946
浏览量:511459
浏览量:550468
这个尤其在springmvc+spring+hibernate ...
在网上看了一些服务降级的概念,感觉说的有两个方向:一个是针对提 ...
请问京东的自动降级标准是什么呢,除了依靠日志级别来判断,还有其 ...
&dependency&
&group ...
我想说的是 如果是用客户端进行加密算法 提交服务器如果这个客户 ...
(window.slotbydup=window.slotbydup || []).push({
id: '4773203',
container: s,
size: '200,200',
display: 'inlay-fix'

我要回帖

更多关于 怪物猎人世界太刀 的文章

 

随机推荐