password-utils.scm 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2015 Steve Sprang <scs@stevesprang.com>
  3. ;;; Copyright © 2015, 2016, 2017, 2018 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, 2018 Clément Lassieur <clement@lassieur.org>
  12. ;;; Copyright © 2017, 2018 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>
  18. ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
  19. ;;; Copyright © 2018 Konrad Hinsen <konrad.hinsen@fastmail.net>
  20. ;;; Copyright © 2018 Thomas Sigurdsen <tonton@riseup.net>
  21. ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
  22. ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
  23. ;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
  24. ;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
  25. ;;;
  26. ;;; This file is part of GNU Guix.
  27. ;;;
  28. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  29. ;;; under the terms of the GNU General Public License as published by
  30. ;;; the Free Software Foundation; either version 3 of the License, or (at
  31. ;;; your option) any later version.
  32. ;;;
  33. ;;; GNU Guix is distributed in the hope that it will be useful, but
  34. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  35. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  36. ;;; GNU General Public License for more details.
  37. ;;;
  38. ;;; You should have received a copy of the GNU General Public License
  39. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  40. (define-module (gnu packages password-utils)
  41. #:use-module ((guix licenses) #:prefix license:)
  42. #:use-module (guix build-system cmake)
  43. #:use-module (guix build-system gnu)
  44. #:use-module (guix download)
  45. #:use-module (guix git-download)
  46. #:use-module (guix packages)
  47. #:use-module (gnu packages)
  48. #:use-module (gnu packages admin)
  49. #:use-module (gnu packages aidc)
  50. #:use-module (gnu packages base)
  51. #:use-module (gnu packages check)
  52. #:use-module (gnu packages compression)
  53. #:use-module (gnu packages crypto)
  54. #:use-module (gnu packages curl)
  55. #:use-module (gnu packages file)
  56. #:use-module (gnu packages freedesktop)
  57. #:use-module (gnu packages gettext)
  58. #:use-module (gnu packages glib)
  59. #:use-module (gnu packages gnupg)
  60. #:use-module (gnu packages gnuzilla)
  61. #:use-module (gnu packages gtk)
  62. #:use-module (gnu packages guile)
  63. #:use-module (gnu packages kerberos)
  64. #:use-module (gnu packages libffi)
  65. #:use-module (gnu packages linux)
  66. #:use-module (gnu packages man)
  67. #:use-module (gnu packages multiprecision)
  68. #:use-module (gnu packages ncurses)
  69. #:use-module (gnu packages opencl)
  70. #:use-module (gnu packages perl)
  71. #:use-module (gnu packages pkg-config)
  72. #:use-module (gnu packages python)
  73. #:use-module (gnu packages python-web)
  74. #:use-module (gnu packages python-xyz)
  75. #:use-module (gnu packages suckless)
  76. #:use-module (gnu packages tls)
  77. #:use-module (gnu packages qt)
  78. #:use-module (gnu packages version-control)
  79. #:use-module (gnu packages wxwidgets)
  80. #:use-module (gnu packages xdisorg)
  81. #:use-module (gnu packages xorg)
  82. #:use-module (gnu packages xml)
  83. #:use-module (guix build-system python))
  84. (define-public pwgen
  85. (package
  86. (name "pwgen")
  87. (version "2.08")
  88. (source
  89. (origin
  90. (method url-fetch)
  91. (uri (string-append "mirror://sourceforge/pwgen/pwgen/" version
  92. "/pwgen-" version ".tar.gz"))
  93. (sha256
  94. (base32 "0yy90pqrr2pszzhb5hxjishq9qc7dqd290amiibqx9fm1b9kvc6s"))))
  95. (build-system gnu-build-system)
  96. (arguments
  97. `(#:tests? #f)) ; no test suite
  98. (home-page "http://pwgen.sourceforge.net/")
  99. (synopsis "Password generator")
  100. (description "Pwgen generates passwords which can be easily memorized by a
  101. human.")
  102. (license license:gpl2)))
  103. (define-public keepassxc
  104. (package
  105. (name "keepassxc")
  106. (version "2.3.4")
  107. (source
  108. (origin
  109. (method url-fetch)
  110. (uri (string-append "https://github.com/keepassxreboot/" name
  111. "/releases/download/" version "/keepassxc-"
  112. version "-src.tar.xz"))
  113. (sha256
  114. (base32
  115. "02kq0a7a7hpw824n03apma00yq1c6dds224g15mrnnqqjn4af90c"))))
  116. (build-system cmake-build-system)
  117. (arguments
  118. '(#:configure-flags '("-DWITH_XC_NETWORKING=YES"
  119. "-DWITH_XC_BROWSER=YES"
  120. "-DWITH_XC_SSHAGENT=YES")))
  121. (inputs
  122. `(("argon2" ,argon2)
  123. ("curl" ,curl) ; XC_NETWORKING
  124. ("libgcrypt" ,libgcrypt)
  125. ("libsodium" ,libsodium) ; XC_BROWSER
  126. ("libxi" ,libxi)
  127. ("libxtst" ,libxtst)
  128. ("qtbase" ,qtbase)
  129. ("qtx11extras" ,qtx11extras)
  130. ("zlib" ,zlib)))
  131. (native-inputs
  132. `(("qttools" ,qttools)))
  133. (home-page "https://www.keepassxc.org")
  134. (synopsis "Password manager")
  135. (description "KeePassXC is a password manager or safe which helps you to
  136. manage your passwords in a secure way. You can put all your passwords in one
  137. database, which is locked with one master key or a key-file which can be stored
  138. on an external storage device. The databases are encrypted using the
  139. algorithms AES or Twofish.")
  140. ;; Non-functional parts use various licences.
  141. (license license:gpl3)))
  142. (define-public keepassx
  143. (package
  144. (name "keepassx")
  145. (version "2.0.3")
  146. (source
  147. (origin
  148. (method url-fetch)
  149. (uri (string-append "https://www.keepassx.org/releases/" version
  150. "/keepassx-" version ".tar.gz"))
  151. (sha256
  152. (base32
  153. "1ia7cqx9ias38mnffsl7da7g1f66bcbjsi23k49sln0c6spb9zr3"))))
  154. (build-system cmake-build-system)
  155. (inputs
  156. `(("libgcrypt" ,libgcrypt)
  157. ("libxi" ,libxi)
  158. ("libxtst" ,libxtst)
  159. ("qt" ,qt-4)))
  160. (native-inputs
  161. `(("zlib" ,zlib)))
  162. (home-page "https://www.keepassx.org")
  163. (synopsis "Password manager")
  164. (description "KeePassX is a password manager or safe which helps you to
  165. manage your passwords in a secure way. You can put all your passwords in one
  166. database, which is locked with one master key or a key-file which can be stored
  167. on an external storage device. The databases are encrypted using the
  168. algorithms AES or Twofish.")
  169. ;; Non functional parts use various licences.
  170. (license license:gpl3)
  171. (properties `((superseded . ,keepassxc)))))
  172. (define-public pwsafe
  173. (package
  174. (name "pwsafe")
  175. (version "3.48.0")
  176. (home-page "https://www.pwsafe.org/" )
  177. (source
  178. (origin
  179. (method git-fetch)
  180. (uri (git-reference
  181. (url "https://github.com/pwsafe/pwsafe.git")
  182. (commit version)))
  183. (sha256 (base32 "0hxv23yh76liggxbjn4m132z15sklra8ms341xgzl4n5vjx30ihi"))
  184. (file-name (string-append name "-" version "-checkout"))))
  185. (build-system cmake-build-system)
  186. (native-inputs `(("gettext" ,gettext-minimal)
  187. ("perl" ,perl)
  188. ("zip" ,zip)))
  189. (inputs `(("curl" ,curl)
  190. ("file" ,file)
  191. ("gtest" ,googletest)
  192. ("libuuid" ,util-linux)
  193. ("libxt" ,libxt)
  194. ("libxtst" ,libxtst)
  195. ("openssl" ,openssl)
  196. ("qrencode" ,qrencode)
  197. ("wxwidgets" ,wxwidgets)
  198. ("xerces-c" ,xerces-c)))
  199. (arguments '(#:configure-flags (list "-DNO_GTEST=YES")
  200. #:phases (modify-phases %standard-phases
  201. (add-after 'unpack 'add-gtest
  202. (lambda* (#:key inputs #:allow-other-keys)
  203. (chmod "CMakeLists.txt" #o644)
  204. (let ((cmake-port (open-file "CMakeLists.txt"
  205. "a")))
  206. (display "find_package(GTest)
  207. add_subdirectory(src/test)\n" cmake-port)
  208. (close cmake-port)
  209. #t)))
  210. (add-after 'add-gtest 'patch-executables
  211. (lambda* (#:key inputs #:allow-other-keys)
  212. (chmod "src/test/OSTest.cpp" #o644)
  213. (substitute* "src/os/unix/media.cpp"
  214. (("/usr/bin/file")
  215. (string-append (assoc-ref inputs "file")
  216. "/bin/file")))
  217. #t)))))
  218. (synopsis "Password safe with automatic input and key generation")
  219. (description "pwsafe is a password manager originally designed by Bruce
  220. Schneier. It offers a simple UI to manage passwords for different services.
  221. There are other programs that support the file format on different
  222. platforms.")
  223. (license license:artistic2.0)))
  224. (define-public shroud
  225. (package
  226. (name "shroud")
  227. (version "0.1.1")
  228. (source (origin
  229. (method url-fetch)
  230. (uri (string-append "https://files.dthompson.us/shroud/shroud-"
  231. version ".tar.gz"))
  232. (sha256
  233. (base32
  234. "1y43yhgy2zbrk5bqj3qyx9rkcz2bma9sinlrg7dip3jqms9gq4lr"))))
  235. (build-system gnu-build-system)
  236. (arguments
  237. '(#:phases
  238. (modify-phases %standard-phases
  239. (add-after 'install 'wrap-shroud
  240. (lambda* (#:key outputs #:allow-other-keys)
  241. (let* ((out (assoc-ref outputs "out"))
  242. (ccachedir (string-append out "/lib/guile/2.0/ccache"))
  243. (prog (string-append out "/bin/shroud")))
  244. (wrap-program prog
  245. `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,ccachedir)))
  246. #t))))))
  247. (inputs
  248. `(("guile" ,guile-2.0)
  249. ("gnupg" ,gnupg)
  250. ("xclip" ,xclip)))
  251. (synopsis "GnuPG-based secret manager")
  252. (description "Shroud is a simple secret manager with a command line
  253. interface. The password database is stored as a Scheme s-expression and
  254. encrypted with a GnuPG key. Secrets consist of an arbitrary number of
  255. key/value pairs, making Shroud suitable for more than just password storage.
  256. For copying and pasting secrets into web browsers and other graphical
  257. applications, there is xclip integration." )
  258. (home-page "https://dthompson.us/projects/shroud.html")
  259. (license license:gpl3+)))
  260. (define-public yapet
  261. (package
  262. (name "yapet")
  263. (version "1.1")
  264. (source (origin
  265. (method url-fetch)
  266. (uri (string-append "http://www.guengel.ch/myapps/yapet/downloads/yapet-"
  267. version
  268. ".tar.bz2"))
  269. (sha256
  270. (base32
  271. "1lq46mpxdsbl6qw4cj58hp9q7jckmyvbsi08p5zr77rjgqadxyyy"))))
  272. (build-system gnu-build-system)
  273. (inputs
  274. `(("ncurses" ,ncurses)
  275. ("openssl" ,openssl)))
  276. (native-inputs
  277. `(("pkg-config" ,pkg-config)))
  278. (synopsis "Yet Another Password Encryption Tool")
  279. (description "YAPET is a text based password manager using the Blowfish
  280. encryption algorithm. Because of its small footprint and very few library
  281. dependencies, it is suited for installing on desktop and server systems alike.
  282. The text based user interface allows you to run YAPET easily in a Secure Shell
  283. session. Two companion utilities enable users to convert CSV files to YAPET
  284. and vice versa.")
  285. (home-page "http://www.guengel.ch/myapps/yapet/")
  286. (license license:gpl3+)))
  287. (define-public cracklib
  288. (package
  289. (name "cracklib")
  290. (version "2.9.6")
  291. (source (origin
  292. (method url-fetch)
  293. (uri (string-append "https://github.com/cracklib/cracklib/"
  294. "releases/download/" name "-" version "/"
  295. name "-" version ".tar.gz"))
  296. (patches (search-patches "cracklib-CVE-2016-6318.patch"
  297. "cracklib-fix-buffer-overflow.patch"))
  298. (sha256
  299. (base32
  300. "0hrkb0prf7n92w6rxgq0ilzkk6rkhpys2cfqkrbzswp27na7dkqp"))))
  301. (build-system gnu-build-system)
  302. (synopsis "Password checking library")
  303. (home-page "https://github.com/cracklib/cracklib")
  304. (description
  305. "CrackLib is a library containing a C function which may be used in a
  306. @command{passwd}-like program. The idea is simple: try to prevent users from
  307. choosing passwords that could easily be guessed (or \"cracked\") by filtering
  308. them out, at the source.")
  309. (license license:lgpl2.1)))
  310. (define-public libpwquality
  311. (package
  312. (name "libpwquality")
  313. (version "1.4.0")
  314. (source (origin
  315. (method url-fetch)
  316. (uri (list
  317. (string-append "https://github.com/" name "/" name
  318. "/releases/download/" name "-" version
  319. "/" name "-" version ".tar.bz2")
  320. (string-append "https://launchpad.net/libpwquality/trunk/"
  321. version "/+download/"
  322. name "-" version ".tar.bz2")))
  323. (sha256
  324. (base32
  325. "0syyz8r54l8mqmbb0mw19qz4z2cx8gdgidicb8k2s5zjdh2gzrhx"))))
  326. (build-system gnu-build-system)
  327. (arguments
  328. ;; XXX: have RUNPATH issue.
  329. '(#:configure-flags '("--disable-python-bindings")))
  330. (inputs
  331. `(("cracklib" ,cracklib)))
  332. (synopsis "Password quality checker")
  333. (home-page "https://github.com/libpwquality/libpwquality")
  334. (description
  335. "Libpwquality is a library for password quality checking and generation of
  336. random passwords that pass the checks.")
  337. (license license:gpl2+)))
  338. (define-public assword
  339. (package
  340. (name "assword")
  341. (version "0.11")
  342. (source (origin
  343. (method url-fetch)
  344. (uri (list
  345. (string-append
  346. "http://http.debian.net/debian/pool/main/a/assword/"
  347. "assword_" version ".orig.tar.gz")))
  348. (sha256
  349. (base32
  350. "03gkb6kvsghznbcw5l7nmrc6mn3ixkjd5jcs96ni4zs9l47jf7yp"))))
  351. (arguments
  352. `(;; irritatingly, tests do run but not there are two problems:
  353. ;; - "import gtk" fails for unknown reasons here despite it the
  354. ;; program working (indeed, I've found I have to do a logout and log
  355. ;; back in in after an install order for some mumbo jumbo environment
  356. ;; variable mess to work with pygtk and assword... what's up with
  357. ;; that?)
  358. ;; - even when the tests fail, they don't return a nonzero status,
  359. ;; so I'm not sure how to programmatically get that information
  360. #:tests? #f
  361. #:phases
  362. (modify-phases %standard-phases
  363. (add-after 'install 'wrap-assword
  364. (lambda* (#:key outputs #:allow-other-keys)
  365. (let ((prog (string-append
  366. (assoc-ref outputs "out")
  367. "/bin/assword"))
  368. (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
  369. (wrap-program prog
  370. `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))
  371. #t)))
  372. (add-after 'install 'manpage
  373. (lambda* (#:key outputs #:allow-other-keys)
  374. ;; Without this substitution, it fails with
  375. ;; ImportError: No module named 'gpg'
  376. (substitute* "Makefile"
  377. (("PYTHONPATH=.") ""))
  378. (invoke "make" "assword.1")
  379. (install-file
  380. "assword.1"
  381. (string-append (assoc-ref outputs "out") "/share/man/man1")))))))
  382. (build-system python-build-system)
  383. (native-inputs
  384. `(("txt2man" ,txt2man)))
  385. (inputs
  386. `(("gtk+" ,gtk+)
  387. ("python-xdo" ,python-xdo)
  388. ("python-gpg" ,python-gpg)
  389. ("python-pygobject" ,python-pygobject)))
  390. (propagated-inputs
  391. `(("xclip" ,xclip)))
  392. (home-page "https://finestructure.net/assword/")
  393. (synopsis "Password manager")
  394. (description "assword is a simple password manager using GPG-wrapped
  395. JSON files. It has a command line interface as well as a very simple
  396. graphical interface, which can even \"type\" your passwords into
  397. any X11 window.")
  398. (license license:gpl3+)))
  399. (define-public password-store
  400. (package
  401. (name "password-store")
  402. (version "1.7.3")
  403. (source (origin
  404. (method url-fetch)
  405. (uri
  406. (string-append "https://git.zx2c4.com/password-store/snapshot/"
  407. name "-" version ".tar.xz"))
  408. (sha256
  409. (base32
  410. "1x53k5dn3cdmvy8m4fqdld4hji5n676ksl0ql4armkmsds26av1b"))))
  411. (build-system gnu-build-system)
  412. (arguments
  413. '(#:phases
  414. (modify-phases %standard-phases
  415. (delete 'configure)
  416. (delete 'build)
  417. (add-before 'install 'patch-passmenu-path
  418. (lambda* (#:key inputs #:allow-other-keys)
  419. (substitute* "contrib/dmenu/passmenu"
  420. (("dmenu") (string-append (assoc-ref inputs "dmenu")
  421. "/bin/dmenu"))
  422. (("xdotool") (string-append (assoc-ref inputs "xdotool")
  423. "/bin/xdotool")))
  424. #t))
  425. (add-after 'install 'install-passmenu
  426. (lambda* (#:key outputs #:allow-other-keys)
  427. (let* ((out (assoc-ref outputs "out"))
  428. (bin (string-append out "/bin")))
  429. (install-file "contrib/dmenu/passmenu" bin)
  430. #t)))
  431. (add-after 'install 'wrap-path
  432. (lambda* (#:key inputs outputs #:allow-other-keys)
  433. (let ((out (assoc-ref outputs "out"))
  434. (path (map (lambda (pkg)
  435. (string-append (assoc-ref inputs pkg) "/bin"))
  436. '("coreutils" "getopt" "git" "gnupg" "qrencode"
  437. "sed" "tree" "which" "xclip"))))
  438. (wrap-program (string-append out "/bin/pass")
  439. `("PATH" ":" prefix (,(string-join path ":"))))
  440. #t)))
  441. (add-after 'wrap-path 'install-shell-completions
  442. (lambda* (#:key outputs #:allow-other-keys)
  443. (let* ((out (assoc-ref outputs "out"))
  444. (bashcomp (string-append out "/etc/bash_completion.d")))
  445. ;; TODO: install fish and zsh completions.
  446. (mkdir-p bashcomp)
  447. (copy-file "src/completion/pass.bash-completion"
  448. (string-append bashcomp "/pass"))
  449. #t))))
  450. #:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
  451. ;; Parallel tests may cause a race condition leading to a
  452. ;; timeout in some circumstances.
  453. #:parallel-tests? #f
  454. #:test-target "test"))
  455. (inputs
  456. `(("dmenu" ,dmenu)
  457. ("getopt" ,util-linux)
  458. ("git" ,git)
  459. ("gnupg" ,gnupg)
  460. ("qrencode" ,qrencode)
  461. ("sed" ,sed)
  462. ("tree" ,tree)
  463. ("which" ,which)
  464. ("xclip" ,xclip)
  465. ("xdotool" ,xdotool)))
  466. (home-page "https://www.passwordstore.org/")
  467. (synopsis "Encrypted password manager")
  468. (description "Password-store is a password manager which uses GnuPG to
  469. store and retrieve passwords. The tool stores each password in its own
  470. GnuPG-encrypted file, allowing the program to be simple yet secure.
  471. Synchronization is possible using the integrated git support, which commits
  472. changes to your password database to a git repository that can be managed
  473. through the pass command.")
  474. (license license:gpl2+)))
  475. (define-public argon2
  476. (package
  477. (name "argon2")
  478. (version "20171227")
  479. (source
  480. (origin
  481. (method url-fetch)
  482. (uri
  483. (string-append "https://github.com/P-H-C/phc-winner-argon2/archive/"
  484. version ".tar.gz"))
  485. (file-name (string-append name "-" version ".tar.gz"))
  486. (sha256
  487. (base32
  488. "1n6w5y3va7lrcym7cxr0nikapldqm80wxjdns584bvplq5r03spa"))))
  489. (build-system gnu-build-system)
  490. (arguments
  491. `(#:test-target "test"
  492. #:make-flags '("CC=gcc"
  493. "OPTTEST=1") ;disable CPU optimization
  494. #:phases
  495. (modify-phases %standard-phases
  496. (add-after 'unpack 'patch-Makefile
  497. (lambda* (#:key outputs #:allow-other-keys)
  498. (let ((out (assoc-ref outputs "out")))
  499. (substitute* "Makefile"
  500. (("PREFIX = /usr") (string-append "PREFIX = " out)))
  501. (substitute* "libargon2.pc"
  502. (("prefix=/usr") (string-append "prefix=" out))
  503. (("@HOST_MULTIARCH@") "")
  504. (("@UPSTREAM_VER@") ,version))
  505. #t)))
  506. (delete 'configure)
  507. (add-after 'install 'install-argon2.pc
  508. (lambda* (#:key outputs #:allow-other-keys)
  509. (let ((out (assoc-ref outputs "out")))
  510. (install-file "libargon2.pc"
  511. (string-append out "/lib/pkgconfig"))
  512. #t))))))
  513. (home-page "https://www.argon2.com/")
  514. (synopsis "Password hashing library")
  515. (description "Argon2 provides a key derivation function that was declared
  516. winner of the 2015 Password Hashing Competition.")
  517. ;; Argon2 is dual licensed under CC0 and ASL 2.0. Some of the source
  518. ;; files are CC0 only; see README.md and LICENSE for details.
  519. (license (list license:cc0 license:asl2.0))))
  520. (define-public pass-git-helper
  521. (package
  522. (name "pass-git-helper")
  523. (version "0.3.1")
  524. (source
  525. (origin
  526. (method url-fetch)
  527. (uri (string-append "https://github.com/languitar/pass-git-helper/archive/release-"
  528. version ".tar.gz"))
  529. (sha256
  530. (base32
  531. "0lz5ncy44pz7z1j2nnyildx8sq33zi3xvg5nkwg25n11nasqh2xn"))))
  532. (build-system python-build-system)
  533. (arguments
  534. `(#:phases
  535. (modify-phases %standard-phases
  536. (add-before 'build 'patch-pass-path
  537. (lambda* (#:key inputs #:allow-other-keys)
  538. (let* ((password-store (assoc-ref inputs "password-store"))
  539. (pass (string-append password-store "/bin/pass")))
  540. (substitute* "pass-git-helper"
  541. (("'pass'") (string-append "'" pass "'")))
  542. #t))))))
  543. (inputs
  544. `(("python-pyxdg" ,python-pyxdg)
  545. ("password-store" ,password-store)))
  546. (home-page "https://github.com/languitar/pass-git-helper")
  547. (synopsis "Git credential helper interfacing with pass")
  548. (description "pass-git-helper is a git credential helper which allows to
  549. use pass, the standard unix password manager, as the credential backend for
  550. your git repositories. This is achieved by explicitly defining mappings
  551. between hosts and entries in the password store.")
  552. (license license:lgpl3+)))
  553. (define-public john-the-ripper-jumbo
  554. (let ((official-version "1.8.0")
  555. (jumbo-version "1"))
  556. (package
  557. (name "john-the-ripper-jumbo")
  558. (version (string-append official-version "-" jumbo-version))
  559. (source
  560. (origin
  561. (method url-fetch)
  562. (uri (string-append "http://www.openwall.com/john/j/john-"
  563. official-version "-jumbo-" jumbo-version ".tar.xz"))
  564. (sha256
  565. (base32
  566. "08q92sfdvkz47rx6qjn7qv57cmlpy7i7rgddapq5384mb413vjds"))
  567. (patches
  568. (list (origin
  569. (method url-fetch)
  570. (uri (string-append "https://github.com/magnumripper/"
  571. "JohnTheRipper/commit/"
  572. "e2e868db3e153b3f959e119a51703d4afb99c624.patch"))
  573. (file-name "john-the-ripper-jumbo-gcc5-inline.patch")
  574. (sha256
  575. (base32
  576. "1shvcf1y2097115mxhzdkm64dr106a8zr6pqjqyh171q5ng5vfra")))
  577. (origin
  578. (method url-fetch)
  579. (uri (string-append "https://github.com/magnumripper/"
  580. "JohnTheRipper/commit/"
  581. "480e95b0e449863be3e1a5b0bc634a67df28b618.patch"))
  582. (file-name "john-the-ripper-jumbo-non-x86.patch")
  583. (sha256
  584. (base32
  585. "1ffd9dvhk0sb6ss8dv5yalh01lz30i7rilqilf2xv68gax2hyjqx")))))))
  586. (build-system gnu-build-system)
  587. (inputs
  588. `(("gmp" ,gmp)
  589. ("krb5" ,mit-krb5)
  590. ("libpcap" ,libpcap)
  591. ("nss" ,nss)
  592. ("openssl" ,openssl)
  593. ("zlib" ,zlib)))
  594. (arguments
  595. `(#:configure-flags
  596. (list (string-append
  597. "CFLAGS=-O2 -g "
  598. "-DJOHN_SYSTEMWIDE=1 "
  599. "-DJOHN_SYSTEMWIDE_EXEC='\"" %output "/libexec/john\"' "
  600. "-DJOHN_SYSTEMWIDE_HOME='\"" %output "/share/john\"'")
  601. ;; For now, do not test for instruction set in configure, and
  602. ;; do not pass '-march=native' to gcc:
  603. "--disable-native-tests"
  604. "--disable-native-macro")
  605. #:tests? #f ;tests try to create '.john' in the build user's $HOME
  606. #:phases
  607. (modify-phases %standard-phases
  608. (add-before 'configure 'chdir-src
  609. (lambda _ (chdir "src")))
  610. (replace 'install
  611. (lambda _
  612. (let ((bindir (string-append %output "/bin"))
  613. (docdir (string-append %output "/share/doc/john"))
  614. (execdir (string-append %output "/libexec/john"))
  615. (homedir (string-append %output "/share/john"))
  616. (install-file-to (lambda (dir)
  617. (lambda (f) (install-file f dir))))
  618. (symlink? (lambda (_ s) (eq? (stat:type s) 'symlink))))
  619. (with-directory-excursion "../run"
  620. (for-each (install-file-to execdir)
  621. (cons* "mailer" "benchmark-unify"
  622. (find-files "." ".*\\.(py|rb|pl)")))
  623. (for-each (install-file-to homedir)
  624. (append (find-files "." "(stats|dictionary.*)")
  625. (find-files "." "(.*\\.chr|.*\\.lst)")
  626. (find-files "." ".*\\.conf")))
  627. (for-each (install-file-to bindir)
  628. '("tgtsnarf" "genmkvpwd" "mkvcalcproba"
  629. "raw2dyna" "luks2john" "vncpcap2john"
  630. "uaf2john" "calc_stat" "wpapcap2john"
  631. "cprepair" "relbench" "SIPdump" "john"))
  632. (for-each (lambda (f) ;install symlinked aliases
  633. (symlink "john"
  634. (string-append bindir "/" (basename f))))
  635. (find-files "." symlink?)))
  636. (copy-recursively "../doc" docdir)
  637. #t))))))
  638. (home-page "http://www.openwall.com/john/")
  639. (synopsis "Password cracker")
  640. (description "John the Ripper is a fast password cracker. Its primary
  641. purpose is to detect weak Unix passwords. Besides several @code{crypt}
  642. password hash types most commonly found on various Unix systems, supported out
  643. of the box are Windows LM hashes, plus lots of other hashes and ciphers. This
  644. is the community-enhanced, \"jumbo\" version of John the Ripper.")
  645. (license license:gpl2+))))
  646. (define-public sala
  647. (package
  648. (name "sala")
  649. (version "1.3")
  650. (source
  651. (origin
  652. (method url-fetch)
  653. (uri (pypi-uri "sala" version))
  654. (sha256
  655. (base32
  656. "13qgmc3i2a0cqp8jqrfl93lnphfagb32pgfikc1gza2a14asxzi8"))))
  657. (build-system python-build-system)
  658. (arguments
  659. ;; Sala is supposed to work with Python 3.2 or higher,
  660. ;; but it doesn't work with Python 3.6. Better stick
  661. ;; to Python 2, which works fine.
  662. `(#:python ,python-2))
  663. (propagated-inputs
  664. `(("gnupg" ,gnupg)
  665. ("pwgen" ,pwgen)))
  666. (home-page "http://www.digip.org/sala/")
  667. (synopsis "Encrypted plaintext password store")
  668. (description
  669. "Store passwords and other bits of sensitive plain-text information
  670. to encrypted files on a directory hierarchy. The information is protected
  671. by GnuPG's symmetrical encryption.")
  672. (license license:expat)))
  673. (define-public fpm2
  674. (package
  675. (name "fpm2")
  676. (version "0.79")
  677. (source (origin
  678. (method url-fetch)
  679. (uri (string-append "https://als.regnet.cz/fpm2/download/fpm2-"
  680. version ".tar.bz2"))
  681. (sha256
  682. (base32
  683. "19sdy1lygfhkg5nxi2w9a4d9kwvw24nxp0ix0p0lz91qpvk9qpnm"))))
  684. (build-system gnu-build-system)
  685. (inputs `(("gtk2" ,gtk+-2)
  686. ("gnupg" ,gnupg)
  687. ("libxml2" ,libxml2)))
  688. (native-inputs `(("pkg-config" ,pkg-config)
  689. ("intltool" ,intltool)))
  690. (arguments
  691. `(#:phases
  692. (modify-phases %standard-phases
  693. (add-before 'configure 'pre-configure
  694. ;; The file po/POTFILES.in ends up missing for some reason in
  695. ;; both nix and guix builds. Adding the file with contents
  696. ;; found during troubleshooting.
  697. (lambda _
  698. (call-with-output-file "po/POTFILES.in"
  699. (lambda (port)
  700. (format port "data/fpm2.desktop.in
  701. data/fpm2.desktop.in.in
  702. fpm2.glade
  703. src/callbacks.c
  704. src/fpm.c
  705. src/fpm_file.c
  706. src/interface.c
  707. src/support.c
  708. fpm2.glade
  709. ")))
  710. #t)))))
  711. (synopsis "Manage, generate and store passwords encrypted")
  712. (description "FPM2 is GTK2 port from Figaro's Password Manager
  713. originally developed by John Conneely, with some new enhancements.
  714. Upstream development seems to have stopped. It is therefore recommended
  715. to use a different password manager.")
  716. (home-page "https://als.regnet.cz/fpm2/")
  717. (license license:gpl2+)))
  718. (define-public pass-rotate
  719. (package
  720. (name "pass-rotate")
  721. (version "0.1")
  722. (source
  723. (origin
  724. (method url-fetch)
  725. (uri (string-append "https://github.com/SirCmpwn/pass-rotate/archive/"
  726. version ".tar.gz"))
  727. (sha256
  728. (base32
  729. "1svm5nj8bczv2dg8lh2zqqhbsrljqsw9680r03qwgl9vlci90210"))
  730. (file-name (string-append name "-" version ".tar.gz"))))
  731. (build-system python-build-system)
  732. (inputs
  733. `(("python-beautifulsoup4" ,python-beautifulsoup4)
  734. ("python-docopt" ,python-docopt)
  735. ("python-html5lib" ,python-html5lib)
  736. ("python-requests" ,python-requests)))
  737. (home-page "https://github.com/SirCmpwn/pass-rotate")
  738. (synopsis "Rotate password on online services")
  739. (description "pass-rotate is a command line utility and python library for
  740. rotating passwords on various web services. It makes it easier to rotate your
  741. passwords, one at a time or in bulk, when security events or routine upkeep of
  742. your online accounts makes it necessary.")
  743. (license license:expat)))
  744. (define-public hashcat
  745. (package
  746. (name "hashcat")
  747. (version "5.1.0")
  748. (source
  749. (origin
  750. (method url-fetch)
  751. (uri (string-append "https://hashcat.net/files/hashcat-"
  752. version ".tar.gz"))
  753. (sha256
  754. (base32
  755. "0f73y4cg8c7a6q7x34qvpfi4g3lw6j9bnn0a13g43aqyiskflfr8"))))
  756. (native-inputs
  757. `(("opencl-headers" ,opencl-headers)))
  758. (build-system gnu-build-system)
  759. (arguments
  760. '(#:tests? #f ;no tests
  761. #:make-flags (list (string-append "PREFIX=" %output))
  762. #:phases
  763. (modify-phases %standard-phases
  764. (delete 'configure))))
  765. (home-page "https://hashcat.net/hashcat/")
  766. (synopsis "Advanced password recovery utility")
  767. (description "Hashcat is an password recovery utility, supporting five
  768. unique modes of attack for over 200 highly-optimized hashing algorithms.
  769. Hashcat currently supports CPUs, GPUs, and other hardware accelerators on
  770. Linux, Windows, and macOS, and has facilities to help enable distributed
  771. password cracking.")
  772. (license license:expat)))
  773. (define-public hashcat-utils
  774. (package
  775. (name "hashcat-utils")
  776. (version "1.9")
  777. (source
  778. (origin
  779. (method url-fetch)
  780. (uri (string-append "https://github.com/hashcat/hashcat-utils/releases/"
  781. "download/v" version "/"
  782. "hashcat-utils-" version ".7z"))
  783. (sha256
  784. (base32 "0kq555kb338691qd7zjmi8vhq4km3apnsl2w63zh0igwzcjx6lx1"))))
  785. (native-inputs
  786. `(("p7zip" ,p7zip)))
  787. (inputs
  788. `(("perl" ,perl)))
  789. (build-system gnu-build-system)
  790. (arguments
  791. `(#:tests? #f ;no tests
  792. #:make-flags (list "CC=gcc"
  793. ;; Upstream bug(?): "make all" seems to remove the
  794. ;; Perl scripts from the source.
  795. "native")
  796. #:phases
  797. (modify-phases %standard-phases
  798. (replace 'unpack
  799. (lambda* (#:key source #:allow-other-keys)
  800. (invoke "7z" "x" source)
  801. (chdir (string-append "hashcat-utils-" ,version "/src"))
  802. #t))
  803. (delete 'configure)
  804. (replace 'install
  805. (lambda* (#:key outputs #:allow-other-keys)
  806. (let ((out (string-append (assoc-ref outputs "out") "/bin")))
  807. (mkdir-p out)
  808. (for-each
  809. (lambda (file)
  810. (copy-file file (string-append out "/"
  811. (basename file ".bin"))))
  812. (find-files "." "\\.bin$"))
  813. (for-each
  814. (lambda (file)
  815. (copy-file file (string-append out "/"
  816. (basename file ".pl"))))
  817. (find-files "../bin" "\\.pl$"))
  818. #t))))))
  819. (home-page "https://github.com/hashcat/hashcat-utils/")
  820. (synopsis "Small utilities that are useful in advanced password cracking")
  821. (description "Hashcat-utils are a set of small utilities that are useful
  822. in advanced password cracking. They all are packed into multiple stand-alone
  823. binaries. All of these utils are designed to execute only one specific
  824. function. Since they all work with @code{STDIN} and @code{STDOUT} you can
  825. group them into chains.")
  826. (license license:expat)))