Help with C (somewhat irrelevant :)

Posted by Poromenos on Thu 06 Feb 2003 09:44 PM — 3 posts, 9,563 views.

Greece #0
OK, I'm sorry about this post, it is entirely off topic, please don't delete it right away, this was the only place I could think of, there are quite a few geniuses in here... I am trying to find a program that generates the crypt() hashes in windows, but i couldn't find it, despite all my search... All i found was the library sources, (get them from www.poromenos.org/crypt.zip), but I have absolutely no idea on how to link them... Can someone help? I just need a simple program that takes the password (from the command prompt maybe?) and gives you the crypt() hash, i.e.
printf("Crypt() hash = %s", crypt("pasword", 0));
or however that's done.
If you could point me in the right direction I would be greatful.
Australia Forum Administrator #1
The crypt source would be the file crypt.c that comes with various Unix distributions, for instance I found a copy with the OpenBSD installation.

This particular file is 713 lines. I would compile it and join it with a simple "main" function that gets text to be encrypted and outputs the result.

You should be able to find copies amongst most major Unix/Linux distributions.

I found mine on my disk at:

/usr/src/lib/libc/crypt/crypt.c
Amended on Mon 10 Feb 2003 10:11 PM by Nick Gammon
Greece #2
Ahh, thanks, although i'll try and link it now.. I don't have *nix, but that crypt source i found should do the trick.