1
我想要注册页面在PHP,并用散列和bcrypt放在数据库中的密码。我怎样才能让bcrypt在PHP和jbcrypt在Java兼容
我也想在Java中的登录系统,并在相同的密码获取密码,使用jbcrypt。
怎样才能让jbcrypt和bcrypt在PHP兼容,具有相同的盐。
我想要注册页面在PHP,并用散列和bcrypt放在数据库中的密码。我怎样才能让bcrypt在PHP和jbcrypt在Java兼容
我也想在Java中的登录系统,并在相同的密码获取密码,使用jbcrypt。
怎样才能让jbcrypt和bcrypt在PHP兼容,具有相同的盐。
你可以看看这个:
https://github.com/ircmaxell/password_compat/issues/49
这对我的工作:
public static void main(String[] args) {
//Laravel bcrypt out
String hash_php = "$2y$10$ss9kwE8iSIqcJOAPhZR0Y.2XdYXJTFJ1/wGq6SUv74vULE7uhKUIO".replaceFirst("2y", "2a");
System.out.println("hash php " + hash_php);
//String a_hash = BCrypt.hashpw("123456", BCrypt.gensalt());
//System.out.println("Encrypt " + a_hash);
if (BCrypt.checkpw("123456", hash_php)) {
System.out.println("It matches");
} else {
System.out.println("It does not match");
}
//mtPruebaRecuperarClave();
}
控制台 - 输出
我希望我们帮助你。
它为我工作!非常感谢@cristianippolito – Brigadier
澄清语法 – garyh