1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Steve Sprang <scs@stevesprang.com>
3 ;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2015 Aljosha Papsch <misc@rpapsch.de>
5 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
6 ;;; Copyright © 2016 Jessica Tallon <tsyesika@tsyesika.se>
7 ;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
8 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
9 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
10 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
11 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
12 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
13 ;;; Copyright © 2017 Jelle Licht <jlicht@fsfe.org>
14 ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
15 ;;; Copyright © 2017 Nicolas Goaziou <mail@nicolasgoaziou.fr>
17 ;;; This file is part of GNU Guix.
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32 (define-module (gnu packages password-utils)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix build-system cmake)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix download)
37 #:use-module (guix packages)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages admin)
40 #:use-module (gnu packages aidc)
41 #:use-module (gnu packages base)
42 #:use-module (gnu packages check)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages freedesktop)
45 #:use-module (gnu packages glib)
46 #:use-module (gnu packages gnupg)
47 #:use-module (gnu packages gnuzilla)
48 #:use-module (gnu packages gtk)
49 #:use-module (gnu packages guile)
50 #:use-module (gnu packages kerberos)
51 #:use-module (gnu packages libffi)
52 #:use-module (gnu packages linux)
53 #:use-module (gnu packages man)
54 #:use-module (gnu packages multiprecision)
55 #:use-module (gnu packages ncurses)
56 #:use-module (gnu packages pkg-config)
57 #:use-module (gnu packages python)
58 #:use-module (gnu packages suckless)
59 #:use-module (gnu packages tls)
60 #:use-module (gnu packages qt)
61 #:use-module (gnu packages version-control)
62 #:use-module (gnu packages xdisorg)
63 #:use-module (gnu packages xorg)
64 #:use-module (guix build-system python))
73 (uri (string-append "mirror://sourceforge/pwgen/pwgen/" version
74 "/pwgen-" version ".tar.gz"))
76 (base32 "0mhmw700kkh238fzivcwnwi94bj9f3h36yfh3k3j2v19b0zmjx7b"))))
77 (build-system gnu-build-system)
79 `(#:tests? #f)) ; no test suite
80 (home-page "http://pwgen.sourceforge.net/")
81 (synopsis "Password generator")
82 (description "Pwgen generates passwords which can be easily memorized by a
84 (license license:gpl2)))
86 (define-public keepassxc
93 (uri (string-append "https://github.com/keepassxreboot/" name
94 "/releases/download/" version "/keepassxc-"
95 version "-src.tar.xz"))
98 "1gkxsv3g4pkzbjkd1c27k15m2b5y2fqnnijphnaiv542yk7csqb7"))))
99 (build-system cmake-build-system)
101 `(("libgcrypt" ,libgcrypt)
105 ("qtx11extras" ,qtx11extras)
108 `(("qttools" ,qttools)))
109 (home-page "https://www.keepassxc.org")
110 (synopsis "Password manager")
111 (description "KeePassXC is a password manager or safe which helps you to
112 manage your passwords in a secure way. You can put all your passwords in one
113 database, which is locked with one master key or a key-file which can be stored
114 on an external storage device. The databases are encrypted using the
115 algorithms AES or Twofish.")
116 ;; Non functional parts use various licences.
117 (license license:gpl3)))
119 (define-public keepassx
126 (uri (string-append "https://www.keepassx.org/releases/" version
127 "/keepassx-" version ".tar.gz"))
130 "1ia7cqx9ias38mnffsl7da7g1f66bcbjsi23k49sln0c6spb9zr3"))))
131 (build-system cmake-build-system)
133 `(("libgcrypt" ,libgcrypt)
139 (home-page "https://www.keepassx.org")
140 (synopsis "Password manager")
141 (description "KeePassX is a password manager or safe which helps you to
142 manage your passwords in a secure way. You can put all your passwords in one
143 database, which is locked with one master key or a key-file which can be stored
144 on an external storage device. The databases are encrypted using the
145 algorithms AES or Twofish.")
146 ;; Non functional parts use various licences.
147 (license license:gpl3)
148 (properties `((superseded . ,keepassxc)))))
150 (define-public shroud
156 (uri (string-append "https://files.dthompson.us/shroud/shroud-"
160 "1y43yhgy2zbrk5bqj3qyx9rkcz2bma9sinlrg7dip3jqms9gq4lr"))))
161 (build-system gnu-build-system)
164 (modify-phases %standard-phases
165 (add-after 'install 'wrap-shroud
166 (lambda* (#:key outputs #:allow-other-keys)
167 (let* ((out (assoc-ref outputs "out"))
168 (ccachedir (string-append out "/lib/guile/2.0/ccache"))
169 (prog (string-append out "/bin/shroud")))
171 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,ccachedir)))
174 `(("guile" ,guile-2.0)
177 (synopsis "GnuPG-based secret manager")
178 (description "Shroud is a simple secret manager with a command line
179 interface. The password database is stored as a Scheme s-expression and
180 encrypted with a GnuPG key. Secrets consist of an arbitrary number of
181 key/value pairs, making Shroud suitable for more than just password storage.
182 For copying and pasting secrets into web browsers and other graphical
183 applications, there is xclip integration." )
184 (home-page "https://dthompson.us/projects/shroud.html")
185 (license license:gpl3+)))
193 (uri (string-append "http://www.guengel.ch/myapps/yapet/downloads/yapet-"
198 "0ydbnqw6icdh07pnv2w6dhvq501bdfvrklv4xmyr8znca9d753if"))))
199 (build-system gnu-build-system)
201 `(("ncurses" ,ncurses)
202 ("openssl" ,openssl)))
204 `(("pkg-config" ,pkg-config)))
205 (synopsis "Yet Another Password Encryption Tool")
206 (description "YAPET is a text based password manager using the Blowfish
207 encryption algorithm. Because of its small footprint and very few library
208 dependencies, it is suited for installing on desktop and server systems alike.
209 The text based user interface allows you to run YAPET easily in a Secure Shell
210 session. Two companion utilities enable users to convert CSV files to YAPET
212 (home-page "http://www.guengel.ch/myapps/yapet/")
213 (license license:gpl3+)))
215 (define-public cracklib
221 (uri (string-append "https://github.com/cracklib/cracklib/"
222 "releases/download/" name "-" version "/"
223 name "-" version ".tar.gz"))
224 (patches (search-patches "cracklib-CVE-2016-6318.patch"
225 "cracklib-fix-buffer-overflow.patch"))
228 "0hrkb0prf7n92w6rxgq0ilzkk6rkhpys2cfqkrbzswp27na7dkqp"))))
229 (build-system gnu-build-system)
230 (synopsis "Password checking library")
231 (home-page "https://github.com/cracklib/cracklib")
233 "CrackLib is a library containing a C function which may be used in a
234 @command{passwd}-like program. The idea is simple: try to prevent users from
235 choosing passwords that could easily be guessed (or \"cracked\") by filtering
236 them out, at the source.")
237 (license license:lgpl2.1)))
239 (define-public libpwquality
241 (name "libpwquality")
246 (string-append "https://github.com/" name "/" name
247 "/releases/download/" name "-" version
248 "/" name "-" version ".tar.bz2")
249 (string-append "https://launchpad.net/libpwquality/trunk/"
250 version "/+download/"
251 name "-" version ".tar.bz2")))
254 "0syyz8r54l8mqmbb0mw19qz4z2cx8gdgidicb8k2s5zjdh2gzrhx"))))
255 (build-system gnu-build-system)
257 ;; XXX: have RUNPATH issue.
258 '(#:configure-flags '("--disable-python-bindings")))
260 `(("cracklib" ,cracklib)))
261 (synopsis "Password quality checker")
262 (home-page "https://github.com/libpwquality/libpwquality")
264 "Libpwquality is a library for password quality checking and generation of
265 random passwords that pass the checks.")
266 (license license:gpl2+)))
268 (define-public assword
276 "http://http.debian.net/debian/pool/main/a/assword/"
277 "assword_" version ".orig.tar.gz")))
280 "0l6170y6my1gprqkazvzabgjkrkr9v2q7z48vjflna4r323yqira"))))
282 `(;; irritatingly, tests do run but not there are two problems:
283 ;; - "import gtk" fails for unknown reasons here despite it the
284 ;; program working (indeed, I've found I have to do a logout and log
285 ;; back in in after an install order for some mumbo jumbo environment
286 ;; variable mess to work with pygtk and assword... what's up with
288 ;; - even when the tests fail, they don't return a nonzero status,
289 ;; so I'm not sure how to programmatically get that information
292 (modify-phases %standard-phases
293 (add-after 'install 'wrap-assword
294 (lambda* (#:key outputs #:allow-other-keys)
295 (let ((prog (string-append
296 (assoc-ref outputs "out")
298 (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
300 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))
302 (add-after 'install 'manpage
303 (lambda* (#:key outputs #:allow-other-keys)
305 ;; Without this substitution, it fails with
306 ;; ImportError: No module named 'gpg'
307 (substitute* "Makefile"
308 (("PYTHONPATH=.") ""))
309 (zero? (system* "make" "assword.1"))
312 (string-append (assoc-ref outputs "out") "/share/man/man1"))))))))
313 (build-system python-build-system)
315 `(("txt2man" ,txt2man)))
318 ("python-xdo" ,python-xdo)
319 ("python-gpg" ,python-gpg)
320 ("python-pygobject" ,python-pygobject)))
323 (home-page "https://finestructure.net/assword/")
324 (synopsis "Password manager")
325 (description "assword is a simple password manager using GPG-wrapped
326 JSON files. It has a command line interface as well as a very simple
327 graphical interface, which can even \"type\" your passwords into
329 (license license:gpl3+)))
331 (define-public password-store
333 (name "password-store")
338 (string-append "https://git.zx2c4.com/password-store/snapshot/"
339 name "-" version ".tar.xz"))
342 "0scqkpll2q8jhzcgcsh9kqz0gwdpvynivqjmmbzax2irjfaiklpn"))))
343 (build-system gnu-build-system)
346 (modify-phases %standard-phases
349 (add-before 'install 'patch-passmenu-path
350 (lambda* (#:key inputs #:allow-other-keys)
351 (substitute* "contrib/dmenu/passmenu"
352 (("dmenu") (string-append (assoc-ref inputs "dmenu")
354 (("xdotool") (string-append (assoc-ref inputs "xdotool")
357 (add-after 'install 'install-passmenu
358 (lambda* (#:key outputs #:allow-other-keys)
359 (let ((out (assoc-ref outputs "out")))
360 (copy-file "contrib/dmenu/passmenu"
361 (string-append out "/bin/passmenu"))
363 (add-after 'install 'wrap-path
364 (lambda* (#:key inputs outputs #:allow-other-keys)
365 (let ((out (assoc-ref outputs "out"))
366 (path (map (lambda (pkg)
367 (string-append (assoc-ref inputs pkg) "/bin"))
368 '("coreutils" "getopt" "git" "gnupg" "qrencode"
369 "sed" "tree" "which" "xclip"))))
370 (wrap-program (string-append out "/bin/pass")
371 `("PATH" ":" prefix (,(string-join path ":"))))
373 (add-after 'wrap-path 'install-shell-completions
374 (lambda* (#:key outputs #:allow-other-keys)
375 (let* ((out (assoc-ref outputs "out"))
376 (bashcomp (string-append out "/etc/bash_completion.d")))
377 ;; TODO: install fish and zsh completions.
379 (copy-file "src/completion/pass.bash-completion"
380 (string-append bashcomp "/pass"))
382 #:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
383 ;; Parallel tests may cause a race condition leading to a
384 ;; timeout in some circumstances.
386 #:test-target "test"))
389 ("getopt" ,util-linux)
392 ("qrencode" ,qrencode)
397 ("xdotool" ,xdotool)))
398 (home-page "http://www.passwordstore.org/")
399 (synopsis "Encrypted password manager")
400 (description "Password-store is a password manager which uses GnuPG to
401 store and retrieve passwords. The tool stores each password in its own
402 GnuPG-encrypted file, allowing the program to be simple yet secure.
403 Synchronization is possible using the integrated git support, which commits
404 changes to your password database to a git repository that can be managed
405 through the pass command.")
406 (license license:gpl2+)))
408 (define-public argon2
416 (string-append "https://github.com/P-H-C/phc-winner-argon2/archive/"
418 (file-name (string-append name "-" version ".tar.gz"))
421 "1rymikbysasdadm325jx69i0q19d9srqkny69jwmhswlidr4j07y"))))
422 (build-system gnu-build-system)
424 `(#:test-target "test"
425 #:make-flags '("CC=gcc")
427 (modify-phases %standard-phases
431 (let ((out (assoc-ref %outputs "out")))
432 (install-file "argon2" (string-append out "/bin"))
433 (install-file "libargon2.a" (string-append out "/lib"))
434 (install-file "libargon2.so" (string-append out "/lib"))
435 (copy-recursively "include"
436 (string-append out "/include"))))))))
437 (home-page "https://www.argon2.com/")
438 (synopsis "Password hashing library")
439 (description "Argon2 provides a key derivation function that was declared
440 winner of the 2015 Password Hashing Competition.")
441 (license license:cc0)))
443 (define-public python-bcrypt
445 (name "python-bcrypt")
450 (uri (pypi-uri "bcrypt" version))
453 "1giy0dvd8gvq6flxh44np1v2nqwsji5qsnrz038mgwzgp7c20j75"))))
454 (build-system python-build-system)
456 `(("python-pycparser" ,python-pycparser)
457 ("python-pytest" ,python-pytest)))
459 `(("python-cffi" ,python-cffi)
460 ("python-six" ,python-six)))
461 (home-page "https://github.com/pyca/bcrypt/")
463 "Modern password hashing library")
465 "Bcrypt is a Python module which provides a password hashing method based
466 on the Blowfish password hashing algorithm, as described in
467 @url{http://static.usenix.org/events/usenix99/provos.html,\"A Future-Adaptable
468 Password Scheme\"} by Niels Provos and David Mazieres.")
469 (license license:asl2.0)))
471 (define-public python2-bcrypt
472 (package-with-python2 python-bcrypt))
474 (define-public pass-git-helper
476 (name "pass-git-helper")
481 (uri (string-append "https://github.com/languitar/pass-git-helper/archive/release-"
485 "0lz5ncy44pz7z1j2nnyildx8sq33zi3xvg5nkwg25n11nasqh2xn"))))
486 (build-system python-build-system)
489 (modify-phases %standard-phases
490 (add-before 'build 'patch-pass-path
491 (lambda* (#:key inputs #:allow-other-keys)
492 (let* ((password-store (assoc-ref inputs "password-store"))
493 (pass (string-append password-store "/bin/pass")))
494 (substitute* "pass-git-helper"
495 (("'pass'") (string-append "'" pass "'")))
498 `(("python-pyxdg" ,python-pyxdg)
499 ("password-store" ,password-store)))
500 (home-page "https://github.com/languitar/pass-git-helper")
501 (synopsis "Git credential helper interfacing with pass")
502 (description "pass-git-helper is a git credential helper which allows to
503 use pass, the standard unix password manager, as the credential backend for
504 your git repositories. This is achieved by explicitly defining mappings
505 between hosts and entries in the password store.")
506 (license license:lgpl3+)))
508 (define-public john-the-ripper-jumbo
509 (let ((official-version "1.8.0")
512 (name "john-the-ripper-jumbo")
513 (version (string-append official-version "-" jumbo-version))
517 (uri (string-append "http://www.openwall.com/john/j/john-"
518 official-version "-jumbo-" jumbo-version ".tar.xz"))
521 "08q92sfdvkz47rx6qjn7qv57cmlpy7i7rgddapq5384mb413vjds"))
525 (uri (string-append "https://github.com/magnumripper/"
526 "JohnTheRipper/commit/"
527 "e2e868db3e153b3f959e119a51703d4afb99c624.patch"))
528 (file-name "john-the-ripper-jumbo-gcc5-inline.patch")
531 "1shvcf1y2097115mxhzdkm64dr106a8zr6pqjqyh171q5ng5vfra")))
534 (uri (string-append "https://github.com/magnumripper/"
535 "JohnTheRipper/commit/"
536 "480e95b0e449863be3e1a5b0bc634a67df28b618.patch"))
537 (file-name "john-the-ripper-jumbo-non-x86.patch")
540 "1ffd9dvhk0sb6ss8dv5yalh01lz30i7rilqilf2xv68gax2hyjqx")))))))
541 (build-system gnu-build-system)
553 "-DJOHN_SYSTEMWIDE=1 "
554 "-DJOHN_SYSTEMWIDE_EXEC='\"" %output "/libexec/john\"' "
555 "-DJOHN_SYSTEMWIDE_HOME='\"" %output "/share/john\"'")
556 ;; For now, do not test for instruction set in configure, and
557 ;; do not pass '-march=native' to gcc:
558 "--disable-native-tests"
559 "--disable-native-macro")
560 #:tests? #f ;tests try to create '.john' in the build user's $HOME
562 (modify-phases %standard-phases
563 (add-before 'configure 'chdir-src
564 (lambda _ (chdir "src")))
567 (let ((bindir (string-append %output "/bin"))
568 (docdir (string-append %output "/share/doc/john"))
569 (execdir (string-append %output "/libexec/john"))
570 (homedir (string-append %output "/share/john"))
571 (install-file-to (lambda (dir)
572 (lambda (f) (install-file f dir))))
573 (symlink? (lambda (_ s) (eq? (stat:type s) 'symlink))))
574 (with-directory-excursion "../run"
575 (for-each (install-file-to execdir)
576 (cons* "mailer" "benchmark-unify"
577 (find-files "." ".*\\.(py|rb|pl)")))
578 (for-each (install-file-to homedir)
579 (append (find-files "." "(stats|dictionary.*)")
580 (find-files "." "(.*\\.chr|.*\\.lst)")
581 (find-files "." ".*\\.conf")))
582 (for-each (install-file-to bindir)
583 '("tgtsnarf" "genmkvpwd" "mkvcalcproba"
584 "raw2dyna" "luks2john" "vncpcap2john"
585 "uaf2john" "calc_stat" "wpapcap2john"
586 "cprepair" "relbench" "SIPdump" "john"))
587 (for-each (lambda (f) ;install symlinked aliases
589 (string-append bindir "/" (basename f))))
590 (find-files "." symlink?)))
591 (copy-recursively "../doc" docdir)
593 (home-page "http://www.openwall.com/john/")
594 (synopsis "Password cracker")
595 (description "John the Ripper is a fast password cracker. Its primary
596 purpose is to detect weak Unix passwords. Besides several @code{crypt}
597 password hash types most commonly found on various Unix systems, supported out
598 of the box are Windows LM hashes, plus lots of other hashes and ciphers. This
599 is the community-enhanced, \"jumbo\" version of John the Ripper.")
600 (license license:gpl2+))))