Hello!

I'd like to see few more lines about SHA-2 support in glibc crypt() in
documentation. I've created small patch for nginx.org repo, it's
attached.

-- 
WBRBW, Leonid Evdokimov, xmpp:l...@darkk.net.ru http://darkk.net.ru 
tel:+79816800702
PGP: 6691 DE6B 4CCD C1C1 76A0  0D4A E1F2 A980 7F50 FAB2
# HG changeset patch
# User Leonid Evdokimov <l...@darkk.net.ru>
# Date 1507567640 -10800
#      Mon Oct 09 19:47:20 2017 +0300
# Node ID ef79dd801d1b7aedebd76c9e3a034b2009a34b78
# Parent  2ac75347ed1af5a42d84e08edbe66f762676e668
Mention that crypt() may support SHA-2 schemes as well

diff -r 2ac75347ed1a -r ef79dd801d1b xml/en/docs/http/ngx_http_auth_basic_module.xml
--- a/xml/en/docs/http/ngx_http_auth_basic_module.xml	Mon Oct 09 18:14:23 2017 +0300
+++ b/xml/en/docs/http/ngx_http_auth_basic_module.xml	Mon Oct 09 19:47:20 2017 +0300
@@ -97,6 +97,12 @@
 encrypted with the <c-func>crypt</c-func> function; can be generated using
 the “<command>htpasswd</command>” utility from the Apache HTTP Server
 distribution or the “<command>openssl passwd</command>” command;
+<note>
+<link url="https://en.wikipedia.org/wiki/GNU_C_Library";>Glibc</link> implementation of <c-func>crypt</c-func>
+also support salted SHA-256 and SHA-512 schemes (<literal>$5$</literal> и <literal>$6$</literal>).
+These hashes may be generated using “<command>mkpasswd</command>” utlity from “whois” package or following python one-liner:
+“<command>python2 -c 'import base64, os, crypt; print crypt.crypt("P@ssw0rd", "$6$" + base64.b64encode(os.urandom(12), altchars="./"))'</command>”.
+</note>
 </listitem>
 
 <listitem>
diff -r 2ac75347ed1a -r ef79dd801d1b xml/ru/docs/http/ngx_http_auth_basic_module.xml
--- a/xml/ru/docs/http/ngx_http_auth_basic_module.xml	Mon Oct 09 18:14:23 2017 +0300
+++ b/xml/ru/docs/http/ngx_http_auth_basic_module.xml	Mon Oct 09 19:47:20 2017 +0300
@@ -97,6 +97,12 @@
 зашифрованные функцией <c-func>crypt</c-func>; могут быть созданы
 с помощью утилиты “<command>htpasswd</command>” из дистрибутива HTTP-сервера
 Apache или команды “<command>openssl passwd</command>”;
+<note>
+Функция <c-func>crypt</c-func> в <link url="https://ru.wikipedia.org/wiki/Glibc";>glibc</link>
+также поддерживает схемы SHA-256 и SHA-512 с солью (<literal>$5$</literal> и <literal>$6$</literal>).
+Подобные хэши могут быть созданы с помощью команды “<command>mkpasswd</command>” из пакета “whois” или однострочника на python:
+“<command>python2 -c 'import base64, os, crypt; print crypt.crypt("P@ssw0rd", "$6$" + base64.b64encode(os.urandom(12), altchars="./"))'</command>”.
+</note>
 </listitem>
 
 <listitem>

Attachment: signature.asc
Description: PGP signature

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel

Reply via email to