Skip to content

Password hashing #6

Description

@Dgc2002

As it stands passwords are "hashed"(actually encrypted), and very poorly at that. bin2hex is used which takes a string, converts it to hex, then returns an ASCII string of that hex. Seen here

Ignoring all issues surrounding this one I would suggest using password_hash and password_verify. Quick overview of password_hash:

  • Takes a plain text password and hashes it using a strong one-way algorithm.
  • As of PHP 5.5 bcrypt is the default algorithm. But both password_hash and password_verify are intended to be future-proof in that the default algo will change and be compensated for.
  • Automatically salts the password/hash using /dev/urandom

here is a quick example.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions