How to make Ubuntu's crypt(3) support Blowfish?
Asked Answered
M

1

10

According to the crypt(3) manual, Blowfish (indicated by the $2a$ prefix) is one of the supported cypher methods:

ID  | Method
─────────────────────────────────────────────────────────
1   | MD5
2a  | Blowfish (not in mainline glibc; added in some
    | Linux distributions)
5   | SHA-256 (since glibc 2.7)
6   | SHA-512 (since glibc 2.7)

However the part saying Blowfish (not in mainline glibc; added in some Linux distributions) is confusing and underdocumented, so I have a few questions.

First of all, if "mainline" glibc does not support Blowfish, then which glibc does? Ubuntu 14.04 uses glibc 2.19, packaged in libc6 / libc6-dev packages. Assuming this is the "mainline" glibc, then Blowfish is not supported. Apparently there is a patch called crypt_blowfish adding Blowfish support to glibc. Why is it not enabled by default in Ubuntu? And last but not least, what is the easiest way to make the C crypt() function in Ubuntu understand Blowfish hashes?

Mailer answered 27/7, 2014 at 13:55 Comment(0)
C
4

First of all, if "mainline" glibc does not support Blowfish, then which glibc does?

Built by distributions listed at openwall page, e.g. ALT Linux and SUSE. If it's interesting for you, why it is not in mainline, you can read Ulrich Drepper's article.

Why is it not enabled by default in Ubuntu?

This matter was discussed here: LP#1349252.

And last but not least, what is the easiest way to make the C crypt() function in Ubuntu understand Blowfish hashes?

Probably, there is no way to make it without building your own glibc package.

Classicism answered 30/5, 2015 at 11:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.