I tried to crypt a password using a blowfish hashing algorithm by:
c_word = crypt.crypt(password, insalt)
Actually, insalt including the next format: $hashing_algo$salt$.
For example: here the password is 123456 and the insalt is $2y$04$aaaabbbbccccddddeeee$
According https://www.dcode.fr/crypt-hasing-function that's the right insalt, in contrast to the common format $hashing_algo$salt$hashed$ by https://www.cyberciti.biz/faq/understanding-etcshadow-file/.
After that line I got that value of c_word is *0 for each password and insalt values. How can I solve this problem?
Thanks
I see that you want to hash your own function with your own hash with blowfish algorithm. First according to
cryptman page Blowfish number is2anot2y. The other problem is that pythoncryptimplementation seems to need a rounds field which according to documentation.The last thing is the salt length which seems to must be equal to 22 chars same as MD5 which according to ``crypt``` man page seems to range up to 16 chars except for MD5, SHA256, SHA512 which need to be fixed in size of 22, 43, 86 respectivly.
so here is the code after fixing these issues.
This confusion is maybe because of blowfish is not part of
glibccrypt function but added by Linux distributions themselves.