06.08.2013, 23:45
Support for Windows added, precompiled binary (dll) is now available.
I have a few questions
|
bcrypt_check(playerid, BCRYPT_LOGIN, inputtext, hash);
bcrypt_check(inputtext, hash, "OnPasswordChecked", "d",playerid);
[03:18:06] plugin.bcrypt: The plugin is up-to-date. [03:18:05] Loading plugin: bcrypt-samp.so [03:18:05] plugin.bcrypt v2.2.2 was loaded. [03:18:05] plugin.bcrypt: 5 cores detected, 4 threads will be used. [03:18:05] Loaded. |
I am running the plugin on Debian 7.7, gcc version 4.7.2-5
The plugin loads and everything looks fine on the server log, but the callbacks are never called. I put a print function in, to indicate when the callback is being called but it never prints it nor updates the password. On my localhost - Win7 64bit it loads and works fine. |
Hello,
I am currently developing a panel samp and I use this plugin but I have trouble with the transition pawn - php ( password_verify (), password_hash ()). A little help please , thank you (sorry for my english , I'm french x)) |
[13:01:48] plugin.bcrypt v2.2.3 was loaded. [13:01:48] plugin.bcrypt: 5 cores detected, 4 threads will be used. [13:01:48] Loaded. [13:01:49] plugin.bcrypt: A new revision is available: [13:01:49] plugin.bcrypt: Current version: 2.2.2 [13:01:49] plugin.bcrypt: Latest version: 2.2.3 [13:01:49] plugin.bcrypt: Download: http://api.ls-rcr.com/bcrypt/?upgrade [13:01:49] plugin.bcrypt: Upgrading is recommended. |
Downloaded v2.2.3 and updated the files.
it continues to say that there is a new version although it say above that it loaded version 2.2.3 Yes with password_verify($input, $hashed_password_from_db); |
It's impossible because even if you enter exactly the same caracrtere chain, bcrypt hash of another ways ...
Show me a code example ^^ |
<?php
$password = 'Hello World!';
$hash = '$2y$12$D62QnfKU1bYMTode2W7UVeMb7maqY.Y7TCdWgQzj44HuOBK47Ej1Wl';
if(password_verify($password, $hash))
{
// Match
}
else
{
// No match
}
<?php
/**
* Attempt to login using the given username and password. (simple example)
* @param string $username The username given by the user
* @param string $password The password given give the user
* @return boolean True if the login was successful, otherwise false
*/
public function login($username, $password)
{
$success = false;
$get_password_q = "SELECT `id`, `password` FROM `users` WHERE `username` = ?";
if($stmt = $db->prepare($get_password_q))
{
$stmt->bind_param("s", $username);
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($id, $hash);
if($stmt->num_rows)
{
if(password_verify($password, $hash))
{
// Correct password
$success = true;
}
else
{
// Wrong password
}
}
else
{
// The user does not exist
}
$stmt->close();
}
return $success;
}