From 57d687fcb87a41143039bb548ca363842e728463 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Tue, 28 Apr 2026 14:41:14 +0300 Subject: [PATCH] add 3proxy_crypt man --- CMakeLists.txt | 23 ++-- Makefile.FreeBSD | 1 + Makefile.Linux | 1 + Makefile.unix | 1 + debian/3proxy.manpages | 17 +-- doc/html/index.html | 1 + doc/html/man8/3proxy.8.html | 2 +- doc/html/man8/3proxy_crypt.8.html | 168 ++++++++++++++++++++++++++++++ man/3proxy_crypt.8 | 81 ++++++++++++++ 9 files changed, 279 insertions(+), 16 deletions(-) create mode 100644 doc/html/man8/3proxy_crypt.8.html create mode 100644 man/3proxy_crypt.8 diff --git a/CMakeLists.txt b/CMakeLists.txt index 1aa9c64..9428120 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -705,14 +705,23 @@ if(NOT WIN32) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/man/3proxy.8" DESTINATION ${CMAKE_INSTALL_MANDIR}/man8 ) - # Module man pages — installed with binary prefix + # 3proxy_crypt man page — no prefix (already has 3proxy_) + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/man/3proxy_crypt.8") + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/man/3proxy_crypt.8" + DESTINATION ${CMAKE_INSTALL_MANDIR}/man8 + ) + endif() + # Module man pages — installed with binary prefix only if module is built foreach(_MAN proxy socks pop3p smtpp ftppr tcppm udppm tlspr) - set(_MAN_SRC "${CMAKE_CURRENT_SOURCE_DIR}/man/${_MAN}.8") - if(EXISTS "${_MAN_SRC}") - install(FILES "${_MAN_SRC}" - DESTINATION ${CMAKE_INSTALL_MANDIR}/man8 - RENAME "${3PROXY_BINARY_PREFIX}${_MAN}.8" - ) + string(TOUPPER "${_MAN}" _MODULE_OPT) + if(3PROXY_BUILD_${_MODULE_OPT}) + set(_MAN_SRC "${CMAKE_CURRENT_SOURCE_DIR}/man/${_MAN}.8") + if(EXISTS "${_MAN_SRC}") + install(FILES "${_MAN_SRC}" + DESTINATION ${CMAKE_INSTALL_MANDIR}/man8 + RENAME "${3PROXY_BINARY_PREFIX}${_MAN}.8" + ) + endif() endif() endforeach() endif() diff --git a/Makefile.FreeBSD b/Makefile.FreeBSD index 847879d..ce07b2f 100644 --- a/Makefile.FreeBSD +++ b/Makefile.FreeBSD @@ -68,6 +68,7 @@ install: all for f in proxy socks pop3p smtpp ftppr tcppm udppm tlspr; do \ if [ -f man/$$f.8 ]; then install -m 644 man/$$f.8 $(MANDIR)/man8/$(PREFIX)$$f.8; fi; \ done + install -m 644 man/3proxy_crypt.8 $(MANDIR)/man8 install -d $(MANDIR)/man5 install -m 644 man/3proxy.cfg.5 $(MANDIR)/man5/3proxy.cfg.5 echo Run /usr/local/3proxy/bin/add3proxyuser.sh to add \'admin\' user diff --git a/Makefile.Linux b/Makefile.Linux index f27230c..713830a 100644 --- a/Makefile.Linux +++ b/Makefile.Linux @@ -135,6 +135,7 @@ install-man: for f in proxy socks pop3p smtpp ftppr tcppm udppm tlspr; do \ if [ -f man/$$f.8 ]; then $(INSTALL_DATA) man/$$f.8 $(MANDIR8)/$(PREFIX)$$f.8; fi; \ done + $(INSTALL_DATA) man/3proxy_crypt.8 $(MANDIR8) install-init: $(INSTALL_BIN) -d $(INITDDIR) diff --git a/Makefile.unix b/Makefile.unix index 21885ee..f386a5d 100644 --- a/Makefile.unix +++ b/Makefile.unix @@ -70,6 +70,7 @@ install: all for f in proxy socks pop3p smtpp ftppr tcppm udppm tlspr; do \ if [ -f man/$$f.8 ]; then install -m 644 man/$$f.8 $(MANDIR)/man8/$(PREFIX)$$f.8; fi; \ done + install -m 644 man/3proxy_crypt.8 $(MANDIR)/man8 install -d $(MANDIR)/man5 install -m 644 man/3proxy.cfg.5 $(MANDIR)/man5/3proxy.cfg.5 echo Run /usr/local/3proxy/bin/add3proxyuser.sh to add \'admin\' user diff --git a/debian/3proxy.manpages b/debian/3proxy.manpages index e6712ef..e7e4124 100644 --- a/debian/3proxy.manpages +++ b/debian/3proxy.manpages @@ -1,10 +1,11 @@ man/3proxy.8 man/3proxy.cfg.5 -man/ftppr.8 -man/pop3p.8 -man/tlspr.8 -man/proxy.8 -man/smtpp.8 -man/socks.8 -man/tcppm.8 -man/udppm.8 \ No newline at end of file +man/3proxy_ftppr.8 +man/3proxy_pop3p.8 +man/3proxy_tlspr.8 +man/3proxy_proxy.8 +man/3proxy_smtpp.8 +man/3proxy_socks.8 +man/3proxy_tcppm.8 +man/3proxy_udppm.8 +man/3proxy_crypt.8 diff --git a/doc/html/index.html b/doc/html/index.html index 2dff123..7802dc5 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -4,6 +4,7 @@ How To (English, very incomplete)
How To (Russian)

Man pages:

+
3proxy_crypt.8
3proxy.8
ftppr.8
pop3p.8 diff --git a/doc/html/man8/3proxy.8.html b/doc/html/man8/3proxy.8.html index c616d3e..fe6a017 100644 --- a/doc/html/man8/3proxy.8.html +++ b/doc/html/man8/3proxy.8.html @@ -195,7 +195,7 @@ to 3proxy@3proxy.org

-

3proxy.cfg(3), +

3proxy.cfg(5), proxy(8), ftppr(8), socks(8), pop3p(8), tcppm(8), udppm(8), kill(1), syslogd(8),
https://3proxy.org/

diff --git a/doc/html/man8/3proxy_crypt.8.html b/doc/html/man8/3proxy_crypt.8.html new file mode 100644 index 0000000..cd4b338 --- /dev/null +++ b/doc/html/man8/3proxy_crypt.8.html @@ -0,0 +1,168 @@ + + + + + + + +

3proxy_crypt

+ +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+EXAMPLE
+NOTES
+BUGS
+SEE ALSO
+AUTHORS
+ +
+ + +

NAME + +

+ + + +

3proxy_crypt +- utility to generate encrypted passwords for 3proxy

+ +

SYNOPSIS + +

+ + + +

3proxy_crypt +password
+3proxy_crypt
salt password

+ +

DESCRIPTION + +

+ + + +

3proxy_crypt +is a utility to generate encrypted password hashes for use +with 3proxy configuration. Encrypted passwords allow the +system to avoid storing passwords in cleartext in +configuration files.

+ +

When invoked +with a single argument, it produces an NT password hash +(MD4-based, suitable for NTLM authentication). The output is +prefixed with NT:.

+ +

When invoked +with two arguments (salt and password), it produces a +BLAKE2b password hash. The salt length is limited to 64 +characters. The output is prefixed with CR:.

+ +

The resulting +hash can be used in the 3proxy configuration file with the +users directive instead of a cleartext password.

+ +

OPTIONS + +

+ + + +

password

+ +

Cleartext password to +encrypt.

+ + + + + + + + +
+ + +

salt

+ + +

Salt string for BLAKE2b hashing (max 64 characters).

+
+ +

EXAMPLE + +

+ + +

Generate NT +password hash:

+ +

3proxy_crypt +MySecretPassword

+ +

Result:

+ + +

NT:3F7E6D8D96E8E7A9B0C1D2E3F4A5B6C7

+ +

Generate BLAKE2b password hash +with salt:

+ +

3proxy_crypt MySalt +MySecretPassword

+ +

Result:

+ +

CR:$3$MySalt$...

+ +

Using in 3proxy.cfg:

+ +

users +user1:CR:$3$MySalt$...

+ +

NOTES + +

+ + +

The NT hash uses +the RSA MD4 Message-Digest Algorithm. The BLAKE2b hash uses +the BLAKE2 cryptographic hash function.

+ +

When a password +hash is prefixed with NT: or CR:, 3proxy uses +the corresponding algorithm to verify passwords instead of +comparing cleartext strings.

+ +

BUGS + +

+ + +

Report all bugs +to 3proxy@3proxy.org

+ +

SEE ALSO + +

+ + +

3proxy(8), +3proxy.cfg(5),
+https://3proxy.org/

+ +

AUTHORS + +

+ + +

3proxy is +designed by Vladimir 3APA3A Dubrovin +(3proxy@3proxy.org)

+
+ + diff --git a/man/3proxy_crypt.8 b/man/3proxy_crypt.8 new file mode 100644 index 0000000..a5e6aef --- /dev/null +++ b/man/3proxy_crypt.8 @@ -0,0 +1,81 @@ +.TH 3proxy_crypt "8" "April 2026" "3proxy 0.9" "Universal proxy server" +.SH NAME +.B 3proxy_crypt +\- utility to generate encrypted passwords for 3proxy +.SH SYNOPSIS +.B 3proxy_crypt +.I password +.br +.B 3proxy_crypt +.I salt password +.SH DESCRIPTION +.B 3proxy_crypt +is a utility to generate encrypted password hashes for use with 3proxy +configuration. Encrypted passwords allow the system to avoid storing +passwords in cleartext in configuration files. +.PP +When invoked with a single argument, it produces an NT password hash +(MD4-based, suitable for NTLM authentication). The output is prefixed with +.BR NT: . +.PP +When invoked with two arguments (salt and password), it produces a BLAKE2b +password hash. The salt length is limited to 64 characters. The output is +prefixed with +.BR CR: . +.PP +The resulting hash can be used in the 3proxy configuration file with the +.B users +directive instead of a cleartext password. +.SH OPTIONS +.TP +.I password +Cleartext password to encrypt. +.TP +.I salt +Salt string for BLAKE2b hashing (max 64 characters). +.SH EXAMPLE +.TP +Generate NT password hash: +.RS +3proxy_crypt MySecretPassword +.RE +.TP +Result: +.RS +NT:3F7E6D8D96E8E7A9B0C1D2E3F4A5B6C7 +.RE +.TP +Generate BLAKE2b password hash with salt: +.RS +3proxy_crypt MySalt MySecretPassword +.RE +.TP +Result: +.RS +CR:$3$MySalt$... +.RE +.TP +Using in 3proxy.cfg: +.RS +users user1:CR:$3$MySalt$... +.RE +.SH NOTES +The NT hash uses the RSA MD4 Message-Digest Algorithm. The BLAKE2b hash +uses the BLAKE2 cryptographic hash function. +.PP +When a password hash is prefixed with +.B NT: +or +.BR CR: , +3proxy uses the corresponding algorithm to verify passwords instead of +comparing cleartext strings. +.SH BUGS +Report all bugs to +.BR 3proxy@3proxy.org +.SH SEE ALSO +3proxy(8), 3proxy.cfg(5), +.br +https://3proxy.org/ +.SH AUTHORS +3proxy is designed by Vladimir 3APA3A Dubrovin +.RI ( 3proxy@3proxy.org )