标签: bcrypt

我可以阻止本地用户窥探包含管理员密码的HTTPS标头吗?

我的程序通过SSL向网页发送请求,并在标题中(https://example.com/index.php?clientid=xxxx?spcode=xxxx)是一个管理员密码,用于确定它们是否是有效的客户端在我向他们发送一堆数据之前我的系统.

如果一个流氓员工通过窥探本地SSL数据来获取此密码,那么如果他猜测订单号(不是很难),他可能会发送和接收客户订单.

我知道如何使用bcrypt保护我系统上的某人密码.但是,当其他人使用他们的系统时,如何保护某人的密码?

我知道您不应该发送预先调整过的密码,否则有可能泄露您的盐.我应该使用一些软的临时传输哈希(一个不同于我存储在DB中的哈希).我认为这不是最好的方式,所以我要求大家帮忙.我在Stack Exchange找到了一些很棒的技巧.

每个人都提前感谢您的时间.我期待着你的想法.

security passwords hash https bcrypt

0
推荐指数
1
解决办法
266
查看次数

哈希和非哈希?

是否可以在 java 中使用 bcrypt 进行散列并再次取消散列?甚至有可能吗?我正在尝试一些新的东西,但我对 Unhashing 一无所知(如果可能的话)。如果可能的话,有人能给我举个例子吗?

如果知道密钥,是否有可逆的散列算法?

java hash bcrypt

0
推荐指数
1
解决办法
8517
查看次数

Bcrypt无法安装

我在我的Ubuntu系统上安装名为"bcrypt"的npm软件包时遇到问题.

这就是我做的:

sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
sudo npm install bcrypt

这就是我得到的:

打字时:sudo npm install bcrypt

npm http GET https://registry.npmjs.org/bcrypt
npm http 304 https://registry.npmjs.org/bcrypt
npm http GET https://registry.npmjs.org/bindings/1.0.0
npm http GET https://registry.npmjs.org/nan/1.3.0
npm http 304 https://registry.npmjs.org/nan/1.3.0
npm http 304 https://registry.npmjs.org/bindings/1.0.0

> bcrypt@0.8.0 install /home/gatsu/salongapp/salongapp/node_modules/bcrypt
> node-gyp rebuild

/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack …
Run Code Online (Sandbox Code Playgroud)

ubuntu bcrypt node.js npm

0
推荐指数
1
解决办法
2615
查看次数

用bcrypt(PHP)比较两个哈希值

在我的数据库中,我保存了密码

password_hash($user->getPassword(), PASSWORD_BCRYPT);
Run Code Online (Sandbox Code Playgroud)

在登录表单中,用户输入此密码,我将密码编码为bcrypt字符串,并将加密密码(因为我没有SSL)提交给服务器.

所以我的问题是可以比较用bcrypt生成的两个哈希值吗?

php security password-protection bcrypt

0
推荐指数
1
解决办法
1486
查看次数

Socket.IO抛出类型错误

我有一个简单的NodeJS服务器,它使用bcrypt,mysql和socket.IO,它可以作为mysql数据库和聊天服务器的网关.此服务器使用Socket.IO客户端连接到客户端,并使用Socket.IO事件将请求发送到服务器.但是,注册事件会抛出一个Type Error : undefined is not a function.我检查了所有功能,但它们存在,所以我不知道发生了什么.这是我处理注册事件的代码:

socket.on('registration request', function(msg,err) {
        var split = msg.toString().split(":§:");
        var userName = split[0];
        var password = split[1];
        var email = split[2];

        console.log("Registration request : " + userName + " <===> " + email); //<====== Prints this to the console then crashes and returns the message below
        if(err){
            console.log("Socket Error !!\n" + err);
        }
        if (pattern.test(userName) && emailRegex.test(email)) {
            console.log("Data is valid. Coding password");
            password = bcrypt.hashSync(password.toString(), 2);
            console.log("Querying DB");
            DBConnection.query(
                    "INSERT …
Run Code Online (Sandbox Code Playgroud)

mysql bcrypt node.js socket.io

0
推荐指数
1
解决办法
5692
查看次数

使用Java使用bCrypt加密密码后,如何从哈希中分离盐?

好的,我正在使用Java与Spring MVC和Hibernate.我是第一次使用bCrypt进行密码加密.据我所知,bCrypt将salt与hash集成在一起.我现在设置它以便密码被接受为输入,用bCrypt编码,并保存是我的SQL数据库的一列.

但是,我想将盐与哈希分开并将它们分开存储.我已经阅读并尝试了很多东西,但找不到办法做到这一点.因此,如果有人能指出我正确的方向,这将是一个很大的帮助.

这就是我目前所拥有的.

这是设置bCrypt的基本代码.它需要我的密码字符串,并加密它.

 BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();  
    String hashedPassword = passwordEncoder.encode(password);  
Run Code Online (Sandbox Code Playgroud)

下面的代码获取密码并将其放入DB中的单个列中.

    employee.setPasswordSalt(hashedPassword);
Run Code Online (Sandbox Code Playgroud)

java encryption hibernate bcrypt password-encryption

0
推荐指数
1
解决办法
1275
查看次数

Laravel 5.2 Bcrypt因此打破了Auth

所以我不知道发生了什么,但是对你来说很有趣.如果我这样做

return bcrypt('hello');
exit();
Run Code Online (Sandbox Code Playgroud)

运行3次这是我回来的:

第1名: $2y$10$T11IfKkHIAIXi0SRhjMXKeSQQtze8zBVZnWdlRXfsSdcCXKIq/n7W

第二: $2y$10$DpKVtgbF4OVa3jm.wdG5..jb9AvXsuo2EfqnjuzmsEVCmcOVr5nKq

第三: $2y$10$0.ziFneJu0wrS2b3rHA6kucnGBkS2MRtgfp0gtEb/7ZOCV8dG3Mmq

我很难过.工作在laravel 5.1 - 不知道这是不是我的错.对不起.还有谁有相同的问题吗?它有解决方法吗?

没有多大关系,如果我得到一个答案,5.2是法士特不是很好,我搬回laravel 5.1,因为A)它更稳定,B)之前,泰勒Otwell让吉本斯在项目开发它.虽然我会问,有人遇到过这个问题并将其修复为其他偷看.

php bcrypt laravel

0
推荐指数
1
解决办法
1196
查看次数

Bcrypt非法参数:数字

我的bcrypt存在问题,我不确定为什么。这是我的基本注册路线代码:

const express = require('express');
const router = express.Router();
const bcrypt = require('bcryptjs');
const passport = require('passport');

// Register
router.post('/register', function(req, res){

  req.checkBody('username', 'Username is Required').notEmpty();
  req.checkBody('kingname', 'Kingdom Name is Required').notEmpty();
  req.checkBody('email', 'E-Mail is Required').notEmpty();
  req.checkBody('password', 'Password is Required').notEmpty();
  req.checkBody('password2', 'Passwords do not match').equals(req.body.password);

  var errors = req.validationErrors();

  if(errors) {
    res.render('index', {
      errors: errors
    });
  } else {
    var newUser = {
      username: req.body.username,
      kingname: req.body.kingname,
      email: req.body.email,
      password: req.body.password,
      password2: req.body.password2
    }

  bcrypt.getSalt(10, function(err, salt){
    bcrypt.hash(newUser.password, salt, function(err, hash){ …
Run Code Online (Sandbox Code Playgroud)

bcrypt node.js

0
推荐指数
1
解决办法
1154
查看次数

npm install 在 ubuntu 18.04 上失败并显示错误:“bcrypt@3.0.3 安装脚本失败”

在 Ubuntu 18.04 上设置 nodejs 项目时出现以下错误。安装的 npm 版本是 6.x,安装的 node 版本是 10.x。

我在这里这里搜索了修复程序,但没有得到任何适当的修复。

    bcrypt@3.0.3 install /home/ubuntu/reko_dev/web/backend/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.3/bcrypt_lib-v3.0.3-node-v64-linux-x64-glibc.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.3 and node@10.15.0 (node-v64 ABI, glibc) (falling back to source compile with node-gyp) 
gyp ERR! build error 
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack     at F …
Run Code Online (Sandbox Code Playgroud)

bcrypt node.js mean-stack npm-install ubuntu-18.04

0
推荐指数
1
解决办法
4913
查看次数

Express:在bcrypt.compare给出错误之前使用await

我正在尝试使用bcrypt将用户密码与存储的密码进行比较。但是Express给出错误是我在bcrypt.compare之前使用await

这是代码:

app.post ('/users/login', (req, res) => {
    const user = users.find(user=> user.name === req.body.user)
    if (user == null) {
        return res.status(400).send('Can Not find user');
    } else {
        try{
            if ( await bcrypt.compare(req.body.password, user.password)) {
                res.send("Success");
            } else {
                res.send("Incorrect PAssword");
            }
        } catch {
            return res.status(500).send('Some Error has occurred');
        }
    }
});
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

C:\Data\Ashish\projects\jwtAuthentication\app.js:32
            if ( await bcrypt.compare(req.body.password, user.password)) {
                       ^^^^^^

SyntaxError: Unexpected identifier
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3) …
Run Code Online (Sandbox Code Playgroud)

bcrypt node.js express

0
推荐指数
1
解决办法
36
查看次数