in reply to pure Perl SHA-256 crypt()

My linux must be too old (Debian stable) because I don't see a reference implementation in there, but here is one.

This document also comes with a textual description of the algorithm, which might be better suited for a perl re-implementation (in case nobody knows of an existing implementation).

But wouldn't it be much easier to use the C reference implementation? Why does it need to be perl?

You just need a C compiler on one of the machines, and then you can copy the compiled binary to all the other machines.

Replies are listed 'Best First'.
Re^2: pure Perl SHA-256 crypt()
by autocesco (Initiate) on Sep 05, 2011 at 15:41 UTC

    Thanks for the referenced documentation, moritz.
    The algorithm described before the source is not clearly just a SHA-256 digest.
    I was able to compile the source on *bsd , just providing auxiliary implementations for mempcpy() and stpncpy() GNU functions.
    I preferred a pure Perl implementation just because my authentication scripts are all Perl, and for future portability. Before trying, I believed that the sha256-crypt from glibc2.7 was too much GNU to port it with ease.

    Unfortunately so, I'm not going to write sha256-crypt for Perl, but I will follow moritz' suggestion and plug this external C binary : /

Re^2: pure Perl SHA-256 crypt()
by autocesco (Initiate) on Sep 08, 2011 at 12:18 UTC
    I finally found one in Crypt::Passwd::XS::unix_sha256_crypt() , it is not pure Perl but portable enough for my needs. It is based on the reference C implementation linked by moritz