Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

The first version always gets thrown away.


devel / comp.unix.programmer / A check for whether crypt() supports Blowfish?

SubjectAuthor
* A check for whether crypt() supports Blowfish?Muttley
+* A check for whether crypt() supports Blowfish?Scott Lurndal
|+* A check for whether crypt() supports Blowfish?Muttley
||`* A check for whether crypt() supports Blowfish?Scott Lurndal
|| `* A check for whether crypt() supports Blowfish?Muttley
||  +* A check for whether crypt() supports Blowfish?Scott Lurndal
||  |+* A check for whether crypt() supports Blowfish?Kaz Kylheku
||  ||`* A check for whether crypt() supports Blowfish?Scott Lurndal
||  || +- A check for whether crypt() supports Blowfish?Kaz Kylheku
||  || +- A check for whether crypt() supports Blowfish?Muttley
||  || `- A check for whether crypt() supports Blowfish?Richard Kettlewell
||  |`- A check for whether crypt() supports Blowfish?Muttley
||  `* A check for whether crypt() supports Blowfish?Lew Pitcher
||   `* A check for whether crypt() supports Blowfish?Muttley
||    +* A check for whether crypt() supports Blowfish?Lew Pitcher
||    |`- A check for whether crypt() supports Blowfish?Muttley
||    `* A check for whether crypt() supports Blowfish?Paul
||     +- A check for whether crypt() supports Blowfish?Muttley
||     `- A check for whether crypt() supports Blowfish?Kaz Kylheku
|`* A check for whether crypt() supports Blowfish?Nicolas George
| `* A check for whether crypt() supports Blowfish?Scott Lurndal
|  +* A check for whether crypt() supports Blowfish?Scott Lurndal
|  |`- A check for whether crypt() supports Blowfish?Nicolas George
|  `* A check for whether crypt() supports Blowfish?Kaz Kylheku
|   `* A check for whether crypt() supports Blowfish?Muttley
|    `* A check for whether crypt() supports Blowfish?Nicolas George
|     +- A check for whether crypt() supports Blowfish?Muttley
|     `- A check for whether crypt() supports Blowfish?Keith Thompson
+* A check for whether crypt() supports Blowfish?Kaz Kylheku
|`* A check for whether crypt() supports Blowfish?Muttley
| `* A check for whether crypt() supports Blowfish?Kaz Kylheku
|  `* A check for whether crypt() supports Blowfish?Muttley
|   `* A check for whether crypt() supports Blowfish?Kaz Kylheku
|    `- A check for whether crypt() supports Blowfish?Kaz Kylheku
+* A check for whether crypt() supports Blowfish?Richard Kettlewell
|`* A check for whether crypt() supports Blowfish?Kaz Kylheku
| `- A check for whether crypt() supports Blowfish?Richard Kettlewell
+- A check for whether crypt() supports Blowfish?Keith Thompson
+- A check for whether crypt() supports Blowfish?Rainer Weikusat
`* A check for whether crypt() supports Blowfish?Lew Pitcher
 +* A check for whether crypt() supports Blowfish?Muttley
 |`* A check for whether crypt() supports Blowfish?Lew Pitcher
 | `* A check for whether crypt() supports Blowfish?Muttley
 |  `* A check for whether crypt() supports Blowfish?Muttley
 |   `* A check for whether crypt() supports Blowfish?Kaz Kylheku
 |    +* A check for whether crypt() supports Blowfish?Muttley
 |    |`* A check for whether crypt() supports Blowfish?Nicolas George
 |    | `- A check for whether crypt() supports Blowfish?Muttley
 |    `* A check for whether crypt() supports Blowfish?Ben Bacarisse
 |     `- A check for whether crypt() supports Blowfish?Keith Thompson
 `* A check for whether crypt() supports Blowfish?Kaz Kylheku
  `- A check for whether crypt() supports Blowfish?Lew Pitcher

Pages:123
A check for whether crypt() supports Blowfish?

<tjgpe0$ghl$1@gioia.aioe.org>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2922&group=comp.unix.programmer#2922

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!QImplQW63EVMF2Hp+OxW0A.user.46.165.242.91.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: A check for whether crypt() supports Blowfish?
Date: Fri, 28 Oct 2022 14:36:48 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tjgpe0$ghl$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="16949"; posting-host="QImplQW63EVMF2Hp+OxW0A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Muttley@dastardlyhq.com - Fri, 28 Oct 2022 14:36 UTC

Yes, I've googled this, no I didn't find an answer.

Some versions of glibc have been extended to support blowfish (algo 2a) in the
crypt via the $2a$ preamble in the salt. Does anyone know of a way to check if
its supported on a given system as crypt() has the very unhelpful behaviour of
SIGSEGV'ing if you give it an invalid encryption algo number.

Re: A check for whether crypt() supports Blowfish?

<9hS6L.680938$Ny99.558805@fx16.iad>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2923&group=comp.unix.programmer#2923

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx16.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: A check for whether crypt() supports Blowfish?
Newsgroups: comp.unix.programmer
References: <tjgpe0$ghl$1@gioia.aioe.org>
Lines: 10
Message-ID: <9hS6L.680938$Ny99.558805@fx16.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Fri, 28 Oct 2022 15:09:57 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Fri, 28 Oct 2022 15:09:57 GMT
X-Received-Bytes: 1035
 by: Scott Lurndal - Fri, 28 Oct 2022 15:09 UTC

Muttley@dastardlyhq.com writes:
>Yes, I've googled this, no I didn't find an answer.
>
>Some versions of glibc have been extended to support blowfish (algo 2a) in the
>crypt via the $2a$ preamble in the salt. Does anyone know of a way to check if
>its supported on a given system as crypt() has the very unhelpful behaviour of
>SIGSEGV'ing if you give it an invalid encryption algo number.
>

Have you considered using openssl instead?

Re: A check for whether crypt() supports Blowfish?

<tjgshu$3m9$1@gioia.aioe.org>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2924&group=comp.unix.programmer#2924

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!QImplQW63EVMF2Hp+OxW0A.user.46.165.242.91.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: A check for whether crypt() supports Blowfish?
Date: Fri, 28 Oct 2022 15:30:07 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tjgshu$3m9$1@gioia.aioe.org>
References: <tjgpe0$ghl$1@gioia.aioe.org> <9hS6L.680938$Ny99.558805@fx16.iad>
Injection-Info: gioia.aioe.org; logging-data="3785"; posting-host="QImplQW63EVMF2Hp+OxW0A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Muttley@dastardlyhq.com - Fri, 28 Oct 2022 15:30 UTC

On Fri, 28 Oct 2022 15:09:57 GMT
scott@slp53.sl.home (Scott Lurndal) wrote:
>Muttley@dastardlyhq.com writes:
>>Yes, I've googled this, no I didn't find an answer.
>>
>>Some versions of glibc have been extended to support blowfish (algo 2a) in
>the
>>crypt via the $2a$ preamble in the salt. Does anyone know of a way to check
>if
>>its supported on a given system as crypt() has the very unhelpful behaviour
>of
>>SIGSEGV'ing if you give it an invalid encryption algo number.
>>
>
>Have you considered using openssl instead?

This has nothing to do with sockets.

Re: A check for whether crypt() supports Blowfish?

<2OS6L.348025$elEa.296621@fx09.iad>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2925&group=comp.unix.programmer#2925

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx09.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: A check for whether crypt() supports Blowfish?
Newsgroups: comp.unix.programmer
References: <tjgpe0$ghl$1@gioia.aioe.org> <9hS6L.680938$Ny99.558805@fx16.iad> <tjgshu$3m9$1@gioia.aioe.org>
Lines: 24
Message-ID: <2OS6L.348025$elEa.296621@fx09.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Fri, 28 Oct 2022 15:45:02 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Fri, 28 Oct 2022 15:45:02 GMT
X-Received-Bytes: 1578
 by: Scott Lurndal - Fri, 28 Oct 2022 15:45 UTC

Muttley@dastardlyhq.com writes:
>On Fri, 28 Oct 2022 15:09:57 GMT
>scott@slp53.sl.home (Scott Lurndal) wrote:
>>Muttley@dastardlyhq.com writes:
>>>Yes, I've googled this, no I didn't find an answer.
>>>
>>>Some versions of glibc have been extended to support blowfish (algo 2a) in
>>the
>>>crypt via the $2a$ preamble in the salt. Does anyone know of a way to check
>>if
>>>its supported on a given system as crypt() has the very unhelpful behaviour
>>of
>>>SIGSEGV'ing if you give it an invalid encryption algo number.
>>>
>>
>>Have you considered using openssl instead?
>
>This has nothing to do with sockets.
>

Openssl is a generalized cryptographic library that supports pretty much
every standard symmetric and asymmetric crypto algorithm. It does far
more than support transport level security. It's the primary toolkit
(aside from RSA BSAFE) used in cryptographic software of all forms.

Re: A check for whether crypt() supports Blowfish?

<tjgtr7$ob5$1@gioia.aioe.org>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2926&group=comp.unix.programmer#2926

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!QImplQW63EVMF2Hp+OxW0A.user.46.165.242.91.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: A check for whether crypt() supports Blowfish?
Date: Fri, 28 Oct 2022 15:52:07 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tjgtr7$ob5$1@gioia.aioe.org>
References: <tjgpe0$ghl$1@gioia.aioe.org> <9hS6L.680938$Ny99.558805@fx16.iad> <tjgshu$3m9$1@gioia.aioe.org> <2OS6L.348025$elEa.296621@fx09.iad>
Injection-Info: gioia.aioe.org; logging-data="24933"; posting-host="QImplQW63EVMF2Hp+OxW0A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Muttley@dastardlyhq.com - Fri, 28 Oct 2022 15:52 UTC

On Fri, 28 Oct 2022 15:45:02 GMT
scott@slp53.sl.home (Scott Lurndal) wrote:
>Muttley@dastardlyhq.com writes:
>>On Fri, 28 Oct 2022 15:09:57 GMT
>>scott@slp53.sl.home (Scott Lurndal) wrote:
>>>Muttley@dastardlyhq.com writes:
>>>>Yes, I've googled this, no I didn't find an answer.
>>>>
>>>>Some versions of glibc have been extended to support blowfish (algo 2a) in
>>>the
>>>>crypt via the $2a$ preamble in the salt. Does anyone know of a way to check
>>>if
>>>>its supported on a given system as crypt() has the very unhelpful behaviour
>>>of
>>>>SIGSEGV'ing if you give it an invalid encryption algo number.
>>>>
>>>
>>>Have you considered using openssl instead?
>>
>>This has nothing to do with sockets.
>>
>
>Openssl is a generalized cryptographic library that supports pretty much
>every standard symmetric and asymmetric crypto algorithm. It does far
>more than support transport level security. It's the primary toolkit
>(aside from RSA BSAFE) used in cryptographic software of all forms.

Looks like an absolute PITA to use for that with contect creation and init
calls (why?) whereas crypt() is a single standalone function call that returns
the encrypted data. I'll pass.

Re: A check for whether crypt() supports Blowfish?

<635bfb31$0$24802$426a74cc@news.free.fr>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2927&group=comp.unix.programmer#2927

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!cleanfeed3-b.proxad.net!nnrp5-1.free.fr!not-for-mail
Newsgroups: comp.unix.programmer
From: nicolas$george@salle-s.org (Nicolas George)
Subject: Re: A check for whether crypt() supports Blowfish?
Sender: george@phare.invalid (Nicolas George)
X-Newsreader: Flrn (0.9.20070704)
References: <tjgpe0$ghl$1@gioia.aioe.org> <9hS6L.680938$Ny99.558805@fx16.iad>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1
Date: 28 Oct 2022 15:54:25 GMT
Lines: 5
Message-ID: <635bfb31$0$24802$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 28 Oct 2022 17:54:25 CEST
NNTP-Posting-Host: 129.199.129.80
X-Trace: 1666972465 news-2.free.fr 24802 129.199.129.80:42960
X-Complaints-To: abuse@proxad.net
 by: Nicolas George - Fri, 28 Oct 2022 15:54 UTC

Scott Lurndal, dans le message <9hS6L.680938$Ny99.558805@fx16.iad>, a
écrit :
> Have you considered using openssl instead?

Are you sure you understand what crypt() does?

Re: A check for whether crypt() supports Blowfish?

<v1T6L.348051$elEa.179442@fx09.iad>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2928&group=comp.unix.programmer#2928

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx09.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: A check for whether crypt() supports Blowfish?
Newsgroups: comp.unix.programmer
References: <tjgpe0$ghl$1@gioia.aioe.org> <9hS6L.680938$Ny99.558805@fx16.iad> <tjgshu$3m9$1@gioia.aioe.org> <2OS6L.348025$elEa.296621@fx09.iad> <tjgtr7$ob5$1@gioia.aioe.org>
Lines: 38
Message-ID: <v1T6L.348051$elEa.179442@fx09.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Fri, 28 Oct 2022 16:01:31 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Fri, 28 Oct 2022 16:01:31 GMT
X-Received-Bytes: 2240
 by: Scott Lurndal - Fri, 28 Oct 2022 16:01 UTC

Muttley@dastardlyhq.com writes:
>On Fri, 28 Oct 2022 15:45:02 GMT
>scott@slp53.sl.home (Scott Lurndal) wrote:
>>Muttley@dastardlyhq.com writes:
>>>On Fri, 28 Oct 2022 15:09:57 GMT
>>>scott@slp53.sl.home (Scott Lurndal) wrote:
>>>>Muttley@dastardlyhq.com writes:
>>>>>Yes, I've googled this, no I didn't find an answer.
>>>>>
>>>>>Some versions of glibc have been extended to support blowfish (algo 2a) in
>>>>the
>>>>>crypt via the $2a$ preamble in the salt. Does anyone know of a way to check
>>>>if
>>>>>its supported on a given system as crypt() has the very unhelpful behaviour
>>>>of
>>>>>SIGSEGV'ing if you give it an invalid encryption algo number.
>>>>>
>>>>
>>>>Have you considered using openssl instead?
>>>
>>>This has nothing to do with sockets.
>>>
>>
>>Openssl is a generalized cryptographic library that supports pretty much
>>every standard symmetric and asymmetric crypto algorithm. It does far
>>more than support transport level security. It's the primary toolkit
>>(aside from RSA BSAFE) used in cryptographic software of all forms.
>
>Looks like an absolute PITA to use for that with contect creation and init
>calls (why?) whereas crypt() is a single standalone function call that returns
>the encrypted data. I'll pass.
>

openssl will opportunistically use cryptographic hardware on the
host, when available. A big deal for production software. For toy
software, crypt() may be easy to use, but not necessarily efficient.

Yes, it has a complex API.

Re: A check for whether crypt() supports Blowfish?

<G2T6L.348052$elEa.126598@fx09.iad>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2929&group=comp.unix.programmer#2929

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx09.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: A check for whether crypt() supports Blowfish?
Newsgroups: comp.unix.programmer
References: <tjgpe0$ghl$1@gioia.aioe.org> <9hS6L.680938$Ny99.558805@fx16.iad> <635bfb31$0$24802$426a74cc@news.free.fr>
Lines: 12
Message-ID: <G2T6L.348052$elEa.126598@fx09.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Fri, 28 Oct 2022 16:02:46 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Fri, 28 Oct 2022 16:02:46 GMT
X-Received-Bytes: 1108
 by: Scott Lurndal - Fri, 28 Oct 2022 16:02 UTC

Nicolas George <nicolas$george@salle-s.org> writes:
>Scott Lurndal, dans le message <9hS6L.680938$Ny99.558805@fx16.iad>, a
> �crit�:
>> Have you considered using openssl instead?
>
>Are you sure you understand what crypt() does?

Are you sure you understand what opensll does?

Hint, it supports all forms of symmetric and asymmetric
cryptographic algorithms for stand-alone software as
well as supporting transport layer security.

Re: A check for whether crypt() supports Blowfish?

<M4T6L.348053$elEa.147813@fx09.iad>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2930&group=comp.unix.programmer#2930

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx09.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: A check for whether crypt() supports Blowfish?
Newsgroups: comp.unix.programmer
References: <tjgpe0$ghl$1@gioia.aioe.org> <9hS6L.680938$Ny99.558805@fx16.iad> <635bfb31$0$24802$426a74cc@news.free.fr> <G2T6L.348052$elEa.126598@fx09.iad>
Lines: 16
Message-ID: <M4T6L.348053$elEa.147813@fx09.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Fri, 28 Oct 2022 16:05:00 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Fri, 28 Oct 2022 16:05:00 GMT
X-Received-Bytes: 1329
 by: Scott Lurndal - Fri, 28 Oct 2022 16:05 UTC

scott@slp53.sl.home (Scott Lurndal) writes:
>Nicolas George <nicolas$george@salle-s.org> writes:
>>Scott Lurndal, dans le message <9hS6L.680938$Ny99.558805@fx16.iad>, a
>> �crit�:
>>> Have you considered using openssl instead?
>>
>>Are you sure you understand what crypt() does?
>
>Are you sure you understand what opensll does?
>
>Hint, it supports all forms of symmetric and asymmetric
>cryptographic algorithms for stand-alone software as
>well as supporting transport layer security.

FWIW, I spent four years at Verisign doing crypto
software and my CPOE designs and sells high-end cryptographic processors.

Re: A check for whether crypt() supports Blowfish?

<tjgvac$34cnr$1@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2931&group=comp.unix.programmer#2931

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!paganini.bofh.team!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: lew.pitcher@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.programmer
Subject: Re: A check for whether crypt() supports Blowfish?
Date: Fri, 28 Oct 2022 16:17:17 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <tjgvac$34cnr$1@dont-email.me>
References: <tjgpe0$ghl$1@gioia.aioe.org>
<9hS6L.680938$Ny99.558805@fx16.iad> <tjgshu$3m9$1@gioia.aioe.org>
<2OS6L.348025$elEa.296621@fx09.iad> <tjgtr7$ob5$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 28 Oct 2022 16:17:17 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="d2a347d471f3cfcab6a5c3950bbfa394";
logging-data="3289851"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/avGJYQOIQYMFFkhoTFK4jWPidfHkChHg="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:LXFIDZg/r4PEROaPLqfBEG4mkDo=
 by: Lew Pitcher - Fri, 28 Oct 2022 16:17 UTC

On Fri, 28 Oct 2022 15:52:07 +0000, Muttley wrote:

> On Fri, 28 Oct 2022 15:45:02 GMT
> scott@slp53.sl.home (Scott Lurndal) wrote:
>>Muttley@dastardlyhq.com writes:
>>>On Fri, 28 Oct 2022 15:09:57 GMT
>>>scott@slp53.sl.home (Scott Lurndal) wrote:
>>>>Muttley@dastardlyhq.com writes:
>>>>>Yes, I've googled this, no I didn't find an answer.
>>>>>
>>>>>Some versions of glibc have been extended to support blowfish (algo 2a) in
>>>>the
>>>>>crypt via the $2a$ preamble in the salt. Does anyone know of a way to check
>>>>if
>>>>>its supported on a given system as crypt() has the very unhelpful behaviour
>>>>of
>>>>>SIGSEGV'ing if you give it an invalid encryption algo number.
>>>>>
>>>>
>>>>Have you considered using openssl instead?
>>>
>>>This has nothing to do with sockets.
>>>
>>
>>Openssl is a generalized cryptographic library that supports pretty much
>>every standard symmetric and asymmetric crypto algorithm. It does far
>>more than support transport level security. It's the primary toolkit
>>(aside from RSA BSAFE) used in cryptographic software of all forms.
>
> Looks like an absolute PITA to use for that with contect creation and init
> calls (why?) whereas crypt() is a single standalone function call that returns
> the encrypted data. I'll pass.

Actually, crypt(3) doesn't return encrypted data; that would imply that there
is a way to decrypt the results of crypt(3), which there is not.

crypt(3) returns a suitably-composed encryption "signature" of the original
data. Specifically, it uses the original data, along with a "salt" value, as
an encryption key. It applies this key to encrypt a constant value (usually
a field of binary zeros) using the chosen encryption algorithm. What you get
back is nothing more than an anonymous data blob, encrypted using your
original data as a part of the encryption key. To decrypt the resulting data
would be useless; you'd get back that blob of zeros. To recover the data
given to crypt(3), you must /recover or recreate the encryption key/,
which is a much harder task.

While Openssl can generate message digests, that process would be much
more involved than a simple call to crypt(3).

--
Lew Pitcher
"In Skills, We Trust"

Re: A check for whether crypt() supports Blowfish?

<635c15ff$0$25466$426a74cc@news.free.fr>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2932&group=comp.unix.programmer#2932

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.gegeweb.eu!gegeweb.org!fdn.fr!proxad.net!feeder1-2.proxad.net!cleanfeed1-a.proxad.net!nnrp1-1.free.fr!not-for-mail
Newsgroups: comp.unix.programmer
From: nicolas$george@salle-s.org (Nicolas George)
Subject: Re: A check for whether crypt() supports Blowfish?
Sender: george@phare.invalid (Nicolas George)
X-Newsreader: Flrn (0.9.20070704)
References: <tjgpe0$ghl$1@gioia.aioe.org> <9hS6L.680938$Ny99.558805@fx16.iad> <635bfb31$0$24802$426a74cc@news.free.fr> <G2T6L.348052$elEa.126598@fx09.iad> <M4T6L.348053$elEa.147813@fx09.iad>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1
Date: 28 Oct 2022 17:48:47 GMT
Lines: 7
Message-ID: <635c15ff$0$25466$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 28 Oct 2022 19:48:47 CEST
NNTP-Posting-Host: 129.199.129.80
X-Trace: 1666979327 news-3.free.fr 25466 129.199.129.80:40188
X-Complaints-To: abuse@proxad.net
 by: Nicolas George - Fri, 28 Oct 2022 17:48 UTC

Scott Lurndal, dans le message <M4T6L.348053$elEa.147813@fx09.iad>, a
écrit :
>>Hint, it supports all forms of symmetric and asymmetric
>>cryptographic algorithms for stand-alone software as
>>well as supporting transport layer security.

So now I am sure you do not understand what crypt does().

Re: A check for whether crypt() supports Blowfish?

<20221028105026.680@kylheku.com>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2933&group=comp.unix.programmer#2933

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: 864-117-4973@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.programmer
Subject: Re: A check for whether crypt() supports Blowfish?
Date: Fri, 28 Oct 2022 18:15:21 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <20221028105026.680@kylheku.com>
References: <tjgpe0$ghl$1@gioia.aioe.org>
Injection-Date: Fri, 28 Oct 2022 18:15:21 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="edb3d930670cc4a75d7ce17342ddfa90";
logging-data="3323122"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+sx2Ec/LGw9hZMGKw5N49C6haitqhgdeg="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:HnVLWXp9fFqyZPsxabRjpnvHHH4=
 by: Kaz Kylheku - Fri, 28 Oct 2022 18:15 UTC

On 2022-10-28, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote:
> Yes, I've googled this, no I didn't find an answer.
>
> Some versions of glibc have been extended to support blowfish (algo 2a) in the
> crypt via the $2a$ preamble in the salt. Does anyone know of a way to check if
> its supported on a given system as crypt() has the very unhelpful behaviour of
> SIGSEGV'ing if you give it an invalid encryption algo number.

I have experience in this area, having integrated crypt into the TXR
Lisp language, and worked around the embarrassing segfault issue.

This is the TXR Lisp interactive listener of TXR 283.
Quit with :quit or Ctrl-D on an empty line. Ctrl-X ? for cheatsheet.
Remove TXR any time for a complete refund of your disk space.
1> (crypt "foo" "abc")
"abQ9KY.KfrYrc"
2> (crypt "foo" "$1$abc")
"$1$abc$/ThTVu/5nq9QB8iGNy5rp/"
3> (crypt "foo" "$2$abc")
** crypt failed: 22/"Invalid argument"
** during evaluation at expr-3:1 of form (crypt "foo" "$2$abc")
3> (crypt "foo" "$2a$abc")
** crypt failed: 22/"Invalid argument"
** during evaluation at expr-3:1 of form (crypt "foo" "$2a$abc")
3> (crypt "foo" "$5$abc")
"$5$abc$SNQ2QQBO1ax39EAHKvvnCoQB2LZIm1UiTfvRzzx0ud8"
4> (crypt "foo" "$7$abc")
** crypt failed: 22/"Invalid argument"
** during evaluation at expr-4:1 of form (crypt "foo" "$7$abc")

Why doesn't it segfault for $7$?

Because my wrapper function lexically analyzes the salt
to validate for good cases that don't crash, and only those
go through to crypt. For the cases that would crash if
crypt were called, it simulates the EINVAL error.

See the crypt_wrap function and its validate_salt helper
in this source file:

http://www.kylheku.com/cgit/txr/tree/sysif.c

validate_salt processes a wchar_t * string because that's
what the project uses everywhere for strings. It goes
to UTF-8 before handing it to crypt. This is 2-Clause BSD
licensed code so you have a lot of freedom with it,
like converting to char *.

If you happen use the code/approach and find cases that sneak through
and cause crypt to crash, please drop me a note.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

Re: A check for whether crypt() supports Blowfish?

<20221028112024.946@kylheku.com>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2934&group=comp.unix.programmer#2934

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: 864-117-4973@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.programmer
Subject: Re: A check for whether crypt() supports Blowfish?
Date: Fri, 28 Oct 2022 18:27:33 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <20221028112024.946@kylheku.com>
References: <tjgpe0$ghl$1@gioia.aioe.org>
<9hS6L.680938$Ny99.558805@fx16.iad>
<635bfb31$0$24802$426a74cc@news.free.fr>
<G2T6L.348052$elEa.126598@fx09.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 28 Oct 2022 18:27:33 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="edb3d930670cc4a75d7ce17342ddfa90";
logging-data="3323122"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+nbSUuma9Q8gD09UTzpNWgxlWuf0f8+O0="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:QJVDuI1+aesQTAGybnXi/cZrip0=
 by: Kaz Kylheku - Fri, 28 Oct 2022 18:27 UTC

On 2022-10-28, Scott Lurndal <scott@slp53.sl.home> wrote:
> Nicolas George <nicolas$george@salle-s.org> writes:
>>Scott Lurndal, dans le message <9hS6L.680938$Ny99.558805@fx16.iad>, a
>> écrit :
>>> Have you considered using openssl instead?
>>
>>Are you sure you understand what crypt() does?
>
> Are you sure you understand what opensll does?
>
> Hint, it supports all forms of symmetric and asymmetric
> cryptographic algorithms for stand-alone software as
> well as supporting transport layer security.

It's an extra dependency to add to a program, whereas
crypt is in any POSIX glibc (and we can probe it at run-time
for glibc extensions).

if a program just wants to detect whether the glibc "$2a"
is available, and maybe doesn't even care if the answer is
no, then it's rather a big detour to bring in openssl
and muck around with its Blowfish API.

I'm looking at the "openssl passwd" man page for the password
hashing command on a system here. It doesn't have Blowfish
either, only -1, -5, -6, -apr1 and -aixmd5. The first
three are like $1$, $5$ and $6$ in glibc crypt.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

Re: A check for whether crypt() supports Blowfish?

<20221028112823.517@kylheku.com>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2935&group=comp.unix.programmer#2935

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: 864-117-4973@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.programmer
Subject: Re: A check for whether crypt() supports Blowfish?
Date: Fri, 28 Oct 2022 18:33:45 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <20221028112823.517@kylheku.com>
References: <tjgpe0$ghl$1@gioia.aioe.org>
<9hS6L.680938$Ny99.558805@fx16.iad> <tjgshu$3m9$1@gioia.aioe.org>
<2OS6L.348025$elEa.296621@fx09.iad> <tjgtr7$ob5$1@gioia.aioe.org>
<v1T6L.348051$elEa.179442@fx09.iad>
Injection-Date: Fri, 28 Oct 2022 18:33:45 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="edb3d930670cc4a75d7ce17342ddfa90";
logging-data="3323122"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19DCpUozh72Xlaan+4FEVxYGr5WzE2eQ9M="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:fuoTE5AR8TrUKdPl5vJmjVrfWUk=
 by: Kaz Kylheku - Fri, 28 Oct 2022 18:33 UTC

On 2022-10-28, Scott Lurndal <scott@slp53.sl.home> wrote:
> openssl will opportunistically use cryptographic hardware on the
> host, when available. A big deal for production software. For toy
> software, crypt() may be easy to use, but not necessarily efficient.

Nobody needs crypt to be fast, other than password crackers.

Crypt is only required during password authentication. Maybe if you have
a single box with ten million users, each of whom is doing nothing
but logging in and out once a second, you might benefit from
hardware-accelerated crypt.

Re: A check for whether crypt() supports Blowfish?

<8uY6L.261628$BQA7.46262@fx41.iad>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2936&group=comp.unix.programmer#2936

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx41.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: A check for whether crypt() supports Blowfish?
Newsgroups: comp.unix.programmer
References: <tjgpe0$ghl$1@gioia.aioe.org> <9hS6L.680938$Ny99.558805@fx16.iad> <tjgshu$3m9$1@gioia.aioe.org> <2OS6L.348025$elEa.296621@fx09.iad> <tjgtr7$ob5$1@gioia.aioe.org> <v1T6L.348051$elEa.179442@fx09.iad> <20221028112823.517@kylheku.com>
Lines: 21
Message-ID: <8uY6L.261628$BQA7.46262@fx41.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Fri, 28 Oct 2022 22:13:24 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Fri, 28 Oct 2022 22:13:24 GMT
X-Received-Bytes: 1889
 by: Scott Lurndal - Fri, 28 Oct 2022 22:13 UTC

Kaz Kylheku <864-117-4973@kylheku.com> writes:
>On 2022-10-28, Scott Lurndal <scott@slp53.sl.home> wrote:
>> openssl will opportunistically use cryptographic hardware on the
>> host, when available. A big deal for production software. For toy
>> software, crypt() may be easy to use, but not necessarily efficient.
>
>Nobody needs crypt to be fast, other than password crackers.
>
>Crypt is only required during password authentication. Maybe if you have
>a single box with ten million users, each of whom is doing nothing
>but logging in and out once a second, you might benefit from
>hardware-accelerated crypt.

Who still uses crypt for password authentication[*]? Most use
message digests or secure hashes. The OP wanted to override the
algorithm with blowfish anyway, using openssl's BF_set_key() and BF_ecb_encrypt()
is relatively straightforward. Typical linux systems use MD5 hashes.

[*] the man page recommends against using crypt for cryptography
projects generally, except for backwards compatability with
legacy password authentication using DES.

Re: A check for whether crypt() supports Blowfish?

<20221028155326.919@kylheku.com>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2937&group=comp.unix.programmer#2937

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: 864-117-4973@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.programmer
Subject: Re: A check for whether crypt() supports Blowfish?
Date: Fri, 28 Oct 2022 22:58:56 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <20221028155326.919@kylheku.com>
References: <tjgpe0$ghl$1@gioia.aioe.org>
<9hS6L.680938$Ny99.558805@fx16.iad> <tjgshu$3m9$1@gioia.aioe.org>
<2OS6L.348025$elEa.296621@fx09.iad> <tjgtr7$ob5$1@gioia.aioe.org>
<v1T6L.348051$elEa.179442@fx09.iad> <20221028112823.517@kylheku.com>
<8uY6L.261628$BQA7.46262@fx41.iad>
Injection-Date: Fri, 28 Oct 2022 22:58:56 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="620a729e799e1a050f133c50a54826b0";
logging-data="3364372"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18/3lJCXgvFx7MnsNtKbIkQhLZdzBrwRic="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:qtq46tObQANEjf4TkHPQmxYnFK0=
 by: Kaz Kylheku - Fri, 28 Oct 2022 22:58 UTC

On 2022-10-28, Scott Lurndal <scott@slp53.sl.home> wrote:
> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>>On 2022-10-28, Scott Lurndal <scott@slp53.sl.home> wrote:
>>> openssl will opportunistically use cryptographic hardware on the
>>> host, when available. A big deal for production software. For toy
>>> software, crypt() may be easy to use, but not necessarily efficient.
>>
>>Nobody needs crypt to be fast, other than password crackers.
>>
>>Crypt is only required during password authentication. Maybe if you have
>>a single box with ten million users, each of whom is doing nothing
>>but logging in and out once a second, you might benefit from
>>hardware-accelerated crypt.
>
> Who still uses crypt for password authentication[*]? Most use

Probably, nobody; but they use the crypt API function.

For instance, in an Ubuntu system here, I have this in /etc/shadow:

root:$6$[...edited out...]:18246:0:99999:7:::

$6$ indicates SHA-512. This is the same as what openssl passwd will
generate with the -6 argument.

Your login program and whatnot check that with crypt().

> algorithm with blowfish anyway, using openssl's BF_set_key() and BF_ecb_encrypt()
> is relatively straightforward. Typical linux systems use MD5 hashes.

Not so much any more, I think.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

Re: A check for whether crypt() supports Blowfish?

<tjim82$mm$1@gioia.aioe.org>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2938&group=comp.unix.programmer#2938

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!QImplQW63EVMF2Hp+OxW0A.user.46.165.242.91.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: A check for whether crypt() supports Blowfish?
Date: Sat, 29 Oct 2022 07:54:42 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tjim82$mm$1@gioia.aioe.org>
References: <tjgpe0$ghl$1@gioia.aioe.org> <9hS6L.680938$Ny99.558805@fx16.iad> <tjgshu$3m9$1@gioia.aioe.org> <2OS6L.348025$elEa.296621@fx09.iad> <tjgtr7$ob5$1@gioia.aioe.org> <v1T6L.348051$elEa.179442@fx09.iad>
Injection-Info: gioia.aioe.org; logging-data="726"; posting-host="QImplQW63EVMF2Hp+OxW0A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Muttley@dastardlyhq.com - Sat, 29 Oct 2022 07:54 UTC

On Fri, 28 Oct 2022 16:01:31 GMT
scott@slp53.sl.home (Scott Lurndal) wrote:
>Muttley@dastardlyhq.com writes:
>>On Fri, 28 Oct 2022 15:45:02 GMT
>>scott@slp53.sl.home (Scott Lurndal) wrote:
>>>Muttley@dastardlyhq.com writes:
>>>>On Fri, 28 Oct 2022 15:09:57 GMT
>>>>scott@slp53.sl.home (Scott Lurndal) wrote:
>>>>>Muttley@dastardlyhq.com writes:
>>>>>>Yes, I've googled this, no I didn't find an answer.
>>>>>>
>>>>>>Some versions of glibc have been extended to support blowfish (algo 2a) in
>
>>>>>the
>>>>>>crypt via the $2a$ preamble in the salt. Does anyone know of a way to
>check
>>>>>if
>>>>>>its supported on a given system as crypt() has the very unhelpful
>behaviour
>>>>>of
>>>>>>SIGSEGV'ing if you give it an invalid encryption algo number.
>>>>>>
>>>>>
>>>>>Have you considered using openssl instead?
>>>>
>>>>This has nothing to do with sockets.
>>>>
>>>
>>>Openssl is a generalized cryptographic library that supports pretty much
>>>every standard symmetric and asymmetric crypto algorithm. It does far
>>>more than support transport level security. It's the primary toolkit
>>>(aside from RSA BSAFE) used in cryptographic software of all forms.
>>
>>Looks like an absolute PITA to use for that with contect creation and init
>>calls (why?) whereas crypt() is a single standalone function call that
>returns
>>the encrypted data. I'll pass.
>>
>
>openssl will opportunistically use cryptographic hardware on the
>host, when available. A big deal for production software. For toy

Is it? Depends how often you'll be calling it. For user password checks I
doubt you'll be doing it more than a few times a minute at most.

>software, crypt() may be easy to use, but not necessarily efficient.

So /bin/login is toy software?

>Yes, it has a complex API.

Which is a problem with a lot of modern frameworks.

Re: A check for whether crypt() supports Blowfish?

<tjimel$2vc$1@gioia.aioe.org>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2939&group=comp.unix.programmer#2939

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!QImplQW63EVMF2Hp+OxW0A.user.46.165.242.91.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: A check for whether crypt() supports Blowfish?
Date: Sat, 29 Oct 2022 07:58:13 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tjimel$2vc$1@gioia.aioe.org>
References: <tjgpe0$ghl$1@gioia.aioe.org>
<9hS6L.680938$Ny99.558805@fx16.iad> <tjgshu$3m9$1@gioia.aioe.org>
<2OS6L.348025$elEa.296621@fx09.iad> <tjgtr7$ob5$1@gioia.aioe.org>
<tjgvac$34cnr$1@dont-email.me>
Injection-Info: gioia.aioe.org; logging-data="3052"; posting-host="QImplQW63EVMF2Hp+OxW0A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Muttley@dastardlyhq.com - Sat, 29 Oct 2022 07:58 UTC

On Fri, 28 Oct 2022 16:17:17 -0000 (UTC)
Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>On Fri, 28 Oct 2022 15:52:07 +0000, Muttley wrote:
>> Looks like an absolute PITA to use for that with contect creation and init
>> calls (why?) whereas crypt() is a single standalone function call that
>returns
>> the encrypted data. I'll pass.
>
>Actually, crypt(3) doesn't return encrypted data; that would imply that there
>is a way to decrypt the results of crypt(3), which there is not.

That depends on how you personally define encryption. Others have different
ideas.

https://man7.org/linux/man-pages/man3/crypt.3.html

"crypt() is the password encryption function."

Re: A check for whether crypt() supports Blowfish?

<tjimlm$5ra$1@gioia.aioe.org>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2940&group=comp.unix.programmer#2940

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!QImplQW63EVMF2Hp+OxW0A.user.46.165.242.91.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: A check for whether crypt() supports Blowfish?
Date: Sat, 29 Oct 2022 08:01:58 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tjimlm$5ra$1@gioia.aioe.org>
References: <tjgpe0$ghl$1@gioia.aioe.org> <20221028105026.680@kylheku.com>
Injection-Info: gioia.aioe.org; logging-data="5994"; posting-host="QImplQW63EVMF2Hp+OxW0A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Muttley@dastardlyhq.com - Sat, 29 Oct 2022 08:01 UTC

On Fri, 28 Oct 2022 18:15:21 -0000 (UTC)
Kaz Kylheku <864-117-4973@kylheku.com> wrote:
>On 2022-10-28, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote:
>> Yes, I've googled this, no I didn't find an answer.
>>
>> Some versions of glibc have been extended to support blowfish (algo 2a) in
>the
>> crypt via the $2a$ preamble in the salt. Does anyone know of a way to check
>if
>> its supported on a given system as crypt() has the very unhelpful behaviour
>of
>> SIGSEGV'ing if you give it an invalid encryption algo number.
>
>I have experience in this area, having integrated crypt into the TXR
>Lisp language, and worked around the embarrassing segfault issue.
>
>Why doesn't it segfault for $7$?
>
>Because my wrapper function lexically analyzes the salt
>to validate for good cases that don't crash, and only those
>go through to crypt. For the cases that would crash if
>crypt were called, it simulates the EINVAL error.
>See the crypt_wrap function and its validate_salt helper
>in this source file:
>
>http://www.kylheku.com/cgit/txr/tree/sysif.c

That doesn't help to determine if a given system would support a given
encryption function because your code simply has hard coded validation.

My problem is that some versions of glibc support $2a$ and some don't and I
can't find any way of determining on the fly which they are short of calling
crypt() and seeing if it crashes which obviously is not very useful on a
running system as I don't want to be catching SIGSEGV just for this case.

Re: A check for whether crypt() supports Blowfish?

<tjin0r$9rb$1@gioia.aioe.org>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2941&group=comp.unix.programmer#2941

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!QImplQW63EVMF2Hp+OxW0A.user.46.165.242.91.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: A check for whether crypt() supports Blowfish?
Date: Sat, 29 Oct 2022 08:07:56 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tjin0r$9rb$1@gioia.aioe.org>
References: <tjgpe0$ghl$1@gioia.aioe.org>
<9hS6L.680938$Ny99.558805@fx16.iad>
<635bfb31$0$24802$426a74cc@news.free.fr>
<G2T6L.348052$elEa.126598@fx09.iad>
<20221028112024.946@kylheku.com>
Injection-Info: gioia.aioe.org; logging-data="10091"; posting-host="QImplQW63EVMF2Hp+OxW0A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Muttley@dastardlyhq.com - Sat, 29 Oct 2022 08:07 UTC

On Fri, 28 Oct 2022 18:27:33 -0000 (UTC)
Kaz Kylheku <864-117-4973@kylheku.com> wrote:
>On 2022-10-28, Scott Lurndal <scott@slp53.sl.home> wrote:
>> Nicolas George <nicolas$george@salle-s.org> writes:
>>>Scott Lurndal, dans le message <9hS6L.680938$Ny99.558805@fx16.iad>, a
>>> écrit :
>>>> Have you considered using openssl instead?
>>>
>>>Are you sure you understand what crypt() does?
>>
>> Are you sure you understand what opensll does?
>>
>> Hint, it supports all forms of symmetric and asymmetric
>> cryptographic algorithms for stand-alone software as
>> well as supporting transport layer security.
>
>It's an extra dependency to add to a program, whereas
>crypt is in any POSIX glibc (and we can probe it at run-time
>for glibc extensions).

How do we probe it without it crashing? Thats what I'm trying to find out.
Even a macro I can put in an #ifdef would work.

Re: A check for whether crypt() supports Blowfish?

<tjin59$bic$1@gioia.aioe.org>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2942&group=comp.unix.programmer#2942

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!QImplQW63EVMF2Hp+OxW0A.user.46.165.242.91.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: A check for whether crypt() supports Blowfish?
Date: Sat, 29 Oct 2022 08:10:17 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tjin59$bic$1@gioia.aioe.org>
References: <tjgpe0$ghl$1@gioia.aioe.org> <9hS6L.680938$Ny99.558805@fx16.iad> <tjgshu$3m9$1@gioia.aioe.org> <2OS6L.348025$elEa.296621@fx09.iad> <tjgtr7$ob5$1@gioia.aioe.org> <v1T6L.348051$elEa.179442@fx09.iad> <20221028112823.517@kylheku.com> <8uY6L.261628$BQA7.46262@fx41.iad>
Injection-Info: gioia.aioe.org; logging-data="11852"; posting-host="QImplQW63EVMF2Hp+OxW0A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Muttley@dastardlyhq.com - Sat, 29 Oct 2022 08:10 UTC

On Fri, 28 Oct 2022 22:13:24 GMT
scott@slp53.sl.home (Scott Lurndal) wrote:
>Kaz Kylheku <864-117-4973@kylheku.com> writes:
>>On 2022-10-28, Scott Lurndal <scott@slp53.sl.home> wrote:
>>> openssl will opportunistically use cryptographic hardware on the
>>> host, when available. A big deal for production software. For toy
>>> software, crypt() may be easy to use, but not necessarily efficient.
>>
>>Nobody needs crypt to be fast, other than password crackers.
>>
>>Crypt is only required during password authentication. Maybe if you have
>>a single box with ten million users, each of whom is doing nothing
>>but logging in and out once a second, you might benefit from
>>hardware-accelerated crypt.
>
>Who still uses crypt for password authentication[*]? Most use
>message digests or secure hashes. The OP wanted to override the
>algorithm with blowfish anyway, using openssl's BF_set_key() and
>BF_ecb_encrypt()

Why does OpenSSL require so many stages to do such a simple task?

ie: Here is the key, salt and encryption type, now give me the encrypted
data. That can be a single function call.

Re: A check for whether crypt() supports Blowfish?

<635cf0ae$0$25834$426a74cc@news.free.fr>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2943&group=comp.unix.programmer#2943

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.gegeweb.eu!gegeweb.org!usenet-fr.net!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!cleanfeed3-b.proxad.net!nnrp2-2.free.fr!not-for-mail
Newsgroups: comp.unix.programmer
From: nicolas$george@salle-s.org (Nicolas George)
Subject: Re: A check for whether crypt() supports Blowfish?
Sender: george@phare.invalid (Nicolas George)
X-Newsreader: Flrn (0.9.20070704)
References: <tjgpe0$ghl$1@gioia.aioe.org> <9hS6L.680938$Ny99.558805@fx16.iad> <635bfb31$0$24802$426a74cc@news.free.fr> <G2T6L.348052$elEa.126598@fx09.iad> <20221028112024.946@kylheku.com> <tjin0r$9rb$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1
Date: 29 Oct 2022 09:21:50 GMT
Lines: 5
Message-ID: <635cf0ae$0$25834$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 29 Oct 2022 11:21:50 CEST
NNTP-Posting-Host: 129.199.129.80
X-Trace: 1667035310 news-2.free.fr 25834 129.199.129.80:53442
X-Complaints-To: abuse@proxad.net
 by: Nicolas George - Sat, 29 Oct 2022 09:21 UTC

Muttley@dastardlyhq.com, dans le message <tjin0r$9rb$1@gioia.aioe.org>,
a écrit :
> How do we probe it without it crashing?

Fork to insulate the crash and probe.

Re: A check for whether crypt() supports Blowfish?

<tjirsh$85m$1@gioia.aioe.org>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2944&group=comp.unix.programmer#2944

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!QImplQW63EVMF2Hp+OxW0A.user.46.165.242.91.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: A check for whether crypt() supports Blowfish?
Date: Sat, 29 Oct 2022 09:30:57 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tjirsh$85m$1@gioia.aioe.org>
References: <tjgpe0$ghl$1@gioia.aioe.org> <9hS6L.680938$Ny99.558805@fx16.iad> <635bfb31$0$24802$426a74cc@news.free.fr> <G2T6L.348052$elEa.126598@fx09.iad> <20221028112024.946@kylheku.com> <tjin0r$9rb$1@gioia.aioe.org> <635cf0ae$0$25834$426a74cc@news.free.fr>
Injection-Info: gioia.aioe.org; logging-data="8374"; posting-host="QImplQW63EVMF2Hp+OxW0A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Muttley@dastardlyhq.com - Sat, 29 Oct 2022 09:30 UTC

On 29 Oct 2022 09:21:50 GMT
Nicolas George <nicolas$george@salle-s.org> wrote:
>Muttley@dastardlyhq.com, dans le message <tjin0r$9rb$1@gioia.aioe.org>,
> a �crit�:
>> How do we probe it without it crashing?
>
>Fork to insulate the crash and probe.

Yes, that would work but its a lot of effort. Surely glibc must have some
way of informing you whether it supports it?

Re: A check for whether crypt() supports Blowfish?

<tjjdn9$3h3qd$1@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2945&group=comp.unix.programmer#2945

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: lew.pitcher@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.programmer
Subject: Re: A check for whether crypt() supports Blowfish?
Date: Sat, 29 Oct 2022 14:35:21 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <tjjdn9$3h3qd$1@dont-email.me>
References: <tjgpe0$ghl$1@gioia.aioe.org>
<9hS6L.680938$Ny99.558805@fx16.iad> <tjgshu$3m9$1@gioia.aioe.org>
<2OS6L.348025$elEa.296621@fx09.iad> <tjgtr7$ob5$1@gioia.aioe.org>
<tjgvac$34cnr$1@dont-email.me> <tjimel$2vc$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 29 Oct 2022 14:35:21 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="b6187a994f999ccd529e8ce00d33ae24";
logging-data="3706701"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19rW/ZczxFTSUM0KELeXtnc0mzlBEuljpY="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:UFPJjPsMKznZq3zk0azNwo7CF80=
 by: Lew Pitcher - Sat, 29 Oct 2022 14:35 UTC

On Sat, 29 Oct 2022 07:58:13 +0000, Muttley wrote:

> On Fri, 28 Oct 2022 16:17:17 -0000 (UTC)
> Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>>On Fri, 28 Oct 2022 15:52:07 +0000, Muttley wrote:
>>> Looks like an absolute PITA to use for that with contect creation and init
>>> calls (why?) whereas crypt() is a single standalone function call that
>>returns
>>> the encrypted data. I'll pass.
>>
>>Actually, crypt(3) doesn't return encrypted data; that would imply that there
>>is a way to decrypt the results of crypt(3), which there is not.
>
> That depends on how you personally define encryption. Others have different
> ideas.
>
> https://man7.org/linux/man-pages/man3/crypt.3.html
>
> "crypt() is the password encryption function."

Despite what the crypt(3) manpage's summary implies, the
manpage does detail the operation that crypt(3) performs:
"By taking the lowest 7 bits of each of the first eight characters
of the key, a 56-bit key is obtained. This 56-bit key is used to
encrypt repeatedly a constant string (usually a string consisting
of all zeros). The returned value points to the encrypted
password, a series of 13 printable ASCII characters (the first
two characters represent the salt itself). The return value
points to static data whose content is overwritten by each call."

So, as you can see, crypt(3) does /not/ encrypt the password, it
encrypts a "constant string" using a key derived from the password
and the salt. Decrypting the results of crypt(3), if at all
successful, will return only that "constant string" that was
encrypted.

--
Lew Pitcher
"In Skills, We Trust"

Re: A check for whether crypt() supports Blowfish?

<tjjdur$3hb1d$1@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2946&group=comp.unix.programmer#2946

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: nospam@needed.invalid (Paul)
Newsgroups: comp.unix.programmer
Subject: Re: A check for whether crypt() supports Blowfish?
Date: Sat, 29 Oct 2022 10:39:24 -0400
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <tjjdur$3hb1d$1@dont-email.me>
References: <tjgpe0$ghl$1@gioia.aioe.org> <9hS6L.680938$Ny99.558805@fx16.iad>
<tjgshu$3m9$1@gioia.aioe.org> <2OS6L.348025$elEa.296621@fx09.iad>
<tjgtr7$ob5$1@gioia.aioe.org> <tjgvac$34cnr$1@dont-email.me>
<tjimel$2vc$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 29 Oct 2022 14:39:23 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="da464f4654d578a2f3f8312e0f978ec4";
logging-data="3714093"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+DhO33JE8o+tSKUD7kXQ7DbT4BJcg44g0="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:Mp3piLqf14NqB6KllaOSBeNWkCA=
Content-Language: en-US
In-Reply-To: <tjimel$2vc$1@gioia.aioe.org>
 by: Paul - Sat, 29 Oct 2022 14:39 UTC

On 10/29/2022 3:58 AM, Muttley@dastardlyhq.com wrote:
> On Fri, 28 Oct 2022 16:17:17 -0000 (UTC)
> Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>> On Fri, 28 Oct 2022 15:52:07 +0000, Muttley wrote:
>>> Looks like an absolute PITA to use for that with contect creation and init
>>> calls (why?) whereas crypt() is a single standalone function call that
>> returns
>>> the encrypted data. I'll pass.
>>
>> Actually, crypt(3) doesn't return encrypted data; that would imply that there
>> is a way to decrypt the results of crypt(3), which there is not.
>
> That depends on how you personally define encryption. Others have different
> ideas.
>
> https://man7.org/linux/man-pages/man3/crypt.3.html
>
> "crypt() is the password encryption function."
>

crypt() , at least in one place, is deprecated.

There is a substitution library which may be deployed.
You could check a Ubuntu Synaptic package manager or
do "apt search crypt" and see what packages are available/installed.

https://launchpad.net/ubuntu/+source/libxcrypt/1:4.4.28-2

"libxcrypt is a modern library for one-way hashing of passwords.
It supports

DES
MD5
NTHASH
SUNMD5
SHA-2-256
SHA-2-512
bcrypt-based password hashes

It provides the traditional Unix 'crypt' and 'crypt_r' interfaces,
as well as a set of extended interfaces like 'crypt_gensalt'.
"

The SHA512 might bring you closer in line with current practice.

If I look at /etc/shadow in Ubuntu in WSL2 in Windows 11, I see

paul:$6$Igyn9e...

and the $6 suggests SHA512 is being used.

Paul


devel / comp.unix.programmer / A check for whether crypt() supports Blowfish?

Pages:123
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor