2
$\begingroup$

$2y$05$68LWs2pXiEvhVTacJ9PX/elfa1zq9jCBlv61hEw1pCvAHlaJyeMwW

This hash value is 70 characters long. How can I tell what type of encoding was used to generate it? Also, how many bits does each character hold?

$\endgroup$
1
  • 1
    $\begingroup$ It looks crypt-formatted. This documentation page will probably help you. $\endgroup$
    – dusk
    Sep 24, 2017 at 17:01

1 Answer 1

4
$\begingroup$

That looks like bcrypt.

There are four parts:

  • $2y - identifier that this is bcrypt in modular crypt format.
  • $05 - number of key expansion rounds: in this case, it is 25

  • 68LWs...X/e - this is the salt. A total of 128 bits encoded in base64.

  • lfa1z...MwW - this is the hash. A total of 184 bits encoded in base64.

Since base64 encodes three bytes to four base64 characters, you get 6 bits for each base64 character.

$\endgroup$
2
  • 1
    $\begingroup$ +1, but three bytes encode to four characters (3*8/6) not six. $\endgroup$
    – Rup
    Sep 25, 2017 at 2:30
  • $\begingroup$ @Rup Oh right! I was probably thinking six bits! $\endgroup$
    – Zizouz212
    Sep 25, 2017 at 19:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.