1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
3 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2015, 2016, 2017, 2019 Leo Famulari <leo@famulari.name>
5 ;;; Copyright © 2016, 2017, 2020, 2022 Marius Bakke <marius@gnu.org>
6 ;;; Copyright © 2017 Ben Sturmfels <ben@sturm.com.au>
7 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
8 ;;; Copyright © 2015 Cyril Roelandt <tipecaml@gmail.com>
9 ;;; Copyright © 2014, 2017 Eric Bavier <bavier@member.fsf.org>
10 ;;; Copyright © 2015, 2016 David Thompson <davet@gnu.org>
11 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
12 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
13 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
14 ;;; Copyright © 2015, 2016, 2017, 2019, 2022 Ricardo Wurmus <rekado@elephly.net>
15 ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
16 ;;; Copyright © 2016, 2017, 2020 Arun Isaac <arunisaac@systemreboot.net>
17 ;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
18 ;;; Copyright © 2018 Tomáš Čech <sleep_walker@gnu.org>
19 ;;; Copyright © 2018, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
20 ;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
21 ;;; Copyright © 2018 Nam Nguyen <namn@berkeley.edu>
22 ;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
23 ;;; Copyright © 2019 Clément Lassieur <clement@lassieur.org>
24 ;;; Copyright © 2020 Alexandros Theodotou <alex@zrythm.org>
25 ;;; Copyright © 2020 Justus Winter <justus@sequoia-pgp.org>
26 ;;; Copyright © 2020, 2021 Vinicius Monego <monego@posteo.net>
27 ;;; Copyright © 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
28 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
29 ;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
31 ;;; This file is part of GNU Guix.
33 ;;; GNU Guix is free software; you can redistribute it and/or modify it
34 ;;; under the terms of the GNU General Public License as published by
35 ;;; the Free Software Foundation; either version 3 of the License, or (at
36 ;;; your option) any later version.
38 ;;; GNU Guix is distributed in the hope that it will be useful, but
39 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
40 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41 ;;; GNU General Public License for more details.
43 ;;; You should have received a copy of the GNU General Public License
44 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
46 (define-module (gnu packages python-crypto)
47 #:use-module (guix packages)
48 #:use-module (guix download)
49 #:use-module (guix gexp)
50 #:use-module (guix git-download)
51 #:use-module (guix build-system cargo)
52 #:use-module (guix build-system python)
53 #:use-module (guix utils)
54 #:use-module (gnu packages)
55 #:use-module (gnu packages check)
56 #:use-module (gnu packages crates-io)
57 #:use-module (gnu packages crypto)
58 #:use-module (gnu packages kerberos)
59 #:use-module (gnu packages libffi)
60 #:use-module (gnu packages multiprecision)
61 #:use-module (gnu packages password-utils)
62 #:use-module (gnu packages protobuf)
63 #:use-module (gnu packages python)
64 #:use-module (gnu packages python-build)
65 #:use-module (gnu packages python-check)
66 #:use-module (gnu packages python-compression)
67 #:use-module (gnu packages python-web)
68 #:use-module (gnu packages python-xyz)
69 #:use-module (gnu packages rust)
70 #:use-module (gnu packages swig)
71 #:use-module (gnu packages time)
72 #:use-module (gnu packages tls)
73 #:use-module (gnu packages xml)
74 #:use-module ((guix licenses) #:prefix license:)
75 #:use-module (srfi srfi-1))
77 (define-public python-potr
86 (url "https://github.com/python-otr/pure-python-otr")
89 (git-file-name name version))
91 (base32 "1hzw6h01fm216nmipyylgz0zybd80w1xsk12m7djycnhqrnrvvv1"))))
92 (build-system python-build-system)
94 (list python-pycrypto))
95 (synopsis "Python OTR Implementation")
96 (description "Python OTR is an Off-The-Record Protocol Implementation in
97 Python. It does not bind to libotr.")
98 (home-page "https://github.com/python-otr/pure-python-otr")
99 (license license:lgpl3+)))
101 (define-public python-base58
103 (name "python-base58")
108 (uri (pypi-uri "base58" version))
111 "1317ly0db7nnjg5k58f6nqa0svfcvn446xd5bpiyi0bfbczwpl65"))))
112 (build-system python-build-system)
114 '(#:phases (modify-phases %standard-phases
116 (lambda* (#:key tests? #:allow-other-keys)
117 (when tests? (invoke "pytest" "-vv")))))))
119 (list python-pyhamcrest python-pytest python-pytest-benchmark))
120 (home-page "https://github.com/keis/base58")
121 (synopsis "Base58 and Base58Check implementation")
122 (description "Base58 and Base58Check implementation compatible
123 with what is used by the Bitcoin network.")
124 (license license:expat)))
126 (define-public python-bcrypt
128 (name "python-bcrypt")
133 (uri (pypi-uri "bcrypt" version))
135 (base32 "0agvzdn7r7jx5y4scl5gjmrmr6njvizwmr9n7h1kmaahdrrc34sv"))))
136 (build-system python-build-system)
138 (list python-pycparser python-pytest))
140 (list python-cffi python-six))
141 (home-page "https://github.com/pyca/bcrypt/")
143 "Modern password hashing library")
145 "Bcrypt is a Python module which provides a password hashing method based
146 on the Blowfish password hashing algorithm, as described in
147 @url{http://static.usenix.org/events/usenix99/provos.html,\"A Future-Adaptable
148 Password Scheme\"} by Niels Provos and David Mazieres.")
149 (license license:asl2.0)))
151 (define-public python-passlib
153 (name "python-passlib")
158 (uri (pypi-uri "passlib" version))
160 (base32 "015y5qaw9qnxr29lg60dml1g5rbqd4586wy5n8m41ib55gvm1zfy"))))
161 (build-system python-build-system)
165 (list python-bcrypt))
168 (modify-phases %standard-phases
169 (add-before 'check 'set-PYTHON_EGG_CACHE
170 ;; Some tests require access to "$HOME/.cython".
171 (lambda _ (setenv "PYTHON_EGG_CACHE" "/tmp"))))))
172 (home-page "https://bitbucket.org/ecollins/passlib")
173 (synopsis "Comprehensive password hashing framework")
175 "Passlib is a password hashing library for Python 2 & 3, which provides
176 cross-platform implementations of over 30 password hashing algorithms, as well
177 as a framework for managing existing password hashes. It's designed to be
178 useful for a wide range of tasks, from verifying a hash found in /etc/shadow,
179 to providing full-strength password hashing for multi-user application.")
180 (license license:bsd-3)))
182 (define-public python-pyblake2
184 (name "python-pyblake2")
189 (uri (pypi-uri "pyblake2" version))
192 "0gz9hgznv5zw4qjq43xa56y0yikimx30gffvibxzm0nv5sq7xk2w"))))
193 (build-system python-build-system)
194 (home-page "https://github.com/dchest/pyblake2")
195 (synopsis "BLAKE2 hash function for Python")
196 (description "BLAKE2 is a cryptographic hash function, which offers
197 stronger security while being as fast as MD5 or SHA-1, and comes in two
198 flavors: @code{BLAKE2b}, optimized for 64-bit platforms and produces digests
199 of any size between 1 and 64 bytes, and @code{BLAKE2s}, optimized for 8- to
200 32-bit platforms and produces digests of any size between 1 and 32 bytes.
202 This package provides a Python interface for BLAKE2.")
203 ;; The COPYING file declares it as public domain, with the option to
204 ;; alternatively use and redistribute it under a variety of permissive
205 ;; licenses. cc0 is explicitly mentioned in setup.py and pyblake2module.c.
206 (license (list license:public-domain license:cc0))))
208 (define-public python-paramiko
210 (name "python-paramiko")
215 (uri (pypi-uri "paramiko" version))
217 (base32 "0dahwq623jnna7gsr9j0mkwr9k2n1pvkapjryhcx508d5jxg8dkz"))))
218 (build-system python-build-system)
220 `(;; FIXME: Tests require many unpackaged libraries, see dev-requirements.txt.
223 (list python-bcrypt python-pyasn1 python-pynacl python-cryptography))
224 (home-page "https://www.paramiko.org/")
225 (synopsis "SSHv2 protocol library")
226 (description "Paramiko is a python implementation of the SSHv2 protocol,
227 providing both client and server functionality. While it leverages a Python C
228 extension for low level cryptography (PyCrypto), Paramiko itself is a pure
229 Python interface around SSH networking concepts.")
230 (license license:lgpl2.1+)))
232 (define-public python-ecdsa
234 (name "python-ecdsa")
239 (uri (pypi-uri "ecdsa" version))
241 (base32 "1ak8xa2r660d85abrlffp0bqvwdadg9ga4066g856hcy8fxh1xdr"))))
242 (build-system python-build-system)
245 (modify-phases %standard-phases
251 "not test_multithreading_with_interrupts"))))))
255 (list openssl python-pytest))
256 (home-page "https://github.com/warner/python-ecdsa")
257 (synopsis "ECDSA cryptographic signature library (pure python)")
259 "This is an easy-to-use implementation of ECDSA cryptography (Elliptic
260 Curve Digital Signature Algorithm), implemented purely in Python. With this
261 library, you can quickly create key pairs (signing key and verifying key), sign
262 messages, and verify the signatures. The keys and signatures are very short,
263 making them easy to handle and incorporate into other protocols.")
264 (license license:expat)))
266 ;;; Pycrypto is abandoned upstream:
268 ;;; https://github.com/dlitz/pycrypto/issues/173
270 ;;; TODO Remove this package from GNU Guix.
271 (define-public python-pycrypto
273 (name "python-pycrypto")
278 (uri (pypi-uri "pycrypto" version))
279 (patches (search-patches "python-pycrypto-CVE-2013-7459.patch"
280 "python-pycrypto-time-clock.patch"))
283 "0g0ayql5b9mkjam8hym6zyg6bv77lbh66rv1fyvgqb17kfc1xkpj"))))
284 (build-system python-build-system)
289 (modify-phases %standard-phases
290 (add-before 'build 'set-build-env
291 ;; pycrypto runs an autoconf configure script behind the scenes
292 (lambda _ (setenv "CONFIG_SHELL" (which "bash")) #t)))))
293 (home-page "https://www.dlitz.net/software/pycrypto/")
294 (synopsis "Cryptographic modules for Python")
296 "Pycrypto is a collection of both secure hash functions (such as SHA256
297 and RIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal,
298 etc.). The package is structured to make adding new modules easy.")
299 (license license:public-domain)))
301 (define-public python-kerberos
303 (name "python-kerberos")
308 (uri (pypi-uri "kerberos" version))
311 "19663qxmma0i8bfbjc2iwy5hgq0g4pfb75r023v5dps68zfvffgh"))))
312 (build-system python-build-system)
315 (home-page "https://github.com/apple/ccs-pykerberos")
317 "Python Kerberos library used by CalendarServer")
319 "This Python package is a high-level wrapper for Kerberos (GSSAPI)
320 operations. The goal is to avoid having to build a module that wraps the
321 entire Kerberos.framework, and instead offer a limited set of functions that
322 do what is needed for client/server Kerberos authentication based on
323 <http://www.ietf.org/rfc/rfc4559.txt>.")
324 (license license:asl2.0)))
326 (define-public python-keyring
328 (name "python-keyring")
333 (uri (pypi-uri "keyring" version))
336 "1pvqc6may03did0iz98gasg7cy4h8ljzs4ibh927bfzda8a3xjws"))))
337 (build-system python-build-system)
340 (modify-phases %standard-phases
342 (lambda* (#:key tests? #:allow-other-keys)
344 (invoke "pytest" "-vv" "-c" "/dev/null" "tests")))))))
349 python-setuptools-scm))
351 (list python-secretstorage))
352 (home-page "https://github.com/jaraco/keyring")
353 (synopsis "Store and access your passwords safely")
355 "The Python keyring lib provides a easy way to access the system keyring
356 service from python. It can be used in any application that needs safe
358 ;; "MIT" and PSF dual license
359 (license license:x11)))
361 (define-public python-keyrings.alt
363 (name "python-keyrings.alt")
368 (uri (pypi-uri "keyrings.alt" version))
371 "0gdjdqpq2hf770p6iwi891mil0vbsdhvy88x0v8b2w4y4b28lcli"))
372 (modules '((guix build utils)))
375 (delete-file "keyrings/alt/_win_crypto.py")
376 ;; Rely on python-keyring>20:
377 ;; https://github.com/jaraco/keyrings.alt/issues/33
378 (substitute* '("keyrings/alt/tests/test_Gnome.py"
379 "keyrings/alt/tests/test_Google.py"
380 "keyrings/alt/tests/test_Windows.py"
381 "keyrings/alt/tests/test_file.py"
382 "keyrings/alt/tests/test_pyfs.py")
383 (("keyring.tests.test_backend") "keyring.testing.backend")
384 (("keyring.tests.util") "keyring.testing.util"))
386 (build-system python-build-system)
388 (list python-keyring python-pytest python-setuptools-scm))
389 (home-page "https://github.com/jaraco/keyrings.alt")
390 (synopsis "Alternate keyring implementations")
391 (description "Keyrings in this package may have security risks or other
392 implications. These backends were extracted from the main keyring project to
393 make them available for those who wish to employ them, but are discouraged for
394 general production use. Include this module and use its backends at your own
396 (license license:expat)))
398 (define-public python-blake3
400 (name "python-blake3")
405 (uri (pypi-uri "blake3" version))
407 (base32 "1p6z6jfk8n1lshz4cp6dgz2i8zmqdxwr8d9m86ypp3m1kp70k5xk"))))
408 (build-system cargo-build-system)
412 #~(modify-phases %standard-phases
413 (add-after 'install 'build-python-module
415 ;; We don't use maturin.
416 (delete-file "pyproject.toml")
417 (call-with-output-file "pyproject.toml"
421 build-backend = 'setuptools.build_meta'
422 requires = ['setuptools']
424 (call-with-output-file "setup.cfg"
435 [options.packages.find]
442 ;; ZIP does not support timestamps before 1980.
443 (setenv "SOURCE_DATE_EPOCH" "315532800")
444 (invoke "python" "-m" "build" "--wheel" "--no-isolation" ".")))
445 (add-after 'build-python-module 'install-python-module
446 (lambda* (#:key outputs #:allow-other-keys)
447 (let ((whl (car (find-files "dist" "\\.whl$"))))
448 (invoke "pip" "--no-cache-dir" "--no-input"
449 "install" "--no-deps" "--prefix" #$output whl))))
450 (add-after 'install-python-module 'install-python-library
452 (let ((site (string-append #$output "/lib/python"
453 #$(version-major+minor
454 (package-version python))
457 (copy-file "target/release/libblake3.so"
458 (string-append site "/blake3.so"))))))
460 `(("rust-blake3" ,rust-blake3-1)
461 ("rust-hex" ,rust-hex-0.4)
462 ("rust-parking-lot" ,rust-parking-lot-0.11)
463 ("rust-pyo3" ,rust-pyo3-0.15)
464 ("rust-rayon" ,rust-rayon-1))))
465 (inputs (list rust-blake3-1))
470 (home-page "https://github.com/oconnor663/blake3-py")
471 (synopsis "Python bindings for the Rust blake3 crate")
472 (description "This package provides Python bindings for the Rust crate of
473 blake3, a cryptographic hash function.")
474 ;; This work is released into the public domain with CC0
475 ;; 1.0. Alternatively, it is licensed under the Apache License 2.0.
476 (license (list license:asl2.0 license:cc0))))
478 (define-public python-certauth
480 (name "python-certauth")
485 (uri (pypi-uri "certauth" version))
488 "1yxqfb5131wahjyw9pxz03bq476rcfx62s6k53xx4cqbzzgdaqkq"))))
489 (build-system python-build-system)
491 (list python-pyopenssl python-tldextract))
493 (list python-pytest-cov))
494 (home-page "https://github.com/ikreymer/certauth")
495 (synopsis "Certificate authority creation tool")
496 (description "This package provides a small library, built on top of
497 pyOpenSSL, which allows for creating a custom certificate authority (CA)
498 certificate, and generating on-demand dynamic host certs using that CA
499 certificate. It is most useful for use with a man-in-the-middle HTTPS proxy,
500 for example, for recording or replaying web content.")
501 (license license:expat)))
503 (define-public python-certifi
505 (name "python-certifi")
506 (version "2022.6.15")
509 (uri (pypi-uri "certifi" version))
512 "03c2l11lgljx0kz17cvdc4hlc3p1594ajdih9zq0a4dig285mj44"))))
513 (build-system python-build-system)
514 (arguments '(#:tests? #f)) ;no tests
515 (home-page "https://certifi.io/")
516 (synopsis "Python CA certificate bundle")
518 "Certifi is a Python library that contains a CA certificate bundle, which
519 is used by the Requests library to verify HTTPS requests.")
520 (license license:asl2.0)))
522 (define-public python-cryptography-vectors-next
524 (name "python-cryptography-vectors")
529 (uri (pypi-uri "cryptography_vectors" version))
532 "1a1yi37ygw0jp72q280cmxd3qn9y9vmcch2bcnjkg2g2202l0qas"))))
533 (build-system python-build-system)
534 (home-page "https://github.com/pyca/cryptography")
535 (synopsis "Test vectors for the cryptography package")
537 "This package contains test vectors for the cryptography package.")
538 ;; Distributed under either BSD-3 or ASL2.0
539 (license (list license:bsd-3 license:asl2.0))))
541 (define-public python-cryptography-vectors
543 (inherit python-cryptography-vectors-next)
547 (uri (pypi-uri "cryptography_vectors" version))
549 (base32 "1wl0ynh3lzhc6q59g8mybvijmnp195x7fjxlb3h3sgcraw14312c"))))))
551 (define-public python-cryptography-next
553 (name "python-cryptography")
558 (uri (pypi-uri "cryptography" version))
561 "10haq7sn8mrdlhcfs791rczknnxm0wpww0lkpjzcqx141ryc3yb3"))))
562 (build-system python-build-system)
565 #:imported-modules (append %cargo-build-system-modules
566 %python-build-system-modules)
567 #:modules `(((guix build cargo-build-system) #:prefix cargo:)
568 ,@%python-build-system-modules
572 #~(modify-phases (@ (guix build python-build-system) %standard-phases)
573 (add-after 'unpack 'adjust-pyo3-requirement
575 ;; The package depends on 0.15.2, which is not on crates.io(!?).
576 ;; Downgrade to 0.15.1...
577 (substitute* "src/rust/Cargo.toml"
578 (("pyo3 = \\{ version = \"0\\.15\\.2\"")
579 "pyo3 = { version = \"0.15.1\""))))
580 (add-before 'build 'configure-cargo
581 (lambda* (#:key inputs #:allow-other-keys)
582 ;; Hide irrelevant inputs from cargo-build-system so it does
583 ;; not try to unpack sanity-check.py, etc.
584 (let ((cargo-inputs (filter (match-lambda
586 (or (string-prefix? "rust-" name)
587 (string=? "gcc" name))))
589 (with-directory-excursion "src/rust"
590 ((assoc-ref cargo:%standard-phases 'unpack-rust-crates)
591 #:inputs cargo-inputs
592 #:vendor-dir "guix-vendor")
593 ((assoc-ref cargo:%standard-phases 'configure)
594 #:inputs cargo-inputs)
595 ((assoc-ref cargo:%standard-phases 'patch-cargo-checksums)
596 #:vendor-dir "guix-vendor"))
597 (rename-file "src/rust/.cargo" ".cargo"))))
599 (lambda* (#:key tests? #:allow-other-keys)
601 (invoke "pytest" "-vv" "tests")))))))
604 ;; TODO: Most of these inputs are transitive dependencies of
605 ;; the Rust requirements (see src/rust/cargo.toml). Surely
606 ;; there is a better way than manually listing everything..?
628 rust-ouroboros-macro-0.15
629 rust-parking-lot-0.11
630 rust-parking-lot-core-0.8
634 rust-proc-macro-error-1
635 rust-proc-macro-error-attr-1
636 rust-proc-macro-hack-0.5
639 rust-pyo3-build-config-0.15
640 rust-pyo3-macros-0.15
641 rust-pyo3-macros-backend-0.15
643 rust-redox-syscall-0.2
646 rust-stable-deref-trait-1
650 rust-version-check-0.9
653 (list python-asn1crypto python-cffi python-six python-idna
656 (list python-cryptography-vectors-next
661 python-pytest-benchmark
662 python-pytest-subtests
663 python-setuptools-rust
666 (home-page "https://github.com/pyca/cryptography")
667 (synopsis "Cryptographic recipes and primitives for Python")
669 "cryptography is a package which provides cryptographic recipes and
670 primitives to Python developers. It aims to be the “cryptographic standard
671 library” for Python. The package includes both high level recipes, and low
672 level interfaces to common cryptographic algorithms such as symmetric ciphers,
673 message digests and key derivation functions.")
674 ;; Distributed under either BSD-3 or ASL2.0
675 (license (list license:bsd-3 license:asl2.0))))
677 (define-public python-cryptography
679 (inherit python-cryptography-next)
683 (uri (pypi-uri "cryptography" version))
685 (base32 "072awar70cwfd2hnx0pvp1dkc7gw45mbm3wcyddvxz5frva5xk4l"))))
688 #~(modify-phases %standard-phases
689 (add-after 'unpack 'set-no-rust
691 (setenv "CRYPTOGRAPHY_DONT_BUILD_RUST" "1"))))))
692 (inputs (list openssl-1.1))
694 (list python-cryptography-vectors
699 python-setuptools-rust))))
701 ;; This is the last version which is compatable with python-cryptography < 35.
702 (define-public python-pyopenssl
704 (name "python-pyopenssl")
709 (uri (pypi-uri "pyOpenSSL" version))
712 "1cqcc20fwl521z3fxsc1c98gbnhb14q55vrvjfp6bn6h8rg8qbay"))
713 (patches (search-patches "python2-pyopenssl-openssl-compat.patch"))))
714 (build-system python-build-system)
718 #~(modify-phases %standard-phases
720 (lambda* (#:key tests? #:allow-other-keys)
722 ;; PyOpenSSL runs tests against a certificate with a fixed
723 ;; expiry time. To ensure successful builds in the future,
724 ;; set the time to roughly the release date.
725 (invoke "faketime" "2022-02-01" "py.test" "-v" "-k"
727 ;; This test tries to look up certificates from
728 ;; the compiled-in default path in OpenSSL, which
729 ;; does not exist in the build environment.
730 "not test_fallback_default_verify_paths "
731 ;; This test attempts to make a connection to
732 ;; an external web service.
733 "and not test_set_default_verify_paths "
734 ;; Fails on i686-linux and possibly other 32-bit platforms
735 ;; https://github.com/pyca/pyopenssl/issues/974
736 "and not test_verify_with_time"))))))))
738 (list python-cryptography python-six))
742 (list libfaketime python-flaky python-pretend python-pytest))
743 (home-page "https://github.com/pyca/pyopenssl")
744 (synopsis "Python wrapper module around the OpenSSL library")
746 "PyOpenSSL is a high-level wrapper around a subset of the OpenSSL
748 (license license:asl2.0)))
750 (define-public python-ed25519
752 (name "python-ed25519")
757 (uri (pypi-uri "ed25519" version))
760 "0ahx1nkxa0xis3cw0h5c4fpgv8mq4znkq7kajly33lc3317bk499"))))
761 (build-system python-build-system)
762 (home-page "https://github.com/warner/python-ed25519")
763 (synopsis "Ed25519 public-key signatures")
764 (description "Ed25519 public-key signatures")
765 (license license:expat)))
767 (define-public python-axolotl-curve25519
769 (name "python-axolotl-curve25519")
770 (version "0.4.1.post2")
774 (uri (pypi-uri "python-axolotl-curve25519" version))
777 "18v3rfyv7xi26fb97nw1xc0l6x8wi0i4xj8dlq4gblpbjxiac187"))))
778 (build-system python-build-system)
779 (home-page "https://github.com/tgalal/python-axolotl-curve25519")
780 (synopsis "Python wrapper for curve25519 library")
781 (description "This is a python wrapper for the curve25519 library
782 with ed25519 signatures. The C code was pulled from
783 libaxolotl-android. At the moment this wrapper is meant for use by
785 (license (list license:gpl3 ; Most files
786 license:bsd-3)))) ; curve/curve25519-donna.c
788 (define-public python-axolotl
790 (name "python-axolotl")
795 (uri (pypi-uri "python-axolotl" version))
798 "1bwdp24fmriffwx91aigs9k162albb51iskp23nc939z893q23py"))))
799 (build-system python-build-system)
802 (modify-phases %standard-phases
803 ;; Don't install tests
804 (add-before 'install 'remove-tests
806 (for-each delete-file-recursively
807 '("axolotl/tests" "build/lib/axolotl/tests"))
810 (list python-axolotl-curve25519 python-cryptography python-protobuf))
811 (home-page "https://github.com/tgalal/python-axolotl")
812 (synopsis "Python port of libaxolotl-android")
813 (description "This is a python port of libaxolotl-android. This
814 is a ratcheting forward secrecy protocol that works in synchronous and
815 asynchronous messaging environments.")
816 (license license:gpl3)))
819 (define-public python-pyaes
821 (name "python-pyaes")
826 (uri (pypi-uri "pyaes" version))
829 "13vdaff15k0jyfcss4b4xvfgm8xyv0nrbyw5n1qc7lrqbi0b3h82"))))
830 (build-system python-build-system)
831 (home-page "https://github.com/ricmoo/pyaes")
832 (synopsis "Implementation of AES in Python")
833 (description "This package contains a pure-Python implementation of the
834 AES block cipher algorithm and the common modes of operation (CBC, CFB, CTR,
836 (license license:expat)))
838 (define-public python-asn1crypto
840 (name "python-asn1crypto")
846 (url "https://github.com/wbond/asn1crypto")
848 (file-name (git-file-name name version))
851 "19abibn6jw20mzi1ln4n9jjvpdka8ygm4m439hplyrdfqbvgm01r"))))
852 (build-system python-build-system)
854 '(#:phases (modify-phases %standard-phases
857 (invoke "python" "run.py" "tests"))))))
858 (home-page "https://github.com/wbond/asn1crypto")
859 (synopsis "ASN.1 parser and serializer in Python")
860 (description "asn1crypto is an ASN.1 parser and serializer with definitions
861 for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7,
862 PKCS#8, PKCS#12, PKCS#5, X.509 and TSP.")
863 (license license:expat)))
865 (define-public python-pynacl
867 (name "python-pynacl")
872 (uri (pypi-uri "PyNaCl" version))
873 (modules '((guix build utils)))
876 ;; Remove spurious dependency on python-wheel, can be removed
878 (substitute* "setup.py"
880 ;; Remove bundled libsodium.
881 (delete-file-recursively "src/libsodium")))
884 "01b56hxrbif3hx8l6rwz5kljrgvlbj7shmmd2rjh0hn7974a5sal"))))
885 (build-system python-build-system)
888 (modify-phases %standard-phases
889 (add-before 'build 'use-system-sodium
891 (setenv "SODIUM_INSTALL" "system")))
894 (invoke "pytest" "-vv"))))))
896 (list python-hypothesis python-pytest))
898 (list python-cffi python-six libsodium))
899 (home-page "https://github.com/pyca/pynacl/")
900 (synopsis "Python bindings to libsodium")
902 "PyNaCl is a Python binding to libsodium, which is a fork of the
903 Networking and Cryptography library. These libraries have a stated goal
904 of improving usability, security and speed.")
905 (license license:asl2.0)))
907 (define-public python-blurhash
909 (name "python-blurhash")
913 ;; Tests not included in pypi release and releases not tagged in git repo.
916 (url "https://github.com/halcy/blurhash-python")
917 (commit "22e081ef1c24da1bb5c5eaa2c1d6649724deaef8")))
918 (file-name (git-file-name name version))
921 "1qq6mhydlp7q3na4kmaq3871h43wh3pyfyxr4b79bia73wjdylxf"))))
922 (build-system python-build-system)
925 (modify-phases %standard-phases
928 (delete-file "setup.cfg")
929 (invoke "pytest"))))))
931 (list python-numpy python-pillow python-pytest))
932 (home-page "https://github.com/halcy/blurhash-python")
934 "Pure-Python implementation of the blurhash algorithm")
936 "Pure-Python implementation of the blurhash algorithm.")
937 (license license:expat)))
939 (define-public python-ecpy
946 (uri (pypi-uri "ECPy" version))
949 "1gc3i5s93zq6x1nkaxkq1dvmsc12vmrw0hns9f5s1hcb78ni52c8"))))
950 (build-system python-build-system)
952 (list python-future))
953 (home-page "https://github.com/ubinity/ECPy")
954 (synopsis "Pure Python Elliptic Curve Library")
955 (description "This package provides a Elliptic Curve Library in pure
957 (license license:asl2.0)))
959 (define-public python-josepy
961 (name "python-josepy")
965 (uri (pypi-uri "josepy" version))
968 "1jaxqyp53paks2z8zyzr50gqvzfxbar7r2qf98kqak4aizrxlcc9"))))
969 (build-system python-build-system)
971 ;; TODO: some test dependencies are missing (see pyproject.toml).
974 (list python-cryptography python-pyopenssl))
975 (home-page "https://github.com/certbot/josepy")
976 (synopsis "JOSE protocol implementation in Python")
977 (description "This package provides a Python implementation of the JOSE
978 protocol (Javascript Object Signing and Encryption).")
979 (license license:asl2.0)))
981 (define pycryptodome-unbundle-tomcrypt-snippet
983 ;; Unbundle libtomcrypt.
984 (delete-file-recursively "src/libtom")
985 (substitute* "src/DES.c"
986 (("#include \"libtom/tomcrypt_des.c\"")
987 "#include <tomcrypt.h>"))
988 (substitute* "setup.py"
989 (("include_dirs=\\['src/', 'src/libtom/'\\]")
990 ;; FIXME: why does '-ltomcrypt' need to be added
991 ;; manually, even when 'tomcrypt' is added to 'libraries'?
992 ;; This behaviour is not documented at
993 ;; <https://docs.python.org/3/extending/building.html>.
994 "include_dirs=['src/'], libraries=['tomcrypt', 'tommath'],
995 extra_link_args=['-ltomcrypt', '-ltommath']"))))
997 (define-public python-pycryptodome
999 (name "python-pycryptodome")
1004 (uri (pypi-uri "pycryptodome" version))
1007 "1l3a80z3lxcj1q0hzj1d3plavy2d51y4vzcd85zj0zm7yyxrd022"))
1008 (modules '((guix build utils)))
1009 (snippet pycryptodome-unbundle-tomcrypt-snippet)))
1010 (build-system python-build-system)
1012 (list libtomcrypt libtommath))
1013 (home-page "https://www.pycryptodome.org")
1014 (synopsis "Low-level cryptographic Python library")
1016 "PyCryptodome is a self-contained Python package of low-level
1017 cryptographic primitives. It's not a wrapper to a separate C library like
1018 OpenSSL. To the largest possible extent, algorithms are implemented in pure
1019 Python. Only the pieces that are extremely critical to performance (e.g.,
1020 block ciphers) are implemented as C extensions.
1022 You are expected to have a solid understanding of cryptography and security
1023 engineering to successfully use these primitives. You must also be able to
1024 recognize that some are obsolete (e.g., TDES) or even insecure (RC4).
1026 It provides many enhancements over the last release of PyCrypto (2.6.1):
1029 @item Authenticated encryption modes (GCM, CCM, EAX, SIV, OCB)
1030 @item Accelerated AES on Intel platforms via AES-NI
1031 @item First-class support for PyPy
1032 @item Elliptic curves cryptography (NIST P-256 curve only)
1033 @item Better and more compact API (nonce and iv attributes for ciphers,
1034 automatic generation of random nonces and IVs, simplified CTR cipher mode, and
1036 @item SHA-3 (including SHAKE XOFs) and BLAKE2 hash algorithms
1037 @item Salsa20 and ChaCha20 stream ciphers
1038 @item scrypt and HKDF
1039 @item Deterministic (EC)DSA
1040 @item Password-protected PKCS#8 key containers
1041 @item Shamir’s Secret Sharing scheme
1042 @item Random numbers get sourced directly from the OS (and not from a CSPRNG
1044 @item Cleaner RSA and DSA key generation (largely based on FIPS 186-4)
1045 @item Major clean-ups and simplification of the code base
1048 This package provides drop-in compatibility with PyCrypto. It is one of two
1049 PyCryptodome variants, the other being python-pycryptodomex.")
1050 (license (list license:bsd-2
1051 license:public-domain)))) ; code inherited from PyCrypto
1053 (define-public python-pycryptodomex
1054 (package (inherit python-pycryptodome)
1055 (name "python-pycryptodomex")
1056 (version (package-version python-pycryptodome))
1060 (uri (pypi-uri "pycryptodomex" version))
1062 (base32 "0vcd65ylri2a4pdqcc1897jasj7wfmqklj8x3pdynmdvark3d603"))
1063 (modules '((guix build utils)))
1064 (snippet pycryptodome-unbundle-tomcrypt-snippet)))
1066 "PyCryptodome is a self-contained Python package of low-level
1067 cryptographic primitives. It's not a wrapper to a separate C library like
1068 OpenSSL. To the largest possible extent, algorithms are implemented in pure
1069 Python. Only the pieces that are extremely critical to performance (e.g.,
1070 block ciphers) are implemented as C extensions.
1072 You are expected to have a solid understanding of cryptography and security
1073 engineering to successfully use these primitives. You must also be able to
1074 recognize that some are obsolete (e.g., TDES) or even insecure (RC4).
1076 It provides many enhancements over the last release of PyCrypto (2.6.1):
1079 @item Authenticated encryption modes (GCM, CCM, EAX, SIV, OCB)
1080 @item Accelerated AES on Intel platforms via AES-NI
1081 @item First-class support for PyPy
1082 @item Elliptic curves cryptography (NIST P-256 curve only)
1083 @item Better and more compact API (nonce and iv attributes for ciphers,
1084 automatic generation of random nonces and IVs, simplified CTR cipher mode, and
1086 @item SHA-3 (including SHAKE XOFs) and BLAKE2 hash algorithms
1087 @item Salsa20 and ChaCha20 stream ciphers
1088 @item scrypt and HKDF
1089 @item Deterministic (EC)DSA
1090 @item Password-protected PKCS#8 key containers
1091 @item Shamir’s Secret Sharing scheme
1092 @item Random numbers get sourced directly from the OS (and not from a CSPRNG
1094 @item Cleaner RSA and DSA key generation (largely based on FIPS 186-4)
1095 @item Major clean-ups and simplification of the code base
1098 PyCryptodomex is the stand-alone version of PyCryptodome that no longer
1099 provides drop-in compatibility with PyCrypto.")))
1101 (define-public python-m2crypto
1103 (name "python-m2crypto")
1108 (uri (pypi-uri "M2Crypto" version))
1110 (base32 "09yirf3w77w6f49q6nxhrjm9c3a4y9s30s1k09chqrw8zdgx8sjc"))))
1111 (build-system python-build-system)
1113 `(;; FIXME: Tests start failing with time due to date checks in TLS
1116 (inputs (list openssl))
1117 (native-inputs (list swig))
1118 (home-page "https://gitlab.com/m2crypto/m2crypto")
1119 (synopsis "Python crypto and TLS toolkit")
1120 (description "@code{M2Crypto} is a complete Python wrapper for OpenSSL
1121 featuring RSA, DSA, DH, EC, HMACs, message digests, symmetric ciphers
1122 (including AES); TLS functionality to implement clients and servers; HTTPS
1123 extensions to Python's httplib, urllib, and xmlrpclib; unforgeable HMAC'ing
1124 AuthCookies for web session management; FTP/TLS client and server; S/MIME;
1125 M2Crypto can also be used to provide TLS for Twisted. Smartcards supported
1126 through the Engine interface.")
1127 (license license:expat)))
1129 (define-public python-pykeepass
1131 (name "python-pykeepass")
1136 ;; Source tarball on PyPI doesn't include tests.
1138 (url "https://github.com/libkeepass/pykeepass")
1140 (file-name (git-file-name name version))
1142 (base32 "1symxf4ahylynihnp9z4z3lh2vy65ipvg8s4hjrnn936hcaaxghk"))))
1143 (build-system python-build-system)
1146 (modify-phases %standard-phases
1147 (add-after 'unpack 'make-kdbx-writable
1148 ;; Tests have to write to the .kdbx files in the test directory.
1150 (with-directory-excursion "tests"
1151 (for-each make-file-writable (find-files "."))
1153 (add-before 'build 'patch-requirements
1155 ;; Update requirements from dependency==version
1156 ;; to dependency>=version.
1157 (substitute* "setup.py"
1161 (list python-argon2-cffi
1166 python-pycryptodomex))
1167 (home-page "https://github.com/libkeepass/pykeepass")
1168 (synopsis "Python library to interact with keepass databases")
1170 "This library allows you to write entries to a KeePass database. It
1171 supports KDBX3 and KDBX4.")
1172 ;; There are no copyright headers in the source code. The LICENSE file
1174 (license license:gpl3+)))
1176 (define-public python-pylibscrypt
1178 (name "python-pylibscrypt")
1183 (uri (pypi-uri "pylibscrypt" version))
1186 "1b3rgzl6dbzs08vhv41b6y4n5189wv7lr27acxn104hs45745abs"))))
1187 (build-system python-build-system)
1190 (modify-phases %standard-phases
1191 (add-before 'build 'hard-code-path-to-libscrypt
1192 (lambda* (#:key inputs #:allow-other-keys)
1193 (let ((libscrypt (assoc-ref inputs "libscrypt")))
1194 (substitute* "pylibscrypt/pylibscrypt.py"
1195 (("find_library\\('scrypt'\\)")
1196 (string-append "'" libscrypt "/lib/libscrypt.so'")))
1198 ;; The library can use various scrypt implementations and tests all of
1199 ;; them. Since we only provide a single implementation, most tests
1200 ;; fail. Simply skip them.
1202 ;; FIXME: Using "libscrypt" is the second best choice. The best one
1203 ;; requires "hashlib.scrypt", provided by Python 3.6+ built with OpenSSL
1204 ;; 1.1+. Use that as soon as Guix provides it.
1207 (home-page "https://github.com/jvarho/pylibscrypt")
1208 (synopsis "Scrypt for Python")
1209 (description "There are a lot of different scrypt modules for Python, but
1210 none of them have everything that I'd like, so here's one more. It uses
1212 (license license:isc)))
1214 (define-public python-libnacl
1216 (name "python-libnacl")
1221 (uri (pypi-uri "libnacl" version))
1224 "0srx7i264v4dq9and8y6gpzzhrg8jpxs5iy9ggw4plimfj0rjfdm"))))
1225 (build-system python-build-system)
1228 (modify-phases %standard-phases
1229 (add-after 'unpack 'locate-libsodium
1230 (lambda* (#:key inputs #:allow-other-keys)
1231 (substitute* "libnacl/__init__.py"
1232 (("/usr/local/lib/libsodium.so")
1233 (search-input-file inputs "/lib/libsodium.so"))))))))
1235 (list python-pyhamcrest))
1238 (home-page "https://libnacl.readthedocs.org/")
1239 (synopsis "Python bindings for libsodium based on ctypes")
1240 (description "@code{libnacl} is used to gain direct access to the
1241 functions exposed by @code{NaCl} library via @code{libsodium}. It has
1242 been constructed to maintain extensive documentation on how to use
1243 @code{NaCl} as well as being completely portable.")
1244 (license license:asl2.0)))
1246 (define-public python-pyotp
1248 (name "python-pyotp")
1253 (uri (pypi-uri "pyotp" version))
1255 (base32 "1dbcgpf576kmrpkx3ly8jq4g5g22r9n1rra55c1xqxyzl2mrz66f"))))
1256 (build-system python-build-system)
1257 (home-page "https://github.com/pyauth/pyotp")
1258 (synopsis "Python One Time Password Library")
1260 "PyOTP is a Python library for generating and verifying one-time
1261 passwords. It can be used to implement two-factor (2FA) or multi-factor
1262 (MFA) authentication methods in web applications and in other systems that
1263 require users to log in.")
1264 (license license:expat)))
1266 (define-public python-scrypt
1268 (name "python-scrypt")
1273 (uri (pypi-uri "scrypt" version))
1276 "0hjk71k3mgnl8siikm9lii9im8kv0rb7inkjzx78rnancra48xxr"))))
1277 (build-system python-build-system)
1280 (home-page "https://bitbucket.org/mhallin/py-scrypt")
1281 (synopsis "Bindings for the scrypt key derivation function library")
1282 (description "This is a set of Python bindings for the scrypt key
1283 derivation function.")
1284 (license license:bsd-2)))
1286 (define-public python-service-identity
1288 (name "python-service-identity")
1293 (uri (pypi-uri "service_identity" version))
1296 "0b9f5qiqjy8ralzgwjgkhx82h6h8sa7532psmb8mkd65md5aan08"))))
1297 (build-system python-build-system)
1299 (list python-attrs python-pyasn1 python-pyasn1-modules
1301 (home-page "https://service-identity.readthedocs.io/")
1302 (synopsis "Service identity verification for PyOpenSSL")
1304 "@code{service_identity} aspires to give you all the tools you need
1305 for verifying whether a certificate is valid for the intended purposes.
1306 In the simplest case, this means host name verification. However,
1307 service_identity implements RFC 6125 fully and plans to add other
1308 relevant RFCs too.")
1309 (license license:expat)))
1311 (define-public python-hkdf
1313 (name "python-hkdf")
1318 (uri (pypi-uri "hkdf" version))
1321 "1jhxk5vhxmxxjp3zj526ry521v9inzzl8jqaaf0ma65w6k332ak2"))))
1322 (build-system python-build-system)
1325 (home-page "https://github.com/casebeer/python-hkdf")
1326 (synopsis "HMAC-based Extract-and-Expand Key Derivation Function (HKDF)")
1327 (description "This package provides a Python implementation of the HMAC Key
1328 Derivation function (HKDF) defined in RFC 5869.")
1329 (license license:bsd-2)))
1331 (define-public python-spake2
1333 (name "python-spake2")
1338 (uri (pypi-uri "spake2" version))
1341 "1x16r7lrbklvfzbacb66qv9iiih6liq1y612dqh2chgf555n2yn1"))))
1342 (build-system python-build-system)
1345 (home-page "https://github.com/warner/python-spake2")
1346 (synopsis "SPAKE2 password-authenticated key exchange in Python")
1347 (description "This package provides a Python implementation of the SPAKE2
1348 Password-Authenticated Key Exchange algorithm.")
1349 (license license:expat)))
1351 (define-public python-txtorcon
1353 (name "python-txtorcon")
1358 (uri (pypi-uri "txtorcon" version))
1361 "0fxzhsc62bhmr730vj9pzallmw56gz6iykvl28a5agrycm0bfc9p"))))
1362 (build-system python-build-system)
1364 ;; The tests fail immediately due to a missing file. Reported upstream:
1365 ;; <https://github.com/meejah/txtorcon/issues/330>
1368 (list python-automat
1371 python-service-identity
1373 python-zope-interface))
1374 (home-page "https://github.com/meejah/txtorcon")
1375 (synopsis "Twisted-based Tor controller client")
1376 (description "This package provides a Twisted-based Tor controller client,
1377 with state-tracking and configuration abstractions.")
1378 (license license:expat)))
1380 (define-public python-keyutils
1382 (name "python-keyutils")
1387 (uri (pypi-uri "keyutils" version))
1390 "0lipygpzhwzzsq2k5imb1jgkmj8y4khxdwhzadjs3bd56g6bmkx9"))))
1391 (build-system python-build-system)
1393 (list python-pytest python-pytest-runner))
1398 (home-page "https://github.com/sassoftware/python-keyutils")
1399 (synopsis "Python bindings for keyutils")
1401 "This is a set of python bindings for keyutils, a key management suite
1402 that leverages the infrastructure provided by the Linux kernel for safely
1403 storing and retrieving sensitive information in your programs.")
1404 (license license:asl2.0)))
1406 (define-public python-mcuboot-imgtool
1408 (name "python-mcuboot-imgtool")
1414 (url "https://github.com/JuulLabs-OSS/mcuboot")
1415 (commit (string-append "v" version))))
1416 (file-name (git-file-name name version))
1419 "1m1csyvzq4jx81zg635ssy1n7sc0z539z0myh872ll3nwqx7wa0q"))))
1420 (build-system python-build-system)
1423 (modify-phases %standard-phases
1424 (add-after 'unpack 'fix-broken-test
1426 (substitute* "scripts/imgtool/keys/ed25519_test.py"
1427 (("raw_sign") "sign_digest"))
1429 (add-before 'build 'change-directory
1434 (list python-click python-intelhex python-cryptography))
1435 (home-page "https://mcuboot.com")
1436 (synopsis "Tool to securely sign firmware images for booting by MCUboot")
1437 (description "MCUboot is a secure bootloader for 32-bit MCUs. This
1438 package provides a tool to securely sign firmware images for booting by
1440 (license license:expat)))
1442 (define-public python-ntlm-auth
1444 (name "python-ntlm-auth")
1449 (uri (pypi-uri "ntlm-auth" version))
1452 "16mavidki4ma5ip8srqalr19gz4f5yn3cnmmgps1fmgfr24j63rm"))))
1453 (build-system python-build-system)
1455 (list python-cryptography))
1456 (home-page "https://github.com/jborean93/ntlm-auth")
1458 "Calculates NTLM Authentication codes")
1460 "This library handles the low-level details of NTLM authentication for
1461 use in authenticating with a service that uses NTLM. It will create and parse
1462 the 3 different message types in the order required and produce a base64
1463 encoded value that can be attached to the HTTP header.
1465 The goal of this library is to offer full NTLM support including signing and
1466 sealing of messages as well as supporting MIC for message integrity and the
1467 ability to customise and set limits on the messages sent. Please see Features
1468 and Backlog for a list of what is and is not currently supported.")
1469 (license license:expat)))
1471 (define-public python-secretstorage
1473 (name "python-secretstorage")
1478 (uri (pypi-uri "SecretStorage" version))
1481 "15ginv4gzxrx77n7517xnvf2jcpqc6ran12s951hc85zlr8nqrpx"))))
1482 (build-system python-build-system)
1484 '(#:tests? #f)) ; Tests require a running dbus service.
1486 (list python-cryptography python-jeepney))
1487 (home-page "https://github.com/mitya57/secretstorage")
1488 (synopsis "Python bindings to FreeDesktop.org Secret Service API")
1490 "@code{python-secretstorage} provides a way for securely storing passwords
1491 and other secrets. It uses D-Bus Secret Service API that is supported by GNOME
1492 Keyring (since version 2.30) and KSecretsService. SecretStorage supports most
1493 of the functions provided by Secret Service, including creating and deleting
1494 items and collections, editing items, locking and unlocking collections
1495 (asynchronous unlocking is also supported).")
1496 (license license:bsd-3)))
1498 (define-public python-trustme
1500 (name "python-trustme")
1505 (uri (pypi-uri "trustme" version))
1507 (base32 "0v3vr5z6apnfmklf07m45kv5kaqvm6hxrkaqywch57bjd2siiywx"))))
1508 (build-system python-build-system)
1511 (modify-phases %standard-phases
1513 (lambda* (#:key inputs outputs #:allow-other-keys)
1514 (add-installed-pythonpath inputs outputs)
1515 (invoke "pytest" "-vv"))))))
1517 (list python-more-itertools
1521 python-service-identity
1524 (list python-cryptography))
1525 (home-page "https://github.com/python-trio/trustme")
1526 (synopsis "Fake a certificate authority for tests")
1528 "@code{trustme} is a tiny Python package that does one thing: it gives you
1529 a fake certificate authority (CA) that you can use to generate fake TLS certs to
1530 use in your tests.")
1531 ;; Either license applies.
1532 (license (list license:expat license:asl2.0))))
1534 (define-public python-certipy
1536 (name "python-certipy")
1541 (uri (pypi-uri "certipy" version))
1544 "0n980gqpzh0fm58h3i4mi2i10wgj606lscm1r5sk60vbf6vh8mv9"))))
1545 (build-system python-build-system)
1547 (list python-pyopenssl))
1549 (list python-pytest))
1550 (home-page "https://github.com/LLNL/certipy")
1551 (synopsis "Utility to create and sign CAs and certificates")
1553 "Certipy was made to simplify the certificate creation process. To that
1554 end, certipy exposes methods for creating and managing certificate authorities,
1555 certificates, signing and building trust bundles.")
1556 (license license:bsd-3)))
1558 (define-public python-jeepney
1560 (name "python-jeepney")
1565 (uri (pypi-uri "jeepney" version))
1567 (base32 "0mw6ch5s4czpmsiwqwhcidgk27858pl8vlvb7acrxjkm4ribcnbx"))))
1568 (build-system python-build-system)
1570 (list python-testpath python-tornado python-trio python-pytest
1571 python-pytest-trio))
1572 (home-page "https://gitlab.com/takluyver/jeepney")
1573 (synopsis "Low-level, pure Python DBus protocol wrapper")
1575 "This is a low-level, pure Python DBus protocol client. It has an
1576 I/O-free core, and integration modules for different event loops.")
1577 (license license:expat)))
1579 (define-public python-argon2-cffi
1581 (name "python-argon2-cffi")
1586 (uri (pypi-uri "argon2-cffi" version))
1589 "0zgr4mnnm0p4i99023safb0qb8cgvl202nly1rvylk2b7qnrn0nq"))
1590 (modules '((guix build utils)))
1591 (snippet '(begin (delete-file-recursively "extras") #t))))
1592 (build-system python-build-system)
1595 (modify-phases %standard-phases
1598 (setenv "ARGON2_CFFI_USE_SYSTEM" "1")
1599 (invoke "python" "setup.py" "build")))
1601 (lambda* (#:key inputs outputs #:allow-other-keys)
1602 (add-installed-pythonpath inputs outputs)
1604 (invoke "python" "-m" "argon2" "--help")
1606 (invoke "python" "-m" "argon2" "-n" "1" "-t" "1" "-m" "8" "-p" "1"))))))
1608 (list python-cffi python-six))
1609 (inputs (list argon2))
1611 (list python-hypothesis python-pytest))
1612 (home-page "https://argon2-cffi.readthedocs.io/")
1613 (synopsis "Secure Password Hashes for Python")
1615 "Argon2 is a secure password hashing algorithm. It is designed to have
1616 both a configurable runtime as well as memory consumption. This means that you
1617 can decide how long it takes to hash a password and how much memory is required.")
1618 (license license:expat)))
1620 (define-public python-privy
1622 (name "python-privy")
1628 ;; Releases are untagged
1629 (url "https://github.com/ofek/privy")
1630 (commit "2838db3df239797c71bddacc48a4c49a83f35747")))
1631 (file-name (git-file-name name version))
1634 "1m32dh5fqc8cy7jyf1z5fs6zvmdkbq5fi98hr609gbl7s0l0y0i9"))))
1635 (build-system python-build-system)
1638 (modify-phases %standard-phases
1641 (invoke "python" "-m" "pytest"))))))
1643 (list python-pytest))
1645 (list python-argon2-cffi python-cryptography))
1646 (home-page "https://www.dropbox.com/developers")
1647 (synopsis "Library to password-protect your data")
1649 "Privy is a small and fast utility for password-protecting secret
1650 data such as API keys, cryptocurrency wallets, or seeds for digital
1652 (license (list license:expat license:asl2.0)))) ; dual licensed
1654 (define-public python-pgpy
1656 (name "python-pgpy")
1661 (uri (pypi-uri "PGPy" version))
1663 (base32 "11rrq15gmn6qbahli7czflfcngjl7zyybjlvk732my6axnf2d754"))))
1664 (build-system python-build-system)
1667 (modify-phases %standard-phases
1669 (lambda* (#:key tests? #:allow-other-keys)
1671 (invoke "pytest")))))))
1675 (propagated-inputs (list python-cryptography python-pyasn1
1676 python-singledispatch python-six))
1677 (home-page "https://github.com/SecurityInnovation/PGPy")
1678 (synopsis "Python implementation of OpenPGP")
1680 "Currently, PGPy can load keys and signatures of all kinds in both ASCII
1681 armored and binary formats.
1683 It can create and verify RSA, DSA, and ECDSA signatures, at the moment. It
1684 can also encrypt and decrypt messages using RSA and ECDH.")
1685 (license license:bsd-3)))
1687 (define-public python-pyu2f
1689 (name "python-pyu2f")
1694 (uri (pypi-uri "pyu2f" version))
1696 (base32 "0srhzdbgdsqwpcw7awqm19yg3xbabqckfvrp8rbpvz2232hs7jm3"))))
1697 (build-system python-build-system)
1698 (arguments '(#:tests? #f)) ;none included
1699 (propagated-inputs (list python-six))
1700 (home-page "https://github.com/google/pyu2f/")
1701 (synopsis "U2F host library for interacting with a U2F device over USB")
1703 "Pyu2f is a Python-based U2F host library. It provides functionality for
1704 interacting with a U2F device over USB.")
1705 (license license:asl2.0)))
1707 (define-public python-sop
1714 (uri (pypi-uri "sop" version))
1717 "0gljyjsdn6hdmwlwwb5g5s0c031p6izamvfxp0d39x60af8k5jyf"))))
1718 (build-system python-build-system)
1720 '(#:tests? #f)) ; There are no tests, and unittest throws an error trying
1722 ; TypeError: don't know how to make test from: 0.2.0
1723 (home-page "https://gitlab.com/dkg/python-sop")
1724 (synopsis "Stateless OpenPGP Command-Line Interface")
1726 "The Stateless OpenPGP Command-Line Interface (or sop) is a
1727 specification that encourages OpenPGP implementors to provide a common,
1728 relatively simple command-line API for purposes of object security.
1730 This Python module helps implementers build such a CLI from any implementation
1731 accessible to the Python interpreter.
1733 It does not provide such an implementation itself -- this is just the
1734 scaffolding for the command line, which should make it relatively easy to
1735 supply a handful of python functions as methods to a class.")
1736 (license license:expat))) ; MIT license
1738 (define-public python-starkbank-ecdsa
1740 (name "python-starkbank-ecdsa")
1742 (home-page "https://github.com/starkbank/ecdsa-python")
1747 (commit (string-append "v" version))))
1748 (file-name (git-file-name name version))
1751 "1k9h4p0frkgj76vrqfjim4mik98g09mivdxxcmxr6raa5jwr83sh"))))
1753 (list #:phases #~(modify-phases %standard-phases
1754 (add-after 'unpack 'remove-broken-test
1756 (delete-file "tests/testOpenSSL.py"))))))
1757 (build-system python-build-system)
1758 (native-inputs (list python-pytest))
1759 (synopsis "Python ECDSA library")
1760 (description "This package provides a Python ECDSA library, optimized for
1761 speed but without C extensions.")
1762 (license license:expat)))
1764 (define-public python-zxcvbn
1766 (name "python-zxcvbn")
1769 (method git-fetch) ;for tests
1771 (url "https://github.com/dwolfhub/zxcvbn-python")
1772 (commit (string-append "v" version))))
1773 (file-name (git-file-name name version))
1776 "0xzlsqc9h0llfy19w4m39jgfcnvzqviv8jhgwn3r75kip97i5mvs"))))
1777 (build-system python-build-system)
1778 (home-page "https://github.com/dwolfhub/zxcvbn-python")
1779 (synopsis "Realistic password strength estimator Python library")
1780 (description "This is a Python implementation of the @code{zxcvbn} library
1781 created at Dropbox. The original library, written for JavaScript, can be
1782 found @url{https://github.com/dropbox/zxcvbn, here}. This port includes
1785 @item Accepts user data to be added to the dictionaries that are tested
1786 against (name, birthdate, etc.)
1787 @item Gives a score to the password, from 0 (terrible) to 4 (great).
1788 @item Provides feedback on the password and ways to improve it.
1789 @item Returns time estimates on how long it would take to guess the password
1790 in different situations.
1792 (license license:expat)))