密码类设计问题 [英] Password class design problem

查看:106
本文介绍了密码类设计问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我必须创建一个用于将用户的现有密码更改为其他密码的表单.所以我需要一个类来专门针对password.Password类包含密码字符串和新密码字符串?或仅包含密码字符串.哪个是好的.对象传递或使用一个密码对象存储并将两个参数传递给服务器.哪个是好的?任何人都可以告诉.

问候,
Shameen

Hello All,

I have to create a form for changing existing password of a user to different.So i need a class to do that especialy for password.Password class contains password string and new password string? or only it contains password string.Which one is good.object passing or using one password object storing and passing two parameters to server.Which one is good?Can any one tell.

Regards,
Shameen

推荐答案

密码类不应包含任何字符串:它可以接受一个字符串(或多个包含用户ID和/或salt值的字符串),然后返回布尔匹配/不匹配,它可能返回适合数据库存储的哈希值-但不应存储字符串.

这里有一些有关密码存储的信息:密码存储:如何做到的. [^ ]
A password class should not contain any strings: it could accept a string (or a number of strings to include userID and /or salt value), and return a boolean match / not match, and it could return a hashed value suitable for database storage - but is should not store a string.

There is some info on password storage here: Password Storage: How to do it.[^]


这篇关于密码类设计问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆