如果我用SHA1加密密码然后加盐,然后用bcrypt加密它.是否比将盐加入未加密的密码然后用bcrypt加密更安全?
谢谢.
使用BCrypt技术将密码作为哈希存储到数据库中.虽然与MD5,SHA-1等快速哈希算法相比可能有点慢,但我们决定更安全.
在.Net中我使用http://bcrypt.codeplex.com/实现了
BCrypt.Net.BCrypt.HashPassword("Password", BCrypt.Net.BCrypt.GenerateSalt(12));
Run Code Online (Sandbox Code Playgroud)
在我们的网站中,管理员将为新用户创建用户名和密码.
存储散列密码没有问题.但是如果管理员想要更新密码,他需要查看旧密码.我没有看到任何解密存储在Bcrypt.Net中的数据库中的散列值的方法.
有没有办法从Bcrypt哈希密码生成文本?但是我同意这不应该是可能的,但有一些情况我们会这样做:(
更新:我决定使用存储在某些表中的默认密码作为纯文本和散列文本并存储为用户的密码.当用户登录该站点时,他将被迫更改密码,直到他重置为止.这听起来不错吗?
我有一个 Web 应用程序 (asp.net mvc),我需要加密一些将存储在数据库中的数据。由于我使用 BCrypt 作为用户密码,我正在考虑使用它来加密其他数据……你怎么看?BCrypt 仅用于密码还是我也可以将其用于其他数据?或者也许有最好的方法来做到这一点?
提前致谢!
大家好我正在尝试匹配我使用的PHP登录系统
define('PASSWORD_ENCRYPTION', "bcrypt");
define('PASSWORD_SHA512_ITERATIONS', 25000);
define('PASSWORD_BCRYPT_COST', "13");
define('PASSWORD_SALT', "/8Wncr26eAmxD1l6cAF9F8"); //22 characters to be appended on first 7 characters that will be generated using PASSWORD_ info above
Run Code Online (Sandbox Code Playgroud)
我的C#:
string myPassword = this.password_txt.Text;
string mySalt = "$2a$13$/8Wncr26eAmxD1l6cAF9F8";
string hashed = BCrypt.HashPassword(myPassword, mySalt);
Run Code Online (Sandbox Code Playgroud)
问题:我使用C#编写的哈希密码与数据库上的登录PHP哈希密码不匹配...
当我尝试为我的应用程序安装flask-bcrypt库时,它会抛出这个错误:
创建build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/bcrypt
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c bcrypt/bcrypt.c -o build/temp.linux-x86_64-2.7/bcrypt/bcrypt.o
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c bcrypt/bcrypt_pbkdf.c -o build/temp.linux-x86_64-2.7/bcrypt/bcrypt_pbkdf.o
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c bcrypt/bcrypt_python.c -o build/temp.linux-x86_64-2.7/bcrypt/bcrypt_python.o
bcrypt/bcrypt_python.c:18:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)
怎么解决?-提前致谢!
现在我正在尝试在Windows 10中安装bcrypt,但是每当运行webrick服务器时我都会收到加载错误,如下所示.
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bcrypt-3.1.10-x64-mingw32/lib/bcrypt.rb:16:in
`require': cannot load such file -- bcrypt_ext (LoadError)
Run Code Online (Sandbox Code Playgroud)
我使用rails 4.1.5和ruby 2.2.3.当我使用Windows 8.1时,bcrypt没有问题.当我使用Windows 8.1时,ruby版本是2.1.6
我该如何解决这个bcrypt问题?
已经在这方面工作了一段时间,似乎无法弄清楚。浏览了帖子,我可以找到 & stackoverflow 帖子。似乎没有任何效果。记录的错误:
Users/username/Sites/dev/node_modules/bcrypt-nodejs/bCrypt.js:642
throw "Incorrect arguments";
^
Incorrect arguments
Run Code Online (Sandbox Code Playgroud)
user.js 和passport.js 可以在这里看到。 http://pastebin.com/CEy6QBkP
错误来自此函数和 compareSync
var isValidPassword = function(user, password){
return bCrypt.compareSync(password, user.password);
}
Run Code Online (Sandbox Code Playgroud)
与 req.body.password 相比,与哈希和盐有关。任何帮助将不胜感激。谢谢。
在上学的时候,我被要求使用bcrypt正确存储密码(隐藏在数据库中)。比较它们时,该方法始终返回false。我的代码如下所示:
寄存器:
String username = editTextUsername.getText().toString();
String password = editTextPassword.getText().toString();
String hashedPW = BCrypt.hashpw(password, BCrypt.gensalt());
User user = new User(username, hashedPW);
user.save();
Run Code Online (Sandbox Code Playgroud)
登录:
String username = editTextUsername.getText().toString();
String enteredPassword = editTextPassword.getText().toString();
String hashedPW = BCrypt.hashpw(enteredPassword, BCrypt.gensalt());
User u = usercontroller.getUser(username); //gets user object
String password = u.getPassword;
BCrypt.checkpw(password, hashedPW); //always returns false
Run Code Online (Sandbox Code Playgroud)
我希望有BCrypt专业人士可以为我提供帮助。先感谢您!
首先,我在Windows 10中开发.我vcvarsall.bat amd64在每次编译之前运行.我在用:
Elixir 1.4.2
凤凰城v1.2.1
我开始了一个全新的项目,制作了一个用户表,一切都运行良好.我添加了comeonin哈希pw,我不能再创建用户.我得到一个错误页面说:
function Comeonin.Bcrypt.hashpwsalt/1 is undefined (module Comeonin.Bcrypt is not available)
以下是相关文件的代码:
Mix.exs
# mix.exs
...
def application do
[mod: {PollarAppV2, []},
applications: [:phoenix, :phoenix_pubsub, :phoenix_html, :cowboy, :logger, :gettext,
:phoenix_ecto, :postgrex, :comeonin, :timex]]
end
...
defp deps do
[{:phoenix, "~> 1.2.1"},
{:phoenix_pubsub, "~> 1.0"},
{:phoenix_ecto, "~> 3.0"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 2.6"},
{:phoenix_live_reload, "~> 1.0", only: :dev},
{:gettext, "~> 0.11"},
{:cowboy, "~> 1.0"},
{:comeonin, "~> 3.0"},
{:timex, "~> 3.0"}]
end
...
Run Code Online (Sandbox Code Playgroud)
User.ex …
我对仅使用 bcrypt 的用户名和密码的用户注册验证有特定要求(没有设计!)
我目前有工作:
validates :username,
presence: true,
length: { minimum: 2, maximum: 15 },
uniqueness: true
validates :password,
presence: true,
length: { minimum: 10 },
Run Code Online (Sandbox Code Playgroud)
我需要:
bcrypt ×10
c# ×2
passwords ×2
security ×2
android ×1
asp.net-mvc ×1
cryptography ×1
elixir ×1
encryption ×1
flask ×1
hash ×1
java ×1
passport.js ×1
python ×1
salt ×1
sha1 ×1
ubuntu ×1
validation ×1
windows-10 ×1