Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a hook to change the password generation algorithm #199

Open
Aldus83 opened this issue Nov 13, 2018 · 0 comments
Open

Create a hook to change the password generation algorithm #199

Aldus83 opened this issue Nov 13, 2018 · 0 comments

Comments

@Aldus83
Copy link
Collaborator

Aldus83 commented Nov 13, 2018

Currently we are using a standard MD5 / salt algorithm to store passwords.
It would be good to let the user choose a personal algorithm in his modules, to open the way to different, customizable encryption methods.

public static function passwordEncrypt($pass) {

  1. Pass $env variable to the passwordEncrypt() method, wherever it's called (so it will look like -passwordEncrypt($env, $pass)

  2. Create a hook function that will allow other modules to change the default algorithm
    so it will look something like this

$vars = array('string' => $string)
$env->hook('passwordEncrypt', &$vars) 
if (!isset($vars['encrypted_string'])) {
   $encrypted_string = substr((md5(substr($pass, 0, 5) . 'ABC' . substr($pass, 5, 2) . 'nginE')) . md5($pass), 0, 50);
}
else {
  $encrypted_string = $vars['encrypted_string'];
}
return $encrypted_string;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Quanta
  
Awaiting triage
Development

No branches or pull requests

2 participants