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>
16 ;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
17 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
19 ;;; This file is part of GNU Guix.
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34 (define-module (gnu packages password-utils)
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module (guix build-system cmake)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix download)
39 #:use-module (guix packages)
40 #:use-module (gnu packages)
41 #:use-module (gnu packages admin)
42 #:use-module (gnu packages aidc)
43 #:use-module (gnu packages base)
44 #:use-module (gnu packages check)
45 #:use-module (gnu packages compression)
46 #:use-module (gnu packages freedesktop)
47 #:use-module (gnu packages glib)
48 #:use-module (gnu packages gnupg)
49 #:use-module (gnu packages gnuzilla)
50 #:use-module (gnu packages gtk)
51 #:use-module (gnu packages guile)
52 #:use-module (gnu packages kerberos)
53 #:use-module (gnu packages libffi)
54 #:use-module (gnu packages linux)
55 #:use-module (gnu packages man)
56 #:use-module (gnu packages multiprecision)
57 #:use-module (gnu packages ncurses)
58 #:use-module (gnu packages pkg-config)
59 #:use-module (gnu packages python)
60 #:use-module (gnu packages suckless)
61 #:use-module (gnu packages tls)
62 #:use-module (gnu packages qt)
63 #:use-module (gnu packages version-control)
64 #:use-module (gnu packages xdisorg)
65 #:use-module (gnu packages xorg)
66 #:use-module (guix build-system python))
75 (uri (string-append "mirror://sourceforge/pwgen/pwgen/" version
76 "/pwgen-" version ".tar.gz"))
78 (base32 "0mhmw700kkh238fzivcwnwi94bj9f3h36yfh3k3j2v19b0zmjx7b"))))
79 (build-system gnu-build-system)
81 `(#:tests? #f)) ; no test suite
82 (home-page "http://pwgen.sourceforge.net/")
83 (synopsis "Password generator")
84 (description "Pwgen generates passwords which can be easily memorized by a
86 (license license:gpl2)))
88 (define-public keepassxc
95 (uri (string-append "https://github.com/keepassxreboot/" name
96 "/releases/download/" version "/keepassxc-"
97 version "-src.tar.xz"))
100 "1pfkq1m5vb90kx67vyw70s1hc4ivjsvq2535vm6wdwwsncna6bz5"))))
101 (build-system cmake-build-system)
104 (list (string-append "-DCMAKE_INSTALL_LIBDIR="
105 (assoc-ref %outputs "out") "/lib"))))
107 `(("libgcrypt" ,libgcrypt)
111 ("qtx11extras" ,qtx11extras)
114 `(("qttools" ,qttools)))
115 (home-page "https://www.keepassxc.org")
116 (synopsis "Password manager")
117 (description "KeePassXC is a password manager or safe which helps you to
118 manage your passwords in a secure way. You can put all your passwords in one
119 database, which is locked with one master key or a key-file which can be stored
120 on an external storage device. The databases are encrypted using the
121 algorithms AES or Twofish.")
122 ;; Non functional parts use various licences.
123 (license license:gpl3)))
125 (define-public keepassx
132 (uri (string-append "https://www.keepassx.org/releases/" version
133 "/keepassx-" version ".tar.gz"))
136 "1ia7cqx9ias38mnffsl7da7g1f66bcbjsi23k49sln0c6spb9zr3"))))
137 (build-system cmake-build-system)
139 `(("libgcrypt" ,libgcrypt)
145 (home-page "https://www.keepassx.org")
146 (synopsis "Password manager")
147 (description "KeePassX is a password manager or safe which helps you to
148 manage your passwords in a secure way. You can put all your passwords in one
149 database, which is locked with one master key or a key-file which can be stored
150 on an external storage device. The databases are encrypted using the
151 algorithms AES or Twofish.")
152 ;; Non functional parts use various licences.
153 (license license:gpl3)
154 (properties `((superseded . ,keepassxc)))))
156 (define-public shroud
162 (uri (string-append "https://files.dthompson.us/shroud/shroud-"
166 "1y43yhgy2zbrk5bqj3qyx9rkcz2bma9sinlrg7dip3jqms9gq4lr"))))
167 (build-system gnu-build-system)
170 (modify-phases %standard-phases
171 (add-after 'install 'wrap-shroud
172 (lambda* (#:key outputs #:allow-other-keys)
173 (let* ((out (assoc-ref outputs "out"))
174 (ccachedir (string-append out "/lib/guile/2.0/ccache"))
175 (prog (string-append out "/bin/shroud")))
177 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,ccachedir)))
180 `(("guile" ,guile-2.0)
183 (synopsis "GnuPG-based secret manager")
184 (description "Shroud is a simple secret manager with a command line
185 interface. The password database is stored as a Scheme s-expression and
186 encrypted with a GnuPG key. Secrets consist of an arbitrary number of
187 key/value pairs, making Shroud suitable for more than just password storage.
188 For copying and pasting secrets into web browsers and other graphical
189 applications, there is xclip integration." )
190 (home-page "https://dthompson.us/projects/shroud.html")
191 (license license:gpl3+)))
199 (uri (string-append "http://www.guengel.ch/myapps/yapet/downloads/yapet-"
204 "0ydbnqw6icdh07pnv2w6dhvq501bdfvrklv4xmyr8znca9d753if"))))
205 (build-system gnu-build-system)
207 `(("ncurses" ,ncurses)
208 ("openssl" ,openssl)))
210 `(("pkg-config" ,pkg-config)))
211 (synopsis "Yet Another Password Encryption Tool")
212 (description "YAPET is a text based password manager using the Blowfish
213 encryption algorithm. Because of its small footprint and very few library
214 dependencies, it is suited for installing on desktop and server systems alike.
215 The text based user interface allows you to run YAPET easily in a Secure Shell
216 session. Two companion utilities enable users to convert CSV files to YAPET
218 (home-page "http://www.guengel.ch/myapps/yapet/")
219 (license license:gpl3+)))
221 (define-public cracklib
227 (uri (string-append "https://github.com/cracklib/cracklib/"
228 "releases/download/" name "-" version "/"
229 name "-" version ".tar.gz"))
230 (patches (search-patches "cracklib-CVE-2016-6318.patch"
231 "cracklib-fix-buffer-overflow.patch"))
234 "0hrkb0prf7n92w6rxgq0ilzkk6rkhpys2cfqkrbzswp27na7dkqp"))))
235 (build-system gnu-build-system)
236 (synopsis "Password checking library")
237 (home-page "https://github.com/cracklib/cracklib")
239 "CrackLib is a library containing a C function which may be used in a
240 @command{passwd}-like program. The idea is simple: try to prevent users from
241 choosing passwords that could easily be guessed (or \"cracked\") by filtering
242 them out, at the source.")
243 (license license:lgpl2.1)))
245 (define-public libpwquality
247 (name "libpwquality")
252 (string-append "https://github.com/" name "/" name
253 "/releases/download/" name "-" version
254 "/" name "-" version ".tar.bz2")
255 (string-append "https://launchpad.net/libpwquality/trunk/"
256 version "/+download/"
257 name "-" version ".tar.bz2")))
260 "0syyz8r54l8mqmbb0mw19qz4z2cx8gdgidicb8k2s5zjdh2gzrhx"))))
261 (build-system gnu-build-system)
263 ;; XXX: have RUNPATH issue.
264 '(#:configure-flags '("--disable-python-bindings")))
266 `(("cracklib" ,cracklib)))
267 (synopsis "Password quality checker")
268 (home-page "https://github.com/libpwquality/libpwquality")
270 "Libpwquality is a library for password quality checking and generation of
271 random passwords that pass the checks.")
272 (license license:gpl2+)))
274 (define-public assword
282 "http://http.debian.net/debian/pool/main/a/assword/"
283 "assword_" version ".orig.tar.gz")))
286 "0l6170y6my1gprqkazvzabgjkrkr9v2q7z48vjflna4r323yqira"))))
288 `(;; irritatingly, tests do run but not there are two problems:
289 ;; - "import gtk" fails for unknown reasons here despite it the
290 ;; program working (indeed, I've found I have to do a logout and log
291 ;; back in in after an install order for some mumbo jumbo environment
292 ;; variable mess to work with pygtk and assword... what's up with
294 ;; - even when the tests fail, they don't return a nonzero status,
295 ;; so I'm not sure how to programmatically get that information
298 (modify-phases %standard-phases
299 (add-after 'install 'wrap-assword
300 (lambda* (#:key outputs #:allow-other-keys)
301 (let ((prog (string-append
302 (assoc-ref outputs "out")
304 (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
306 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))
308 (add-after 'install 'manpage
309 (lambda* (#:key outputs #:allow-other-keys)
311 ;; Without this substitution, it fails with
312 ;; ImportError: No module named 'gpg'
313 (substitute* "Makefile"
314 (("PYTHONPATH=.") ""))
315 (zero? (system* "make" "assword.1"))
318 (string-append (assoc-ref outputs "out") "/share/man/man1"))))))))
319 (build-system python-build-system)
321 `(("txt2man" ,txt2man)))
324 ("python-xdo" ,python-xdo)
325 ("python-gpg" ,python-gpg)
326 ("python-pygobject" ,python-pygobject)))
329 (home-page "https://finestructure.net/assword/")
330 (synopsis "Password manager")
331 (description "assword is a simple password manager using GPG-wrapped
332 JSON files. It has a command line interface as well as a very simple
333 graphical interface, which can even \"type\" your passwords into
335 (license license:gpl3+)))
337 (define-public password-store
339 (name "password-store")
344 (string-append "https://git.zx2c4.com/password-store/snapshot/"
345 name "-" version ".tar.xz"))
348 "0scqkpll2q8jhzcgcsh9kqz0gwdpvynivqjmmbzax2irjfaiklpn"))))
349 (build-system gnu-build-system)
352 (modify-phases %standard-phases
355 (add-before 'install 'patch-passmenu-path
356 (lambda* (#:key inputs #:allow-other-keys)
357 (substitute* "contrib/dmenu/passmenu"
358 (("dmenu") (string-append (assoc-ref inputs "dmenu")
360 (("xdotool") (string-append (assoc-ref inputs "xdotool")
363 (add-after 'install 'install-passmenu
364 (lambda* (#:key outputs #:allow-other-keys)
365 (let ((out (assoc-ref outputs "out")))
366 (copy-file "contrib/dmenu/passmenu"
367 (string-append out "/bin/passmenu"))
369 (add-after 'install 'wrap-path
370 (lambda* (#:key inputs outputs #:allow-other-keys)
371 (let ((out (assoc-ref outputs "out"))
372 (path (map (lambda (pkg)
373 (string-append (assoc-ref inputs pkg) "/bin"))
374 '("coreutils" "getopt" "git" "gnupg" "qrencode"
375 "sed" "tree" "which" "xclip"))))
376 (wrap-program (string-append out "/bin/pass")
377 `("PATH" ":" prefix (,(string-join path ":"))))
379 (add-after 'wrap-path 'install-shell-completions
380 (lambda* (#:key outputs #:allow-other-keys)
381 (let* ((out (assoc-ref outputs "out"))
382 (bashcomp (string-append out "/etc/bash_completion.d")))
383 ;; TODO: install fish and zsh completions.
385 (copy-file "src/completion/pass.bash-completion"
386 (string-append bashcomp "/pass"))
388 #:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
389 ;; Parallel tests may cause a race condition leading to a
390 ;; timeout in some circumstances.
392 #:test-target "test"))
395 ("getopt" ,util-linux)
398 ("qrencode" ,qrencode)
403 ("xdotool" ,xdotool)))
404 (home-page "http://www.passwordstore.org/")
405 (synopsis "Encrypted password manager")
406 (description "Password-store is a password manager which uses GnuPG to
407 store and retrieve passwords. The tool stores each password in its own
408 GnuPG-encrypted file, allowing the program to be simple yet secure.
409 Synchronization is possible using the integrated git support, which commits
410 changes to your password database to a git repository that can be managed
411 through the pass command.")
412 (license license:gpl2+)))
414 (define-public argon2
422 (string-append "https://github.com/P-H-C/phc-winner-argon2/archive/"
424 (file-name (string-append name "-" version ".tar.gz"))
427 "1rymikbysasdadm325jx69i0q19d9srqkny69jwmhswlidr4j07y"))))
428 (build-system gnu-build-system)
430 `(#:test-target "test"
431 #:make-flags '("CC=gcc")
433 (modify-phases %standard-phases
437 (let ((out (assoc-ref %outputs "out")))
438 (install-file "argon2" (string-append out "/bin"))
439 (install-file "libargon2.a" (string-append out "/lib"))
440 (install-file "libargon2.so" (string-append out "/lib"))
441 (copy-recursively "include"
442 (string-append out "/include"))))))))
443 (home-page "https://www.argon2.com/")
444 (synopsis "Password hashing library")
445 (description "Argon2 provides a key derivation function that was declared
446 winner of the 2015 Password Hashing Competition.")
447 (license license:cc0)))
449 (define-public python-bcrypt
451 (name "python-bcrypt")
456 (uri (pypi-uri "bcrypt" version))
459 "1giy0dvd8gvq6flxh44np1v2nqwsji5qsnrz038mgwzgp7c20j75"))))
460 (build-system python-build-system)
462 `(("python-pycparser" ,python-pycparser)
463 ("python-pytest" ,python-pytest)))
465 `(("python-cffi" ,python-cffi)
466 ("python-six" ,python-six)))
467 (home-page "https://github.com/pyca/bcrypt/")
469 "Modern password hashing library")
471 "Bcrypt is a Python module which provides a password hashing method based
472 on the Blowfish password hashing algorithm, as described in
473 @url{http://static.usenix.org/events/usenix99/provos.html,\"A Future-Adaptable
474 Password Scheme\"} by Niels Provos and David Mazieres.")
475 (license license:asl2.0)))
477 (define-public python2-bcrypt
478 (package-with-python2 python-bcrypt))
480 (define-public pass-git-helper
482 (name "pass-git-helper")
487 (uri (string-append "https://github.com/languitar/pass-git-helper/archive/release-"
491 "0lz5ncy44pz7z1j2nnyildx8sq33zi3xvg5nkwg25n11nasqh2xn"))))
492 (build-system python-build-system)
495 (modify-phases %standard-phases
496 (add-before 'build 'patch-pass-path
497 (lambda* (#:key inputs #:allow-other-keys)
498 (let* ((password-store (assoc-ref inputs "password-store"))
499 (pass (string-append password-store "/bin/pass")))
500 (substitute* "pass-git-helper"
501 (("'pass'") (string-append "'" pass "'")))
504 `(("python-pyxdg" ,python-pyxdg)
505 ("password-store" ,password-store)))
506 (home-page "https://github.com/languitar/pass-git-helper")
507 (synopsis "Git credential helper interfacing with pass")
508 (description "pass-git-helper is a git credential helper which allows to
509 use pass, the standard unix password manager, as the credential backend for
510 your git repositories. This is achieved by explicitly defining mappings
511 between hosts and entries in the password store.")
512 (license license:lgpl3+)))
514 (define-public john-the-ripper-jumbo
515 (let ((official-version "1.8.0")
518 (name "john-the-ripper-jumbo")
519 (version (string-append official-version "-" jumbo-version))
523 (uri (string-append "http://www.openwall.com/john/j/john-"
524 official-version "-jumbo-" jumbo-version ".tar.xz"))
527 "08q92sfdvkz47rx6qjn7qv57cmlpy7i7rgddapq5384mb413vjds"))
531 (uri (string-append "https://github.com/magnumripper/"
532 "JohnTheRipper/commit/"
533 "e2e868db3e153b3f959e119a51703d4afb99c624.patch"))
534 (file-name "john-the-ripper-jumbo-gcc5-inline.patch")
537 "1shvcf1y2097115mxhzdkm64dr106a8zr6pqjqyh171q5ng5vfra")))
540 (uri (string-append "https://github.com/magnumripper/"
541 "JohnTheRipper/commit/"
542 "480e95b0e449863be3e1a5b0bc634a67df28b618.patch"))
543 (file-name "john-the-ripper-jumbo-non-x86.patch")
546 "1ffd9dvhk0sb6ss8dv5yalh01lz30i7rilqilf2xv68gax2hyjqx")))))))
547 (build-system gnu-build-system)
559 "-DJOHN_SYSTEMWIDE=1 "
560 "-DJOHN_SYSTEMWIDE_EXEC='\"" %output "/libexec/john\"' "
561 "-DJOHN_SYSTEMWIDE_HOME='\"" %output "/share/john\"'")
562 ;; For now, do not test for instruction set in configure, and
563 ;; do not pass '-march=native' to gcc:
564 "--disable-native-tests"
565 "--disable-native-macro")
566 #:tests? #f ;tests try to create '.john' in the build user's $HOME
568 (modify-phases %standard-phases
569 (add-before 'configure 'chdir-src
570 (lambda _ (chdir "src")))
573 (let ((bindir (string-append %output "/bin"))
574 (docdir (string-append %output "/share/doc/john"))
575 (execdir (string-append %output "/libexec/john"))
576 (homedir (string-append %output "/share/john"))
577 (install-file-to (lambda (dir)
578 (lambda (f) (install-file f dir))))
579 (symlink? (lambda (_ s) (eq? (stat:type s) 'symlink))))
580 (with-directory-excursion "../run"
581 (for-each (install-file-to execdir)
582 (cons* "mailer" "benchmark-unify"
583 (find-files "." ".*\\.(py|rb|pl)")))
584 (for-each (install-file-to homedir)
585 (append (find-files "." "(stats|dictionary.*)")
586 (find-files "." "(.*\\.chr|.*\\.lst)")
587 (find-files "." ".*\\.conf")))
588 (for-each (install-file-to bindir)
589 '("tgtsnarf" "genmkvpwd" "mkvcalcproba"
590 "raw2dyna" "luks2john" "vncpcap2john"
591 "uaf2john" "calc_stat" "wpapcap2john"
592 "cprepair" "relbench" "SIPdump" "john"))
593 (for-each (lambda (f) ;install symlinked aliases
595 (string-append bindir "/" (basename f))))
596 (find-files "." symlink?)))
597 (copy-recursively "../doc" docdir)
599 (home-page "http://www.openwall.com/john/")
600 (synopsis "Password cracker")
601 (description "John the Ripper is a fast password cracker. Its primary
602 purpose is to detect weak Unix passwords. Besides several @code{crypt}
603 password hash types most commonly found on various Unix systems, supported out
604 of the box are Windows LM hashes, plus lots of other hashes and ciphers. This
605 is the community-enhanced, \"jumbo\" version of John the Ripper.")
606 (license license:gpl2+))))