;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Paul van der Walt ;;; Copyright © 2015, 2017, 2018, 2019 Ricardo Wurmus ;;; Copyright © 2016 ng0 ;;; Copyright © 2017 rsiddharth ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu packages haskell-crypto) #:use-module (gnu packages) #:use-module (gnu packages compression) #:use-module (gnu packages haskell) #:use-module (gnu packages haskell-check) #:use-module (gnu packages haskell-xyz) #:use-module (gnu packages tls) #:use-module (guix build-system haskell) #:use-module (guix download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix utils)) (define-public ghc-asn1-types (package (name "ghc-asn1-types") (version "0.3.3") (source (origin (method url-fetch) (uri (string-append "https://hackage.haskell.org/package/" "asn1-types/asn1-types-" version ".tar.gz")) (sha256 (base32 "162lacdl9jr42pdhaj9hxqlba6hjxm6g866anna74q6v3cvw5ssp")))) (bu
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Steve Sprang <scs@stevesprang.com>
;;; Copyright © 2015-2024 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2015 Aljosha Papsch <misc@rpapsch.de>
;;; Copyright © 2016 Christine Lemmer-Webber <cwebber@dustycloud.org>
;;; Copyright © 2016 Jessica Tallon <tsyesika@tsyesika.se>
;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
;;; Copyright © 2016, 2019, 2020 Alex Griffin <a@ajgrf.com>
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Jelle Licht <jlicht@fsfe.org>
;;; Copyright © 2017, 2019 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2017, 2020-2022, 2024 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
;;; Copyright © 2018, 2022 Marius Bakke <marius@gnu.org>
;;; Copyright © 2018 Konrad Hinsen <konrad.hinsen@fastmail.net>
;;; Copyright © 2018 Thomas Sigurdsen <tonton@riseup.net>
;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
;;; Copyright © 2018, 2019, 2020 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
;;; Copyright © 2019 Jens Mølgaard <jens@zete.tk>
;;; Copyright © 2019,2022 Tanguy Le Carrour <tanguy@bioneland.org>
;;; Copyright © 2020, 2024 Guillaume Le Vaillant <glv@posteo.net>
;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
;;; Copyright © 2020 Jean-Baptiste Note <jean-baptiste.note@m4x.org>
;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2021 Stefan Reichör <stefan@xsteve.at>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2021 David Dashyan <mail@davie.li>
;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
;;; Copyright © 2022 ( <paren@disroot.org>
;;; Copyright © 2022 Nicolas Graves <ngraves@ngraves.fr>
;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
;;; Copyright © 2023 Christian Miller <christian.miller@dadoes.de>
;;; Copyright © 2024 John Kehayias <john.kehayias@protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages password-utils)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix utils)
  #:use-module (guix build-system cmake)
  #:use-module (guix build-system copy)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system go)
  #:use-module (guix build-system python)
  #:use-module (guix build-system qt)
  #:use-module (guix build-system trivial)
  #:use-module (guix download)
  #:use-module (guix gexp)
  #:use-module (guix git-download)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (gnu packages)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages aidc)
  #:use-module (gnu packages authentication)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages check)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages crypto)
  #:use-module (gnu packages cryptsetup)
  #:use-module (gnu packages curl)
  #:use-module (gnu packages digest)
  #:use-module (gnu packages docbook)
  #:use-module (gnu packages file)
  #:use-module (gnu packages freedesktop)
  #:use-module (gnu packages gettext)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages gnupg)
  #:use-module (gnu packages golang)
  #:use-module (gnu packages golang-build)
  #:use-module (gnu packages golang-crypto)
  #:use-module (gnu packages golang-xyz)
  #:use-module (gnu packages golang-web)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages guile)
  #:use-module (gnu packages kerberos)
  #:use-module (gnu packages libffi)
  #:use-module (gnu packages libusb)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages man)
  #:use-module (gnu packages multiprecision)
  #:use-module (gnu packages ncurses)
  #:use-module (gnu packages nss)
  #:use-module (gnu packages opencl)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages protobuf)
  #:use-module (gnu packages python)
  #:use-module (gnu packages python-web)
  #:use-module (gnu packages python-xyz)
  #:use-module (gnu packages rdesktop)
  #:use-module (gnu packages readline)
  #:use-module (gnu packages ruby)
  #:use-module (gnu packages security-token)
  #:use-module (gnu packages suckless)
  #:use-module (gnu packages tcl)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages qt)
  #:use-module (gnu packages version-control)
  #:use-module (gnu packages web)
  #:use-module (gnu packages wxwidgets)
  #:use-module (gnu packages xdisorg)
  #:use-module (gnu packages xorg)
  #:use-module (gnu packages xml))

(define-public aws-vault
  (package
    (name "aws-vault")
    (version "7.2.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/99designs/aws-vault")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1dqg6d2k8r80ww70afghf823z0pijha1i0a0c0c6918yb322zkj2"))))
    (build-system go-build-system)
    (arguments
     (list
      #:install-source? #f
      #:import-path "github.com/99designs/aws-vault"
      #:phases
      #~(modify-phases %standard-phases
          (add-before 'build 'patch-version
            (lambda _
              (substitute* "src/github.com/99designs/aws-vault/main.go"
                (("var Version = \"dev\"")
                 (string-append "var Version = \"v" #$version "\"")))))
          (add-after 'build 'contrib
            (lambda* (#:key import-path #:allow-other-keys)
              (let* ((zsh-site-dir
                      (string-append #$output "/share/zsh/site-functions"))
                     (bash-completion-dir
                      (string-append #$output "/share/bash-completion/completions"))
                     (fish-completion-dir
                      (string-append #$output "/share/fish/completions")))
                (for-each mkdir-p (list bash-completion-dir
                                        fish-completion-dir
                                        zsh-site-dir))
                (with-directory-excursion
                    (string-append "src/" import-path "/contrib/completions")
                  (copy-file "zsh/aws-vault.zsh"
                             (string-append zsh-site-dir "/_aws-vault"))
                  (copy-file "bash/aws-vault.bash"
                             (string-append bash-completion-dir "/aws-vault"))
                  (copy-file "fish/aws-vault.fish"
                             (string-append fish-completion-dir "/aws-vault.fish"))))))
          ;; aws-vault: error: add: mkdir /homeless-shelter: permission
          ;; denied.
          (add-before 'check 'set-home
            (lambda _
              (setenv "HOME" "/tmp"))))))
    (native-inputs
     (list go-github-com-99designs-keyring
           go-github-com-alecthomas-kingpin-v2
           go-github-com-aws-aws-sdk-go-v2
           go-github-com-aws-aws-sdk-go-v2-config
           go-github-com-aws-aws-sdk-go-v2-credentials
           go-github-com-aws-aws-sdk-go-v2-service-iam
           go-github-com-aws-aws-sdk-go-v2-service-sso
           go-github-com-aws-aws-sdk-go-v2-service-ssooidc
           go-github-com-aws-aws-sdk-go-v2-service-sts
           go-github-com-google-go-cmp
           go-github-com-mattn-go-isatty
           go-github-com-mattn-go-tty
           go-github-com-skratchdot-open-golang
           go-golang-org-x-term
           go-gopkg-in-ini-v1))
    (home-page "https://github.com/99designs/aws-vault")
    (synopsis "Vault for securely storing and accessing AWS credentials")
    (description
     "AWS Vault is a tool to securely store and access @acronym{Amazon Web
Services,AWS} credentials.

AWS Vault stores IAM credentials in your operating system's secure keystore and
then generates temporary credentials from those to expose to your shell and
applications.  It's designed to be complementary to the AWS CLI tools, and is
aware of your profiles and configuration in ~/.aws/config.")
    (license license:expat)))

(define-public pwgen
  (package
    (name "pwgen")
    (version "2.08")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "mirror://sourceforge/pwgen/pwgen/" version
                           "/pwgen-" version ".tar.gz"))
       (sha256
        (base32 "0yy90pqrr2pszzhb5hxjishq9qc7dqd290amiibqx9fm1b9kvc6s"))))
    (build-system gnu-build-system)
    (arguments
     `(#:tests? #f)) ; no test suite
    (home-page "http://pwgen.sourceforge.net/")
    (synopsis "Password generator")
    (description "Pwgen generates passwords which can be easily memorized by a
human.")
    (license license:gpl2)))

(define-public keepassxc
  (package
    (name "keepassxc")
    (version "2.7.9")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://github.com/keepassxreboot/keepassxc"
                           "/releases/download/" version "/keepassxc-"
                           version "-src.tar.xz"))
       (sha256
        (base32 "1za6xnwnq68gswz8vh7s5wia1bdhnia11hcb7p3dl3f049gy8i1w"))))
    (build-system qt-build-system)
    (arguments
     (list
      #:configure-flags
      #~(append
          (list "-DWITH_XC_ALL=YES"
                "-DWITH_XC_UPDATECHECK=NO")
          #$(if (member (%current-system)
                        (package-transitive-supported-systems ruby-asciidoctor))
              #~'()
              #~(list "-DWITH_XC_DOCS=NO")))
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'record-clipboard-programs
            (lambda* (#:key inputs #:allow-other-keys)
              ;; Record the file names of clipboard programs invoked by
              ;; 'keepassxc-cli clip' and similar.
              ;;
              ;; Note: Use 'QString::fromUtf8' rather than 'QStringLiteral' so
              ;; that the store reference is stored as ASCII instead of
              ;; UTF-16, which would be invisible to the GC's scanner.
              (substitute* "src/cli/Utils.cpp"
                (("QStringLiteral\\(\"xclip\"\\)")
                 (string-append
                  "QString::fromUtf8(\""
                  (search-input-file inputs "bin/xclip")
                  "\")"))
                (("QStringLiteral\\(\"wl-copy\"\\)")
                 (string-append
                  "QString::fromUtf8(\""
                  (search-input-file inputs "bin/wl-copy")
                  "\")")))))
          (replace 'check
            (lambda* (#:key tests? #:allow-other-keys)
              (when tests?
                ;; "TestCli::testClip() Compared values are not the same".
                ;;   Actual   (((clipboard->text()))): ""
                ;;   Expected (QString("Password"))  : "Password"
                (invoke "ctest" "--exclude-regex" "testcli")))))))
    (native-inputs
     (append
       (list qttools-5)
       (if (member (%current-system)
                   (package-transitive-supported-systems ruby-asciidoctor))
         (list ruby-asciidoctor)
         '())))
    (inputs
     (list argon2
           botan
           libgcrypt
           libsodium                    ; XC_BROWSER
           libusb
           libyubikey                   ; XC_YUBIKEY
           libxi
           libxtst
           minizip
           pcsc-lite
           qrencode
           qtsvg-5
           qtwayland-5
           qtx11extras
           quazip-0                     ; XC_KEESHARE
           readline
           wl-clipboard                 ;for 'wl-copy'
           xclip                        ;for 'xclip'
           yubikey-personalization      ; XC_YUBIKEY
           zlib))
    (home-page "https://keepassxc.org")
    (synopsis "Password manager")
    (description "KeePassXC is a password manager or safe which helps you to
manage your passwords in a secure way.  You can put all your passwords in one
database, which is locked with one master key or a key-file which can be stored
on an external storage device.  The databases are encrypted using the
algorithms AES or Twofish.")
    (properties
     '((release-monitoring-url . "https://github.com/keepassxreboot/keepassxc/releases")))
    ;; While various parts of the software are licensed under different licenses,
    ;; the combined work falls under the GPLv3.
    (license license:gpl3)))

(define-public pwsafe
  (package
    (name "pwsafe")
    (version "3.60.0")
    (home-page "https://www.pwsafe.org/")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/pwsafe/pwsafe")
             (commit version)))
       (sha256
        (base32 "064y78sqr8h9mq922spi4r13ga0a1j09mfh4kc4pn7j697nl6b5y"))
       (file-name (git-file-name name version))))
    (build-system cmake-build-system)
    (native-inputs
     (list gettext-minimal googletest perl zip))
    (inputs (list curl
                  file
                  `(,util-linux "lib")
                  libxt
                  libxtst
                  openssl
                  qrencode
                  wxwidgets
                  xerces-c))
    (arguments '(#:configure-flags (list "-DNO_GTEST=YES")
                 #:phases (modify-phases %standard-phases
                            (add-after 'unpack 'add-gtest
                              (lambda* (#:key inputs #:allow-other-keys)
                                (chmod "CMakeLists.txt" #o644)
                                (let ((cmake-port (open-file "CMakeLists.txt"
                                                             "a")))
                                  (display "find_package(GTest)
add_subdirectory(src/test)\n" cmake-port)
                                  (close cmake-port)
                                  #t))))))
    (synopsis "Password safe with automatic input and key generation")
    (description "pwsafe is a password manager originally designed by Bruce
Schneier.  It offers a simple UI to manage passwords for different services.
There are other programs that support the file format on different
platforms.")
    (license license:artistic2.0)))

(define-public pwsafe-cli
  (let ((commit "c49a0541b66647ad04d19ddb351d264054c67759")
        (revision "0"))
    (package
      (name "pwsafe-cli")
      (version (git-version "0.2.0" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/nsd20463/pwsafe")
               (commit commit)))
         (sha256
          (base32
           "0ak09r1l7k57m6pdx468hhzvz0szmaq42vyr575fvsjc8rbrp8qq"))
         (file-name (git-file-name name version))))
      (build-system gnu-build-system)
      (arguments
       ;; FIXME: skip failing test suite (requires write access to /tmp),
       ;; patching path does not help somehow.
       `(#:tests? #f
         #:phases
         (modify-phases %standard-phases
           (replace 'bootstrap
             (lambda _
               (invoke "aclocal")
               (invoke "autoheader")
               (invoke "automake" "--add-missing")
               (invoke "autoconf")
               #t)))))
      (native-inputs
       (list autoconf automake))
      (inputs
       (list libx11 libxmu libxt openssl))
      (home-page "https://github.com/nsd20463/pwsafe")
      (synopsis "CLI password manager")
      (description
       "@command{pwsafe} is a command line tool compatible with
Counterpane's Passwordsafe.")
      (license license:gpl2+))))

(define-public otpclient
  (package
    (name "otpclient")
    (version "4.0.2")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/paolostivanin/OTPClient")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "061idzh9sz556nm7ahjrvcbnbmgvgfwmph1lfiy7bcvj1g3rf8cm"))))
    (build-system cmake-build-system)
    (arguments
     (list
      #:modules `(((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
                  (guix build cmake-build-system)
                  (guix build utils))
      #:imported-modules `((guix build glib-or-gtk-build-system)
                           ,@%cmake-build-system-modules)
      #:tests? #f                        ; No tests
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'generate-gdk-pixbuf-loaders-cache-file
            (assoc-ref glib-or-gtk:%standard-phases
                       'generate-gdk-pixbuf-loaders-cache-file))
          (add-after 'install 'glib-or-gtk-compile-schemas
            (assoc-ref glib-or-gtk:%standard-phases
                       'glib-or-gtk-compile-schemas))
          (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
            (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
    (inputs (list adwaita-icon-theme
                  libcotp
                  libgcrypt
                  libsecret
                  libzip
                  hicolor-icon-theme
                  gtk+
                  jansson
                  protobuf
                  protobuf-c
                  qrencode
                  zbar))
    (native-inputs (list pkg-config protobuf))
    (home-page "https://github.com/paolostivanin/OTPClient")
    (synopsis "Two-factor authentication client")
    (description "OTPClient is a GTK+-based @acronym{OTP, One Time Password}
client, supporting @acronym{TOTP, Time-based one time passwords} and
@acronym{HOTP,HMAC-based one time passwords}.")
    (license license:gpl3)))

(define-public shroud
  (package
    (name "shroud")
    (version "0.1.2")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://files.dthompson.us/shroud/shroud-"
                                  version ".tar.gz"))
              (sha256
               (base32
                "1l2shrhvcwfzkar9qiwb75nhcqmx25iz55lzmz0c187nbjhqzi9p"))))
    (build-system gnu-build-system)
    (native-inputs
     (list pkg-config))
    (arguments
     `(#:modules ((guix build gnu-build-system)
                    (guix build utils)
                    (ice-9 popen)
                    (ice-9 rdelim))
       #:phases
       (modify-phases %standard-phases
         (add-after 'install 'wrap-shroud
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (let* ((out       (assoc-ref outputs "out"))
                    (guile (assoc-ref inputs "guile"))
                    (effective (read-line
                                (open-pipe* OPEN_READ
                                            (string-append guile "/bin/guile")
                                            "-c" "(display (effective-version))")))
                    (ccachedir (string-append out
                                             "/lib/guile/" effective "/site-ccache"))
                    (prog      (string-append out "/bin/shroud")))
               (wrap-program prog
                 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,ccachedir)))))))))
    (inputs (list bash-minimal guile-2.2 gnupg xclip))
    (synopsis "GnuPG-based secret manager")
    (description "Shroud is a simple secret manager with a command line
interface.  The password database is stored as a Scheme s-expression and
encrypted with a GnuPG key.  Secrets consist of an arbitrary number of
key/value pairs, making Shroud suitable for more than just password storage.
For copying and pasting secrets into web browsers and other graphical
applications, there is xclip integration." )
    (home-page "https://dthompson.us/projects/shroud.html")
    (license license:gpl3+)))

(define-public ssh-to-age
  (package
    (name "ssh-to-age")
    (version "1.1.7")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/Mic92/ssh-to-age")
             (commit version)))
       (file-name (git-file-name name version))
       (sha256
        (base32 "134gpbalyll238wvj9ci0rascgm4csayz863ci99cy5qq8266wrl"))))
    (build-system go-build-system)
    (arguments
     '(#:import-path "github.com/Mic92/ssh-to-age/cmd/ssh-to-age"
       #:unpack-path "github.com/Mic92/ssh-to-age"))
    (inputs (list go-golang-org-x-crypto
                  go-filippo-io-edwards25519
                  go-filippo-io-age))
    (home-page "https://github.com/Mic92/ssh-to-age")
    (synopsis "Convert SSH @code{ed25519} keys to @code{age} keys")
    (description "This package provides a simple command-line tool to
convert SSH @code{ed25519} keys to @code{age} keys.")
    (license license:expat)))

(define-public yapet
  (package
    (name "yapet")
    (version "2.6")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://yapet.guengel.ch/downloads/yapet-"
                           version ".tar.xz"))
       (sha256
        (base32 "00k38n5vlxl73m11pp1v50fqf702lv86hzwgj0qca6qxqz4i3jjl"))))
    (build-system gnu-build-system)
    (arguments
     `(#:configure-flags
       (list (string-append "--docdir=" (assoc-ref %outputs "out")
                            "/share/doc/" ,name "-" ,version))))
    (inputs
     (list argon2 ncurses openssl))
    (native-inputs
     (list cppunit pkg-config))
    (synopsis "Yet Another Password Encryption Tool")
    (description "YAPET is a text based password manager using the Blowfish
encryption algorithm.  Because of its small footprint and very few library
dependencies, it is suited for installing on desktop and server systems alike.
The text based user interface allows you to run YAPET easily in a Secure Shell
session.  Two companion utilities enable users to convert CSV files to YAPET
and vice versa.")
    (home-page "https://yapet.guengel.ch/")
    (license license:gpl3+)))

(define-public cracklib
  (package
    (name "cracklib")
    (version "2.9.8")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://github.com/cracklib/cracklib/"
                           "releases/download/v" version "/"
                           "cracklib-" version ".tar.bz2"))
       (sha256
        (base32 "11p3f0yqg9d32g3n1qik7jfyl2l14pf8i8vzq3bpram3bqw3978z"))))
    (build-system gnu-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'install 'install-dict
           (lambda* (#:key make-flags #:allow-other-keys)
             (begin
               (chmod (string-append "util/cracklib-format") #o755)
               (apply invoke "make" "dict" make-flags)
               #t))))))
    (synopsis "Password checking library")
    (home-page "https://github.com/cracklib/cracklib")
    (description
     "CrackLib is a library containing a C function which may be used in a
@command{passwd}-like program.  The idea is simple: try to prevent users from
choosing passwords that could easily be guessed (or \"cracked\") by filtering
them out, at the source.")
    (license license:lgpl2.1)))

(define-public libpwquality
  (package
    (name "libpwquality")
    (version "1.4.4")
    (source (origin
              (method url-fetch)
              (uri (list
                    (string-append "https://github.com/libpwquality/libpwquality"
                                   "/releases/download/libpwquality-" version
                                   "/libpwquality-" version ".tar.bz2")
                    (string-append "https://launchpad.net/libpwquality/trunk/"
                                   version "/+download/"
                                   "libpwquality-" version ".tar.bz2")))
              (sha256
               (base32
                "0id5a8bi8xnjg11g9vzrl2xbpx65mfxclxcvis7zx1v8vhisyfyl"))))
    (build-system gnu-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-before 'configure 'set-LDFLAGS
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (setenv "LDFLAGS"
                     (string-append
                      "-Wl,-rpath="
                      (assoc-ref outputs "out") "/lib"))
             #t)))))
    (native-inputs
     `(("python" ,python-wrapper)))
    (inputs
     (list cracklib))
    (synopsis "Password quality checker")
    (home-page "https://github.com/libpwquality/libpwquality")
    (description
     "Libpwquality is a library for password quality checking and generation of
random passwords that pass the checks.")
    (license license:gpl2+)))

(define-public passwdqc
  (package
    (name "passwdqc")
    (version "2.0.3")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://www.openwall.com/passwdqc/passwdqc"
                                  "-" version ".tar.gz"))
              (sha256
               (base32
                "1x4c92b3i5wmxh2111lynyndalpkryvan4wybqchd7rn96yg9c2k"))))
    (build-system gnu-build-system)
    (arguments
     (list
      #:tests? #f                       ; no tests provided
      #:make-flags
      #~(list (string-append "CC=" #$(cc-for-target))
              (string-append "DESTDIR=" #$output) ; no $prefix support
              "BINDIR=/bin"
              "DEVEL_LIBDIR=/lib"
              "SHARED_LIBDIR_REL=."
              "INCLUDEDIR=/include"
              "MANDIR=/share/man"
              (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
      #:phases
      #~(modify-phases %standard-phases
          (delete 'configure))))        ;no configure script
    (inputs (list linux-pam libxcrypt))
    (home-page "https://www.openwall.com/passwdqc/")
    (synopsis
     "Password/passphrase strength checking and policy enforcement toolset")
    (description
     "Passwdqc is a password/passphrase strength checking and policy
enforcement toolset, including an optional PAM module, @code{pam_passwdqc},
command-line programs (@command{pwqcheck}, @command{pwqfilter}, and
@command{pwqgen}), and a library, @code{libpasswdqc}.")
    (license (list license:bsd-3        ;manual pages
                   license:bsd-1))))    ;code

(define-public assword
  (package
    (name "assword")
    (version "0.11")
    (source (origin
              (method url-fetch)
              (uri (list
                    (string-append
                     "http://http.debian.net/debian/pool/main/a/assword/"
                     "assword_" version ".orig.tar.gz")))
              (sha256
               (base32
                "03gkb6kvsghznbcw5l7nmrc6mn3ixkjd5jcs96ni4zs9l47jf7yp"))))
    (arguments
     `(;; irritatingly, tests do run but not there are two problems:
       ;;  - "import gtk" fails for unknown reasons here despite it the
       ;;    program working (indeed, I've found I have to do a logout and log
       ;;    back in in after an install order for some mumbo jumbo environment
       ;;    variable mess to work with pygtk and assword... what's up with
       ;;    that?)
       ;;  - even when the tests fail, they don't return a nonzero status,
       ;;    so I'm not sure how to programmat