View password with hash in database, decoded

Asked

Viewed 529 times

0

I’m saving the passwords in the hashed database, and now I want to view it in the view, because when I get the data in the database it still gets hashed when I’m going to display it.

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

Senha: 123 (this is the password I registered in 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');
}
  • That’s right, you should not store the password in 'Plain text' (as it is). https://answall.com/questions/162369/qual-a-diff%C3%A7a-between-code%C3%A7%C3%A3o-crypto-e-c%C3%A1lculo-hash/162376#162376, https://answall.com/questions/2402/comore-fazer-hash-de-passwords-security/2404#2404 . Basically, not even the system administrators themselves should have access to them. The hash is unidirectional, not reversible, just to compare with other generated hashs

  • 1

    the objective of hash is not to be decrypted :)

  • kkkk' serio man

  • vlw man I’ll take a look at what I can do here

  • Why do you want to see the password in the view? what?

  • kk' change the password, but I will do it differently kkk'

  • has algorithms q vc can decrypt later, but in the case of passwords the most recommending is the same hash. It does not recover, just compare to see if you are right and if you need to "recover", you generate a new :)

  • yes yes, vlw man, that’s what I intend to do

Show 3 more comments

1 answer

3


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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.