Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!comp.vuw.ac.nz!duncan From: duncan@comp.vuw.ac.nz (Duncan McEwan) Newsgroups: comp.unix.admin Subject: Re: Changing passwords in Scripts Keywords: Passowrds Message-ID: <1991Feb20.024816.10015@comp.vuw.ac.nz> Date: 20 Feb 91 02:48:16 GMT References: <39@cheops.UUCP> Sender: news@comp.vuw.ac.nz (News Admin) Organization: Dept. of Comp. Sci., Victoria Uni. of Wellington, New Zealand. Lines: 38 Nntp-Posting-Host: bats.comp.vuw.ac.nz In article <39@cheops.UUCP> logier@cheops.UUCP (Rob Logie) writes: >I live in a country where "crypt" is not avaliable (To my knowedge) I think you will find that crypt(3) is available in Australia. It certainly is in NZ and we are subject to the same export regulations. Whether it is a real DES based crypt or something else I don't know*, but it should certainly be the same routine that your system uses to encrypt users passwords (otherwise how would passwd(1) do it?). If you want to be sure, try compiling and running the following. Type your clear text password when prompted, (just make sure noone is looking over your shoulder at the time :-) and the first two characters of your password from /etc/passwd when asked for the salt -- the result it prints should be the same as your passwd entry. --- cut here --- char passwd[10], salt[5]; char *crypt(); main() { printf("passwd? "); scanf("%8s", passwd); printf("salt? "); scanf("%2s", salt); printf ("encrypted password is %s\n", crypt(passwd, salt)); } --- cut here as well --- * I believe the restriction prevents export of the DES algorithm from the US whereas the crypt(3) routine implements a "modified" DES and so is not covered, but am open to correction on this. -- Duncan