Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / password-utils.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Steve Sprang <scs@stevesprang.com>
3 ;;; Copyright © 2015, 2016 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 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
19 ;;;
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28 (define-module (gnu packages password-utils)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix build-system cmake)
31 #:use-module (guix build-system gnu)
32 #:use-module (guix download)
33 #:use-module (guix packages)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages admin)
36 #:use-module (gnu packages aidc)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages compression)
39 #:use-module (gnu packages glib)
40 #:use-module (gnu packages gnupg)
41 #:use-module (gnu packages gtk)
42 #:use-module (gnu packages guile)
43 #:use-module (gnu packages linux)
44 #:use-module (gnu packages man)
45 #:use-module (gnu packages ncurses)
46 #:use-module (gnu packages pkg-config)
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages tls)
49 #:use-module (gnu packages qt)
50 #:use-module (gnu packages version-control)
51 #:use-module (gnu packages xdisorg)
52 #:use-module (gnu packages xorg)
53 #:use-module (guix build-system python))
54
55 (define-public pwgen
56 (package
57 (name "pwgen")
58 (version "2.07")
59 (source
60 (origin
61 (method url-fetch)
62 (uri (string-append "mirror://sourceforge/pwgen/pwgen/" version
63 "/pwgen-" version ".tar.gz"))
64 (sha256
65 (base32 "0mhmw700kkh238fzivcwnwi94bj9f3h36yfh3k3j2v19b0zmjx7b"))))
66 (build-system gnu-build-system)
67 (arguments
68 `(#:tests? #f)) ; no test suite
69 (home-page "http://pwgen.sourceforge.net/")
70 (synopsis "Password generator")
71 (description "Pwgen generates passwords which can be easily memorized by a
72 human.")
73 (license license:gpl2)))
74
75 (define-public keepassx
76 (package
77 (name "keepassx")
78 (version "2.0.3")
79 (source
80 (origin
81 (method url-fetch)
82 (uri (string-append "https://www.keepassx.org/releases/" version
83 "/keepassx-" version ".tar.gz"))
84 (sha256
85 (base32
86 "1ia7cqx9ias38mnffsl7da7g1f66bcbjsi23k49sln0c6spb9zr3"))))
87 (build-system cmake-build-system)
88 (inputs
89 `(("libgcrypt" ,libgcrypt)
90 ("libxi" ,libxi)
91 ("libxtst" ,libxtst)
92 ("qt" ,qt-4)))
93 (native-inputs
94 `(("zlib" ,zlib)))
95 (home-page "https://www.keepassx.org")
96 (synopsis "Password manager")
97 (description "KeePassX is a password manager or safe which helps you to
98 manage your passwords in a secure way. You can put all your passwords in one
99 database, which is locked with one master key or a key-file which can be stored
100 on an external storage device. The databases are encrypted using the
101 algorithms AES or Twofish.")
102 ;; Non functional parts use various licences.
103 (license license:gpl3)))
104
105 (define-public shroud
106 (package
107 (name "shroud")
108 (version "0.1.1")
109 (source (origin
110 (method url-fetch)
111 (uri (string-append "https://files.dthompson.us/shroud/shroud-"
112 version ".tar.gz"))
113 (sha256
114 (base32
115 "1y43yhgy2zbrk5bqj3qyx9rkcz2bma9sinlrg7dip3jqms9gq4lr"))))
116 (build-system gnu-build-system)
117 (arguments
118 '(#:phases
119 (modify-phases %standard-phases
120 (add-after 'install 'wrap-shroud
121 (lambda* (#:key outputs #:allow-other-keys)
122 (let* ((out (assoc-ref outputs "out"))
123 (ccachedir (string-append out "/lib/guile/2.0/ccache"))
124 (prog (string-append out "/bin/shroud")))
125 (wrap-program prog
126 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,ccachedir)))
127 #t))))))
128 (inputs
129 `(("guile" ,guile-2.0)
130 ("gnupg" ,gnupg)
131 ("xclip" ,xclip)))
132 (synopsis "GnuPG-based secret manager")
133 (description "Shroud is a simple secret manager with a command line
134 interface. The password database is stored as a Scheme s-expression and
135 encrypted with a GnuPG key. Secrets consist of an arbitrary number of
136 key/value pairs, making Shroud suitable for more than just password storage.
137 For copying and pasting secrets into web browsers and other graphical
138 applications, there is xclip integration." )
139 (home-page "https://dthompson.us/projects/shroud.html")
140 (license license:gpl3+)))
141
142 (define-public yapet
143 (package
144 (name "yapet")
145 (version "1.0")
146 (source (origin
147 (method url-fetch)
148 (uri (string-append "http://www.guengel.ch/myapps/yapet/downloads/yapet-"
149 version
150 ".tar.bz2"))
151 (sha256
152 (base32
153 "0ydbnqw6icdh07pnv2w6dhvq501bdfvrklv4xmyr8znca9d753if"))))
154 (build-system gnu-build-system)
155 (inputs
156 `(("ncurses" ,ncurses)
157 ("openssl" ,openssl)))
158 (native-inputs
159 `(("pkg-config" ,pkg-config)))
160 (synopsis "Yet Another Password Encryption Tool")
161 (description "YAPET is a text based password manager using the Blowfish
162 encryption algorithm. Because of its small footprint and very few library
163 dependencies, it is suited for installing on desktop and server systems alike.
164 The text based user interface allows you to run YAPET easily in a Secure Shell
165 session. Two companion utilities enable users to convert CSV files to YAPET
166 and vice versa.")
167 (home-page "http://www.guengel.ch/myapps/yapet/")
168 (license license:gpl3+)))
169
170 (define-public cracklib
171 (package
172 (name "cracklib")
173 (version "2.9.6")
174 (source (origin
175 (method url-fetch)
176 (uri (string-append "https://github.com/cracklib/cracklib/"
177 "releases/download/" name "-" version "/"
178 name "-" version ".tar.gz"))
179 (patches (search-patches "cracklib-CVE-2016-6318.patch"
180 "cracklib-fix-buffer-overflow.patch"))
181 (sha256
182 (base32
183 "0hrkb0prf7n92w6rxgq0ilzkk6rkhpys2cfqkrbzswp27na7dkqp"))))
184 (build-system gnu-build-system)
185 (synopsis "Password checking library")
186 (home-page "https://github.com/cracklib/cracklib")
187 (description
188 "CrackLib is a library containing a C function which may be used in a
189 passwd like program. The idea is simple: try to prevent users from choosing
190 passwords that could be guessed by crack by filtering them out, at source.")
191 (license license:lgpl2.1)))
192
193 (define-public libpwquality
194 (package
195 (name "libpwquality")
196 (version "1.3.0")
197 (source (origin
198 (method url-fetch)
199 (uri (list
200 (string-append "https://fedorahosted.org/releases/l/i/"
201 name "/" name "-" version ".tar.bz2")
202 (string-append "https://launchpad.net/libpwquality/trunk/"
203 version "/+download/"
204 name "-" version ".tar.bz2")))
205 (sha256
206 (base32
207 "0aidriag6h0syfm33nzdfdsqgrnsgihwjv3a5lgkqch3w68fmlkl"))))
208 (build-system gnu-build-system)
209 (arguments
210 ;; XXX: have RUNPATH issue.
211 '(#:configure-flags '("--disable-python-bindings")))
212 (inputs
213 `(("cracklib" ,cracklib)))
214 (synopsis "Password quality checker")
215 (home-page "https://fedorahosted.org/libpwquality/")
216 (description
217 "Libpwquality is a library for password quality checking and generation of
218 random passwords that pass the checks.")
219 (license license:gpl2+)))
220
221 (define-public assword
222 (package
223 (name "assword")
224 (version "0.10")
225 (source (origin
226 (method url-fetch)
227 (uri (list
228 (string-append
229 "http://http.debian.net/debian/pool/main/a/assword/"
230 "assword_" version ".orig.tar.gz")))
231 (sha256
232 (base32
233 "0l6170y6my1gprqkazvzabgjkrkr9v2q7z48vjflna4r323yqira"))))
234 (arguments
235 `(;; irritatingly, tests do run but not there are two problems:
236 ;; - "import gtk" fails for unknown reasons here despite it the
237 ;; program working (indeed, I've found I have to do a logout and log
238 ;; back in in after an install order for some mumbo jumbo environment
239 ;; variable mess to work with pygtk and assword... what's up with
240 ;; that?)
241 ;; - even when the tests fail, they don't return a nonzero status,
242 ;; so I'm not sure how to programmatically get that information
243 #:tests? #f
244 #:phases
245 (modify-phases %standard-phases
246 (add-after 'install 'wrap-assword
247 (lambda* (#:key outputs #:allow-other-keys)
248 (let ((prog (string-append
249 (assoc-ref outputs "out")
250 "/bin/assword"))
251 (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
252 (wrap-program prog
253 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))
254 #t)))
255 (add-after 'install 'manpage
256 (lambda* (#:key outputs #:allow-other-keys)
257 (and
258 ;; Without this substitution, it fails with
259 ;; ImportError: No module named 'gpg'
260 (substitute* "Makefile"
261 (("PYTHONPATH=.") ""))
262 (zero? (system* "make" "assword.1"))
263 (install-file
264 "assword.1"
265 (string-append (assoc-ref outputs "out") "/share/man/man1"))))))))
266 (build-system python-build-system)
267 (native-inputs
268 `(("txt2man" ,txt2man)))
269 (inputs
270 `(("gtk+" ,gtk+)
271 ("python-xdo" ,python-xdo)
272 ("python-gpg" ,python-gpg)
273 ("python-pygobject" ,python-pygobject)))
274 (propagated-inputs
275 `(("xclip" ,xclip)))
276 (home-page "https://finestructure.net/assword/")
277 (synopsis "Password manager")
278 (description "assword is a simple password manager using GPG-wrapped
279 JSON files. It has a command line interface as well as a very simple
280 graphical interface, which can even \"type\" your passwords into
281 any X11 window.")
282 (license license:gpl3+)))
283
284 (define-public password-store
285 (package
286 (name "password-store")
287 (version "1.7")
288 (source (origin
289 (method url-fetch)
290 (uri
291 (string-append "https://git.zx2c4.com/password-store/snapshot/"
292 name "-" version ".tar.xz"))
293 (sha256
294 (base32
295 "002mw7j0m33bw483rllzhcf41wp3ixka8yma6kqrfaj57jyw66hn"))
296 (patches (search-patches "password-store-gnupg-compat.patch"))))
297 (build-system gnu-build-system)
298 (arguments
299 '(#:phases
300 (modify-phases %standard-phases
301 (delete 'configure)
302 (delete 'build)
303 (add-after 'install 'wrap-path
304 (lambda* (#:key inputs outputs #:allow-other-keys)
305 (let ((out (assoc-ref outputs "out"))
306 (path (map (lambda (pkg)
307 (string-append (assoc-ref inputs pkg) "/bin"))
308 '("coreutils" "getopt" "git" "gnupg" "qrencode"
309 "sed" "tree" "which" "xclip"))))
310 (wrap-program (string-append out "/bin/pass")
311 `("PATH" ":" prefix (,(string-join path ":"))))
312 #t)))
313 (add-after 'wrap-path 'install-shell-completions
314 (lambda* (#:key outputs #:allow-other-keys)
315 (let* ((out (assoc-ref outputs "out"))
316 (bashcomp (string-append out "/etc/bash_completion.d")))
317 ;; TODO: install fish and zsh completions.
318 (mkdir-p bashcomp)
319 (copy-file "src/completion/pass.bash-completion"
320 (string-append bashcomp "/pass"))
321 #t))))
322 #:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
323 ;; Parallel tests may cause a race condition leading to a
324 ;; timeout in some circumstances.
325 #:parallel-tests? #f
326 #:test-target "test"))
327 (inputs
328 `(("getopt" ,util-linux)
329 ("git" ,git)
330 ("gnupg" ,gnupg)
331 ("qrencode" ,qrencode)
332 ("sed" ,sed)
333 ("tree" ,tree)
334 ("which" ,which)
335 ("xclip" ,xclip)))
336 (home-page "http://www.passwordstore.org/")
337 (synopsis "Encrypted password manager")
338 (description "Password-store is a password manager which uses GnuPG to
339 store and retrieve passwords. The tool stores each password in its own
340 GnuPG-encrypted file, allowing the program to be simple yet secure.
341 Synchronization is possible using the integrated git support, which commits
342 changes to your password database to a git repository that can be managed
343 through the pass command.")
344 (license license:gpl2+)))
345
346 (define-public argon2
347 (package
348 (name "argon2")
349 (version "20161029")
350 (source
351 (origin
352 (method url-fetch)
353 (uri
354 (string-append "https://github.com/P-H-C/phc-winner-argon2/archive/"
355 version ".tar.gz"))
356 (file-name (string-append name "-" version ".tar.gz"))
357 (sha256
358 (base32
359 "1rymikbysasdadm325jx69i0q19d9srqkny69jwmhswlidr4j07y"))))
360 (build-system gnu-build-system)
361 (arguments
362 `(#:test-target "test"
363 #:make-flags '("CC=gcc")
364 #:phases
365 (modify-phases %standard-phases
366 (delete 'configure)
367 (replace 'install
368 (lambda _
369 (let ((out (assoc-ref %outputs "out")))
370 (install-file "argon2" (string-append out "/bin"))
371 (install-file "libargon2.a" (string-append out "/lib"))
372 (install-file "libargon2.so" (string-append out "/lib"))
373 (copy-recursively "include"
374 (string-append out "/include"))))))))
375 (home-page "https://www.argon2.com/")
376 (synopsis "Password hashing library")
377 (description "Argon2 provides a key derivation function that was declared
378 winner of the 2015 Password Hashing Competition.")
379 (license license:cc0)))
380
381 (define-public python-bcrypt
382 (package
383 (name "python-bcrypt")
384 (version "3.1.0")
385 (source
386 (origin
387 (method url-fetch)
388 (uri (pypi-uri "bcrypt" version))
389 (sha256
390 (base32
391 "1giy0dvd8gvq6flxh44np1v2nqwsji5qsnrz038mgwzgp7c20j75"))))
392 (build-system python-build-system)
393 (native-inputs
394 `(("python-pycparser" ,python-pycparser)
395 ("python-pytest" ,python-pytest)))
396 (propagated-inputs
397 `(("python-cffi" ,python-cffi)
398 ("python-six" ,python-six)))
399 (home-page "https://github.com/pyca/bcrypt/")
400 (synopsis
401 "Modern password hashing library")
402 (description
403 "Bcrypt is a Python module which provides a password hashing method based
404 on the Blowfish password hashing algorithm, as described in
405 @url{http://static.usenix.org/events/usenix99/provos.html,\"A Future-Adaptable
406 Password Scheme\"} by Niels Provos and David Mazieres.")
407 (license license:asl2.0)))
408
409 (define-public python2-bcrypt
410 (package-with-python2 python-bcrypt))