From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43856 invoked by alias); 29 Jan 2016 12:09:24 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 43843 invoked by uid 89); 29 Jan 2016 12:09:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-91.9 required=5.0 tests=BAYES_50,KAM_LAZY_DOMAIN_SECURITY,KHOP_DYNAMIC,LIKELY_SPAM_BODY,RCVD_IN_PBL,RDNS_DYNAMIC,USER_IN_WHITELIST autolearn=no version=3.3.2 spammy=2710, $6wos, UD:UudC.lLOSB1G3D1bIboWxlixzBy2xO, zkp2jdm X-HELO: calimero.vinschen.de Received: from ipbcc0d020.dynamic.kabel-deutschland.de (HELO calimero.vinschen.de) (188.192.208.32) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 29 Jan 2016 12:09:22 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id B4423A8042C; Fri, 29 Jan 2016 13:09:19 +0100 (CET) Date: Fri, 29 Jan 2016 14:44:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Weird behavior of crypt Message-ID: <20160129120919.GB14874@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <56AB4F64.3070807@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Pd0ReVV5GZGQvF3a" Content-Disposition: inline In-Reply-To: <56AB4F64.3070807@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SW-Source: 2016-01/txt/msg00467.txt.bz2 --Pd0ReVV5GZGQvF3a Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1785 On Jan 29 12:39, Marco Atzeri wrote: >=20 >=20 > On 29/01/2016 12:18, Alexandre Garnier wrote: > >Hello. > >I'm trying to do SHA-512 password encryption, but the result is really > >weird on Cygwin: > > > ># On Cygwin(either 32 or 64) 2.4.1-1, latest updates with crypt 1.1-1, > >libcrypt0 1.1-1, libcrypt-devel 1.1-1 > >$ crypt '$6$7dl4B0fKUimdnR$' test_value > >$6wOs/zKP2jDM > > > >$ python -c 'import crypt; print crypt.crypt("test_value", > >"$6$7dl4B0fKUimdnR$")' # Python 2.7.10 > >$6wOs/zKP2jDM > > > >$ perl -e 'print crypt("test_value", "\$6\$7dl4B0fKUimdnR\$")."\n"' # > >Perl v5.22.1 > >$6wOs/zKP2jDM > > > >Am I missing something? > > > >On other system, I get a more expected result: > > > ># On Ubuntu 15.04 > >$ mkpasswd --method=3DSHA-512 test_value 7dl4B0fKUimdnR > >$6$7dl4B0fKUimdnR$f6gCu.3IfrxhsnJKFnusDH.UudC.lLOSB1G3D1bIboWxlixzBy2xO/= 3rCKHmzfwekCTvmQd11bPdcsJOaLkCJ. > > You're aware that the password field in /etc/passwd is not used, right? Passwords are checked against the Windows user DB. In fact, /etc/passwd is not necessary anymore. > Not SHA-512, see > /usr/share/doc/crypt/crypt.README >=20 > This is the DES-crypt package Version 1.1 >=20 > It provides a static library libcrypt.a as well as a shared library > cygcrypt-0.dll together with a link lib libcrypt.dll.a, which export > the functions >=20 > crypt(3) > encrypt(3) > setkey(3) >=20 > The passwords created by crypt(3) are 56 bit DES encrypted and are > 100% identical to those created by the Linux crypt(). Right. If you need the hashes for other purposes than /etc/passwd, you can use `openssl sha512' Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --Pd0ReVV5GZGQvF3a Content-Type: application/pgp-signature; name="signature.asc" Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWq1ZvAAoJEPU2Bp2uRE+gxgQP/1sTIVLj+uIy2ZIGm2lYq/aq 7/usogPuLwW9mK2gbgm6ssx9BWNki9XNHufavmXybImY4hHvSM1VyA/23wSLef6a TLPUDIsJTO+sOVwPtBKYxYNNJOvSpSR2ur5VgRR/wMLUp0wUW6dnbx7xlIDVznRX +xQPUbtrv+UQYonD0tu2hIzsf2NWR1bQj6on1oTb75mpZqImuUrp9gnBGSu0CSop ZSqMRfv0cKILLJQOZ37HgQOEoWEbBog7LHPMxjQSDBUM8jdS1DN+ZBr0JOld9AlS 7nUx9nJNOelPdovojxqvKEZp7WFQ9L7A7RsaFNiFS+9aed1CkLQVZboiwKqyV1Uy RZrUSbbK8zp6kAzc837IE3L1NIJcgI6yXB2/fY4T7gKAdfoMGj7+GsolCgbZvomb 63+tBcOCUpUgrUjf54W1xd2RYjRTxIlHeAcEnatVg+DgxCTifucNpi/TBKG3w1oh Zy3Qgl4geWU5BtEIzhShDRKhOLrYbiKn4WslAOwlDR6wK8lC08VmFwz8PvVh8a2N A6UwjiV27fLz5rmFWqMW/K/Bja89bBuHkCInh82jRk9rEqNhW4MVthSjm0ZgeCOy v6Kn/ik0xQ0NmfF7WNpC5xwuws4nS+QPNre5hPg+lryPcsqb4hdgyf4XSymLKAmn obPhljL2UntQTMWi1yNZ =SvzL -----END PGP SIGNATURE----- --Pd0ReVV5GZGQvF3a--