# Relation between encryption algorithms and (password) hash functions

This is a really basic question.
Blowfish is not seen as a secure cipher.
but bcrypt is one of the most secure hash functions.
So first: How can a hash function be based on an encryption algorithm, after all these two things have little to do with each other?
Second: If blowfish is insecure and bcrypt is based on it, how can it be secure ?
And just a little question regarding bcrypt: In Linux-based operating systems the code for hashes is

 $1 – MD5$2 – blowfish
$2a – eksblowfish$5 – SHA-256
$6 – SHA-512  With "blowfish" they actually mean bcrypt, right? • What is this code for hashes? – Elias Mar 24 '17 at 18:07 • it is a sort of identifier like if the has begins with$1 you know that what comes after is md5 – Richard R. Matthews Mar 24 '17 at 18:21
• Right, this stuff en.wikipedia.org/wiki/Crypt_%28C%29 – Elias Mar 24 '17 at 18:34