[net.crypt] Orphaned Response

stroyan@hp-dcd.UUCP (12/08/83)

#R:aat:-19500:hp-dcd:38800001:37777777600:129
hp-dcd!stroyan    Dec  6 10:21:00 1983

I believe that xsend and xget use the knapsack encryption algorithm,
which has been broken.

				Mike Stroyan
				hpfcla!stroyan

barrett@hpcnoe.UUCP (barrett) (12/14/84)

Oh.  

Deafening silence on random numbers. 

Sigh.


Dave Barrett
hplabs!hp-dcd!barrett

emks@uokvax.UUCP (emks) (01/07/85)

/***** uokvax:net.crypt / mit-eddi!menageri /  9:54 pm  Dec 16, 1984 */
Can anyone out there tell me how passwords are encoded on Unix? ...
		... Please note that I am *NOT* trying to break the
encryption, I just want to know specifically how it is done, so please
don't flame at me about the possibility/impossibility of breaking it. 

Thanks in advance.
					greg
/* ---------- */
Greg,

The actual source code that does the encryption is considered "proprietary"
under the provisions of the UNIX* license agreement, but the /bin/passwd and
/{bin,etc}/login programs use the crypt(3) call which you can locate in
/lib/libc.a.  Crypt(3) is simply a software implementation of the DEA (or
DES, depending on who is certifying the algorithm, if anyone).

Most sites use "/bin/passwd" to generate the crypted password for installation
in the /etc/passwd file.  [I know this isn't what you were looking for, but I
found this information useful when I first learnt about it several years ago.]
In /bin/passwd, the "salt" is generated using the time and other factors in
a fashion like (NOTE: may be site-dependent, and the means don't affects the
security of the password at all, since the salt is usually available.]

	time(&salt);
	salt += getpid();		/* I've seen other variants used -ks */
	saltc[0] = salt & 077;
	saltc[1] = (salt >> 6) & 077;
	while(i < 2) {
		c = saltc[i] + '.';
		if(c > '9')
			c += 'A' - '9' - 1;
		if(c > 'Z')
			c += 'a' - 'Z' - 1;
		if(!(c & 037))
			c += '@';
		saltc[i++] = c;
	}

But, again, the actual password is generated using the crypt(3) call using
the output of the routine above for the salt.  And I think you'll have a
difficult time, should you be inclined, reversing the process by anything
short of brute force.  But it is not impossible.  Read the most recent BLTJ
supplement volume on UNIX for more security information.

Crypted passwords are a definite "plus," but when people are told "NO,"
they'll *always* find a way.  It reminds me of saying "NO!" to my little
nephew...

Have a safe holiday.

		kurt


P.S.  Does anyone know if the output of crypt(3) is unique?  I.e. could there
be more than one key/salt combination which outputs the same result?

jbn@wdl1.UUCP (01/18/85)

    What was the question?  It shows here as "orphaned response?"

jjm@faust.UUCP (05/07/85)

 O(2**32) means the order of magnitude of an algorithm is 

 2 to the 23rd power.  This is a mighty slow algorithm.

		   joe MacDougald