Re: password encryption

Paul Jakma (
Tue, 3 Aug 1999 03:22:17 +0100 (IST)

On Tue, 3 Aug 1999, ywlee wrote:


how do I implement a encryption algorithm for a password in C?
I'm writing this code in Linux. I have tried to use the crypt()
function from unistd.h but I cannot compile because of undefined
reference. Please help. :)

Hi yawlee,

The undefined reference is libcrypt :). You need to compile your
programme with -lcrypt, or else the compiler will never find the
crypt() function code in libcrypt.

Also, an important point: Your question is a general C programming
question. This list is intended for Linux *kernel* programming. You
really should send your questions to a general programming newsgroup
like comp.lan.c rather than here.


Paul Jakma
PGP5 key:
Those who have had no share in the good fortunes of the mighty
Often have a share in their misfortunes.
		-- Bertolt Brecht, "The Caucasian Chalk Circle"

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to Please read the FAQ at