Nov 09

linux and its crypt() function

Tag: c, kernel, linuxdenis @ 4:24 pm

want to use that handy crypt function in your software? after wasting some time, i discovered that one must prefix the salts with “$1$”. So it goes like this:
strcpy(new_salt, "$1$");
strcat(new_salt, salt);
hashed_password = crypt(passwd, new_salt);

hope this can help someone.

Bookmark this page on: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • Reddit
  • StumbleUpon
  • Technorati

Leave a Reply