You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
785 B
29 lines
785 B
public class Md5PassWordVerifyRule{
|
|
public static void cs(Student student){
|
|
// 结合盐值和口令进行散列计算
|
|
// String password = DigestUtils.md5Hex(str);
|
|
|
|
student.setPassWord("password");// Noncompliant {{应使用单向不可逆的加密算法}}
|
|
|
|
}
|
|
|
|
static class Student {
|
|
private String name;
|
|
private String password;
|
|
|
|
public Student(String name, String password) {
|
|
this.name = name;
|
|
this.password = password;
|
|
}
|
|
|
|
public void setPassWord(String password) {
|
|
this.password = password;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "Student{" + "name='" + name + '\'' + ", password='" + password + '\'' + '}';
|
|
}
|
|
}
|
|
|
|
} |