Display hashed password in the database, decoded

0

I'm saving the passwords in the hashed bank, and now I want to view it in the view, because when I get the data in the bank it still has a hash when I'm going to display it.

Senha: $2y$10$G9poHdud5XJxgiQq1p0syOMEgE.wNxBwZWoA8ux.KxsnXPf4tDKni (in the bank)

Senha: 123 (this is the password that I registered with the bank)

How the password is saved in the bank:

 public function CadastroSalvar (Request $request) {

 $data =  $request->all();

 $data['password'] = bcrypt($data['senha']); //primeiro campo é do banco e o outro é o campo da Request

 $data = \App\Usuario::create($data);

    return redirect()->route('UsuarioCadastro');
}
    
asked by anonymous 31.01.2018 / 12:37

1 answer

3

Man, it is not possible to undo a hash, once it has been generated. This is how Digest algorithms work, it encodes the message without using a decryption key, so you will not be able to see the password that was typed in plain text, just compare Hashes based on trial and error.

    
31.01.2018 / 12:52