Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #177485

Tool to crypt a password

From Nicolas George <george@nsup.org>
Newsgroups linux.debian.user
Subject Tool to crypt a password
Date 2017-02-06 17:30 +0100
Message-ID <t7UkV-7hD-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi.

Does anybody know a packaged program that provides a simple but good
interface to the libc's crypt() function?

I mean something that reads "2JTnJhXPzISn" on stdin and writes
"$6$BqdmYkw0fsG5y8Av$LOTAkcnFu.LJlaZH./16RgX.IqSPoxuhALCqgih9tMqspMLMVzJ9WZqxUJr/.ium/8pi3iWh56G..V1XcRvNo."
on stdout, no more.

The closest thing I found for now is htpasswd, from apache2-utils. It
has the drawback of always wanting to work with a file, but a temp file
is not a big bother. More problematically, it only knows the oldest and
weakest hashing algorithms.

A good tool needs command-line options to choose between any hashing
algorithm supported by the libc and select the various options,
including the number of rounds. Ideally, it would parse /etc/login.defs
to use the same defaults as what passwd would put in /etc/shadow.

Is is quite easy to implement, as all the tricky crypto is already in
the libc and it would not run in an hostile environment. A few lines of
perl do the trick. But it is better to be able to rely on something
packaged.

Regards,

-- 
  Nicolas George

Back to linux.debian.user | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Tool to crypt a password Nicolas George <george@nsup.org> - 2017-02-06 17:30 +0100
  Re: Tool to crypt a password Greg Wooledge <wooledg@eeg.ccf.org> - 2017-02-06 17:40 +0100
    Re: Tool to crypt a password Nicolas George <george@nsup.org> - 2017-02-06 17:50 +0100
      Re: Tool to crypt a password Teemu Likonen <tlikonen@iki.fi> - 2017-02-06 18:40 +0100
        Re: Tool to crypt a password Nicolas George <george@nsup.org> - 2017-02-06 19:50 +0100
          Re: Tool to crypt a password Teemu Likonen <tlikonen@iki.fi> - 2017-02-07 07:00 +0100
      Re: Tool to crypt a password <tomas@tuxteam.de> - 2017-02-06 22:00 +0100

csiph-web