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 Marius Bakke <mbakke@fastmail.com>
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 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 Maxim Cournoyer <maxim.cournoyer@gmail.com>
28 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
30 ;;; This file is part of GNU Guix.
32 ;;; GNU Guix is free software; you can redistribute it and/or modify it
33 ;;; under the terms of the GNU General Public License as published by
34 ;;; the Free Software Foundation; either version 3 of the License, or (at
35 ;;; your option) any later version.
37 ;;; GNU Guix is distributed in the hope that it will be useful, but
38 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
39 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40 ;;; GNU General Public License for more details.
42 ;;; You should have received a copy of the GNU General Public License
43 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
45 (define-module (gnu packages python-crypto)
46 #:use-module (guix packages)
47 #:use-module (guix download)
48 #:use-module (guix gexp)
49 #:use-module (guix git-download)
50 #:use-module (guix build-system python)
51 #:use-module (gnu packages)
52 #:use-module (gnu packages check)
53 #:use-module (gnu packages crypto)
54 #:use-module (gnu packages kerberos)
55 #:use-module (gnu packages libffi)
56 #:use-module (gnu packages multiprecision)
57 #:use-module (gnu packages password-utils)
58 #:use-module (gnu packages protobuf)
59 #:use-module (gnu packages python)
60 #:use-module (gnu packages python-build)
61 #:use-module (gnu packages python-check)
62 #:use-module (gnu packages python-compression)
63 #:use-module (gnu packages python-web)
64 #:use-module (gnu packages python-xyz)
65 #:use-module (gnu packages swig)
66 #:use-module (gnu packages time)
67 #:use-module (gnu packages tls)
68 #:use-module (gnu packages xml)
69 #:use-module ((guix licenses) #:prefix license:)
70 #:use-module (srfi srfi-1))
72 (define-public python-potr
81 (url "https://github.com/python-otr/pure-python-otr")
84 (git-file-name name version))
86 (base32 "1hzw6h01fm216nmipyylgz0zybd80w1xsk12m7djycnhqrnrvvv1"))))
87 (build-system python-build-system)
89 `(("python-pycrypto" ,python-pycrypto)))
90 (synopsis "Python OTR Implementation")
91 (description "Python OTR is an Off-The-Record Protocol Implementation in
92 Python. It does not bind to libotr.")
93 (home-page "https://github.com/python-otr/pure-python-otr")
94 (license license:lgpl3+)))
96 (define-public python-base58
98 (name "python-base58")
103 (uri (pypi-uri "base58" version))
106 "0yfaqp76kbdb62hikr5n4jkkfjfmii89grwfy6sw3fmsv5hrap1n"))))
107 (build-system python-build-system)
109 `(("python-pyhamcrest" ,python-pyhamcrest)))
110 (home-page "https://github.com/keis/base58")
111 (synopsis "Base58 and Base58Check implementation")
112 (description "Base58 and Base58Check implementation compatible
113 with what is used by the Bitcoin network.")
114 (license license:expat)))
116 (define-public python-bcrypt
118 (name "python-bcrypt")
123 (uri (pypi-uri "bcrypt" version))
125 (base32 "0agvzdn7r7jx5y4scl5gjmrmr6njvizwmr9n7h1kmaahdrrc34sv"))))
126 (build-system python-build-system)
128 `(("python-pycparser" ,python-pycparser)
129 ("python-pytest" ,python-pytest)))
131 `(("python-cffi" ,python-cffi)
132 ("python-six" ,python-six)))
133 (home-page "https://github.com/pyca/bcrypt/")
135 "Modern password hashing library")
137 "Bcrypt is a Python module which provides a password hashing method based
138 on the Blowfish password hashing algorithm, as described in
139 @url{http://static.usenix.org/events/usenix99/provos.html,\"A Future-Adaptable
140 Password Scheme\"} by Niels Provos and David Mazieres.")
141 (license license:asl2.0)))
143 (define-public python-passlib
145 (name "python-passlib")
150 (uri (pypi-uri "passlib" version))
152 (base32 "015y5qaw9qnxr29lg60dml1g5rbqd4586wy5n8m41ib55gvm1zfy"))))
153 (build-system python-build-system)
155 `(("python-nose" ,python-nose)))
157 `(("python-bcrypt" ,python-bcrypt)))
160 (modify-phases %standard-phases
161 (add-before 'check 'set-PYTHON_EGG_CACHE
162 ;; Some tests require access to "$HOME/.cython".
163 (lambda _ (setenv "PYTHON_EGG_CACHE" "/tmp"))))))
164 (home-page "https://bitbucket.org/ecollins/passlib")
165 (synopsis "Comprehensive password hashing framework")
167 "Passlib is a password hashing library for Python 2 & 3, which provides
168 cross-platform implementations of over 30 password hashing algorithms, as well
169 as a framework for managing existing password hashes. It's designed to be
170 useful for a wide range of tasks, from verifying a hash found in /etc/shadow,
171 to providing full-strength password hashing for multi-user application.")
172 (license license:bsd-3)))
174 (define-public python-pyblake2
176 (name "python-pyblake2")
181 (uri (pypi-uri "pyblake2" version))
184 "0gz9hgznv5zw4qjq43xa56y0yikimx30gffvibxzm0nv5sq7xk2w"))))
185 (build-system python-build-system)
186 (home-page "https://github.com/dchest/pyblake2")
187 (synopsis "BLAKE2 hash function for Python")
188 (description "BLAKE2 is a cryptographic hash function, which offers
189 stronger security while being as fast as MD5 or SHA-1, and comes in two
190 flavors: @code{BLAKE2b}, optimized for 64-bit platforms and produces digests
191 of any size between 1 and 64 bytes, and @code{BLAKE2s}, optimized for 8- to
192 32-bit platforms and produces digests of any size between 1 and 32 bytes.
194 This package provides a Python interface for BLAKE2.")
195 ;; The COPYING file declares it as public domain, with the option to
196 ;; alternatively use and redistribute it under a variety of permissive
197 ;; licenses. cc0 is explicitly mentioned in setup.py and pyblake2module.c.
198 (license (list license:public-domain license:cc0))))
200 (define-public python-paramiko
202 (name "python-paramiko")
207 (uri (pypi-uri "paramiko" version))
209 (base32 "0dahwq623jnna7gsr9j0mkwr9k2n1pvkapjryhcx508d5jxg8dkz"))))
210 (build-system python-build-system)
212 `(;; FIXME: Tests require many unpackaged libraries, see dev-requirements.txt.
215 `(("python-bcrypt" ,python-bcrypt)
216 ("python-pyasn1" ,python-pyasn1)
217 ("python-pynacl" ,python-pynacl)
218 ("python-cryptography" ,python-cryptography)))
219 (home-page "https://www.paramiko.org/")
220 (synopsis "SSHv2 protocol library")
221 (description "Paramiko is a python implementation of the SSHv2 protocol,
222 providing both client and server functionality. While it leverages a Python C
223 extension for low level cryptography (PyCrypto), Paramiko itself is a pure
224 Python interface around SSH networking concepts.")
225 (license license:lgpl2.1+)))
227 (define-public python-ecdsa
229 (name "python-ecdsa")
234 (uri (pypi-uri "ecdsa" version))
236 (base32 "13nx5cbfxc0gnax5zwdmp9xc40qd1llk62mv85jyrvqkbw017ik4"))))
237 (build-system python-build-system)
240 (modify-phases %standard-phases
242 (lambda _ (invoke "pytest"))))))
244 `(("python-six" ,python-six)))
246 `(("openssl" ,openssl)
247 ("python-pytest" ,python-pytest)))
248 (home-page "https://github.com/warner/python-ecdsa")
249 (synopsis "ECDSA cryptographic signature library (pure python)")
251 "This is an easy-to-use implementation of ECDSA cryptography (Elliptic
252 Curve Digital Signature Algorithm), implemented purely in Python. With this
253 library, you can quickly create key pairs (signing key and verifying key), sign
254 messages, and verify the signatures. The keys and signatures are very short,
255 making them easy to handle and incorporate into other protocols.")
256 (license license:expat)))
258 (define-public python2-ecdsa
259 (package-with-python2 python-ecdsa))
261 ;;; Pycrypto is abandoned upstream:
263 ;;; https://github.com/dlitz/pycrypto/issues/173
265 ;;; TODO Remove this package from GNU Guix.
266 (define-public python-pycrypto
268 (name "python-pycrypto")
273 (uri (pypi-uri "pycrypto" version))
274 (patches (search-patches "python-pycrypto-CVE-2013-7459.patch"
275 "python-pycrypto-time-clock.patch"))
278 "0g0ayql5b9mkjam8hym6zyg6bv77lbh66rv1fyvgqb17kfc1xkpj"))))
279 (build-system python-build-system)
285 (modify-phases %standard-phases
286 (add-before 'build 'set-build-env
287 ;; pycrypto runs an autoconf configure script behind the scenes
288 (lambda _ (setenv "CONFIG_SHELL" (which "bash")) #t)))))
289 (home-page "https://www.dlitz.net/software/pycrypto/")
290 (synopsis "Cryptographic modules for Python")
292 "Pycrypto is a collection of both secure hash functions (such as SHA256
293 and RIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal,
294 etc.). The package is structured to make adding new modules easy.")
295 (license license:public-domain)))
297 (define-public python2-pycrypto
298 (let ((pycrypto (package-with-python2 python-pycrypto)))
299 (package/inherit pycrypto
301 `(("python" ,python-2)
304 (package-inputs pycrypto)))))))
306 (define-public python-kerberos
308 (name "python-kerberos")
313 (uri (pypi-uri "kerberos" version))
316 "19663qxmma0i8bfbjc2iwy5hgq0g4pfb75r023v5dps68zfvffgh"))))
317 (build-system python-build-system)
319 `(("mit-krb5" ,mit-krb5)))
320 (home-page "https://github.com/apple/ccs-pykerberos")
322 "Python Kerberos library used by CalendarServer")
324 "This Python package is a high-level wrapper for Kerberos (GSSAPI)
325 operations. The goal is to avoid having to build a module that wraps the
326 entire Kerberos.framework, and instead offer a limited set of functions that
327 do what is needed for client/server Kerberos authentication based on
328 <http://www.ietf.org/rfc/rfc4559.txt>.")
329 (license license:asl2.0)))
331 (define-public python-keyring
333 (name "python-keyring")
338 (uri (pypi-uri "keyring" version))
341 "1pvqc6may03did0iz98gasg7cy4h8ljzs4ibh927bfzda8a3xjws"))))
342 (build-system python-build-system)
345 (modify-phases %standard-phases
347 (lambda* (#:key tests? #:allow-other-keys)
352 `(("python-toml" ,python-toml)
353 ("python-pytest" ,python-pytest)
354 ("python-pytest-checkdocs" ,python-pytest-checkdocs)
355 ("python-pytest-cov" ,python-pytest-cov)
356 ("python-pytest-flake8" ,python-pytest-flake8)
357 ("python-setuptools" ,python-setuptools)
358 ("python-setuptools-scm" ,python-setuptools-scm)))
360 `(("python-secretstorage" ,python-secretstorage)))
361 (home-page "https://github.com/jaraco/keyring")
362 (synopsis "Store and access your passwords safely")
364 "The Python keyring lib provides a easy way to access the system keyring
365 service from python. It can be used in any application that needs safe
367 ;; "MIT" and PSF dual license
368 (properties `((python2-variant . ,(delay python2-keyring))))
369 (license license:x11)))
371 (define-public python2-keyring
372 (let ((keyring (package-with-python2
373 (strip-python2-variant python-keyring))))
376 (name "python2-keyring")
381 (uri (pypi-uri "keyring" version))
384 "0482rmi2x6p78wl2kz8qzyq21xz1sbbfwnv5x7dggar4vkwxhzfx"))))
386 `(#:python ,python-2))
388 `(("python2-pytest" ,python2-pytest)
389 ("python2-pytest-runner" ,python2-pytest-runner)
390 ("python2-setuptools-scm" ,python2-setuptools-scm)))
392 `(("python2-pycrypto" ,python2-pycrypto))))))
394 (define-public python-keyrings.alt
396 (name "python-keyrings.alt")
401 (uri (pypi-uri "keyrings.alt" version))
404 "0gdjdqpq2hf770p6iwi891mil0vbsdhvy88x0v8b2w4y4b28lcli"))
405 (modules '((guix build utils)))
408 (delete-file "keyrings/alt/_win_crypto.py")
409 ;; Rely on python-keyring>20:
410 ;; https://github.com/jaraco/keyrings.alt/issues/33
411 (substitute* '("keyrings/alt/tests/test_Gnome.py"
412 "keyrings/alt/tests/test_Google.py"
413 "keyrings/alt/tests/test_Windows.py"
414 "keyrings/alt/tests/test_file.py"
415 "keyrings/alt/tests/test_pyfs.py")
416 (("keyring.tests.test_backend") "keyring.testing.backend")
417 (("keyring.tests.util") "keyring.testing.util"))
419 (build-system python-build-system)
421 `(("python-keyring" ,python-keyring)
422 ("python-pytest" ,python-pytest)
423 ("python-setuptools-scm" ,python-setuptools-scm)))
424 (home-page "https://github.com/jaraco/keyrings.alt")
425 (synopsis "Alternate keyring implementations")
426 (description "Keyrings in this package may have security risks or other
427 implications. These backends were extracted from the main keyring project to
428 make them available for those who wish to employ them, but are discouraged for
429 general production use. Include this module and use its backends at your own
431 (license license:expat)))
433 (define-public python-certauth
435 (name "python-certauth")
440 (uri (pypi-uri "certauth" version))
443 "1yxqfb5131wahjyw9pxz03bq476rcfx62s6k53xx4cqbzzgdaqkq"))))
444 (build-system python-build-system)
446 `(("python-pyopenssl" ,python-pyopenssl)
447 ("python-tldextract" ,python-tldextract)))
449 `(("python-pytest-cov" ,python-pytest-cov)))
450 (home-page "https://github.com/ikreymer/certauth")
451 (synopsis "Certificate authority creation tool")
452 (description "This package provides a small library, built on top of
453 pyOpenSSL, which allows for creating a custom certificate authority (CA)
454 certificate, and generating on-demand dynamic host certs using that CA
455 certificate. It is most useful for use with a man-in-the-middle HTTPS proxy,
456 for example, for recording or replaying web content.")
457 (license license:expat)))
459 (define-public python-certifi
461 (name "python-certifi")
462 (version "2020.12.5")
465 (uri (pypi-uri "certifi" version))
468 "177mdbw0livdjvp17sz6wsfrc32838m9y59v871gpgv2888raj8s"))))
469 (build-system python-build-system)
470 (arguments '(#:tests? #f)) ;no tests
471 (home-page "https://certifi.io/")
472 (synopsis "Python CA certificate bundle")
474 "Certifi is a Python library that contains a CA certificate bundle, which
475 is used by the Requests library to verify HTTPS requests.")
476 (license license:asl2.0)))
478 (define-public python2-certifi
479 (package-with-python2 python-certifi))
481 (define-public python-cryptography-vectors
483 (name "python-cryptography-vectors")
488 (uri (pypi-uri "cryptography_vectors" version))
491 "192wix3sr678x21brav5hgc6j93l7ab1kh69p2scr3fsblq9qy03"))))
492 (build-system python-build-system)
493 (home-page "https://github.com/pyca/cryptography")
494 (synopsis "Test vectors for the cryptography package")
496 "This package contains test vectors for the cryptography package.")
497 ;; Distributed under either BSD-3 or ASL2.0
498 (license (list license:bsd-3 license:asl2.0))))
500 (define-public python2-cryptography-vectors
501 (package-with-python2 python-cryptography-vectors))
503 (define-public python-cryptography
505 (name "python-cryptography")
510 (uri (pypi-uri "cryptography" version))
513 "1ribd1vxq9wwz564mg60dzcy699gng54admihjjkgs9dx95pw5vy"))))
514 (build-system python-build-system)
516 `(("openssl" ,openssl)))
518 `(("python-asn1crypto" ,python-asn1crypto)
519 ("python-cffi" ,python-cffi)
520 ("python-six" ,python-six)
521 ("python-idna" ,python-idna)
522 ("python-iso8601" ,python-iso8601)))
524 `(("python-cryptography-vectors" ,python-cryptography-vectors)
525 ("python-hypothesis" ,python-hypothesis)
526 ("python-pretend" ,python-pretend)
527 ("python-pytz" ,python-pytz)
528 ("python-pytest" ,python-pytest)))
529 (home-page "https://github.com/pyca/cryptography")
530 (synopsis "Cryptographic recipes and primitives for Python")
532 "cryptography is a package which provides cryptographic recipes and
533 primitives to Python developers. It aims to be the “cryptographic standard
534 library” for Python. The package includes both high level recipes, and low
535 level interfaces to common cryptographic algorithms such as symmetric ciphers,
536 message digests and key derivation functions.")
537 ;; Distributed under either BSD-3 or ASL2.0
538 (license (list license:bsd-3 license:asl2.0))
539 (properties `((python2-variant . ,(delay python2-cryptography))))))
541 (define-public python2-cryptography
542 (let ((crypto (package-with-python2
543 (strip-python2-variant python-cryptography))))
544 (package/inherit crypto
546 `(("python2-ipaddress" ,python2-ipaddress)
547 ("python2-backport-ssl-match-hostname"
548 ,python2-backport-ssl-match-hostname)
549 ("python2-enum34" ,python2-enum34)
550 ,@(package-propagated-inputs crypto))))))
552 (define-public python-pyopenssl
554 (name "python-pyopenssl")
559 (uri (pypi-uri "pyOpenSSL" version))
562 "1i8ab5zn9i9iq2ksizp3rd42v157kacddzz88kviqw3kpp68xw4j"))))
563 (build-system python-build-system)
566 (modify-phases %standard-phases
568 (add-after 'install 'check
569 (lambda* (#:key inputs outputs #:allow-other-keys)
570 (add-installed-pythonpath inputs outputs)
571 ;; PyOpenSSL runs tests against a certificate with a fixed
572 ;; expiry time. To ensure successful builds in the future,
573 ;; set the time to roughly the release date.
574 (invoke "faketime" "2020-12-01" "py.test" "-v" "-k"
576 ;; This test tries to look up certificates from
577 ;; the compiled-in default path in OpenSSL, which
578 ;; does not exist in the build environment.
579 "not test_fallback_default_verify_paths "
580 ;; This test attempts to make a connection to
581 ;; an external web service.
582 "and not test_set_default_verify_paths "
583 ;; Fails on i686-linux and possibly other 32-bit platforms
584 ;; https://github.com/pyca/pyopenssl/issues/974
585 "and not test_verify_with_time")))))))
587 `(("python-cryptography" ,python-cryptography)
588 ("python-six" ,python-six)))
590 `(("openssl" ,openssl)))
592 `(("libfaketime" ,libfaketime)
593 ("python-flaky" ,python-flaky)
594 ("python-pretend" ,python-pretend)
595 ("python-pytest" ,python-pytest)))
596 (home-page "https://github.com/pyca/pyopenssl")
597 (synopsis "Python wrapper module around the OpenSSL library")
599 "PyOpenSSL is a high-level wrapper around a subset of the OpenSSL
601 (license license:asl2.0)))
603 (define-public python2-pyopenssl
604 (package-with-python2 python-pyopenssl))
606 (define-public python-ed25519
608 (name "python-ed25519")
613 (uri (pypi-uri "ed25519" version))
616 "0ahx1nkxa0xis3cw0h5c4fpgv8mq4znkq7kajly33lc3317bk499"))))
617 (build-system python-build-system)
618 (home-page "https://github.com/warner/python-ed25519")
619 (synopsis "Ed25519 public-key signatures")
620 (description "Ed25519 public-key signatures")
621 (license license:expat)))
623 (define-public python2-ed25519
624 (package-with-python2 python-ed25519))
626 (define-public python-axolotl-curve25519
628 (name "python-axolotl-curve25519")
629 (version "0.4.1.post2")
633 (uri (pypi-uri "python-axolotl-curve25519" version))
636 "18v3rfyv7xi26fb97nw1xc0l6x8wi0i4xj8dlq4gblpbjxiac187"))))
637 (build-system python-build-system)
638 (home-page "https://github.com/tgalal/python-axolotl-curve25519")
639 (synopsis "Python wrapper for curve25519 library")
640 (description "This is a python wrapper for the curve25519 library
641 with ed25519 signatures. The C code was pulled from
642 libaxolotl-android. At the moment this wrapper is meant for use by
644 (license (list license:gpl3 ; Most files
645 license:bsd-3)))) ; curve/curve25519-donna.c
647 (define-public python2-axolotl-curve25519
648 (package-with-python2 python-axolotl-curve25519))
650 (define-public python-axolotl
652 (name "python-axolotl")
657 (uri (pypi-uri "python-axolotl" version))
660 "1bwdp24fmriffwx91aigs9k162albb51iskp23nc939z893q23py"))))
661 (build-system python-build-system)
664 (modify-phases %standard-phases
665 ;; Don't install tests
666 (add-before 'install 'remove-tests
668 (for-each delete-file-recursively
669 '("axolotl/tests" "build/lib/axolotl/tests"))
672 `(("python-axolotl-curve25519" ,python-axolotl-curve25519)
673 ("python-cryptography" ,python-cryptography)
674 ("python-protobuf" ,python-protobuf)))
675 (home-page "https://github.com/tgalal/python-axolotl")
676 (synopsis "Python port of libaxolotl-android")
677 (description "This is a python port of libaxolotl-android. This
678 is a ratcheting forward secrecy protocol that works in synchronous and
679 asynchronous messaging environments.")
680 (license license:gpl3)))
682 (define-public python2-axolotl
683 (package-with-python2 python-axolotl))
685 ;; SlowAES isn't compatible with Python 3.
686 (define-public python2-slowaes
688 (name "python2-slowaes")
693 (uri (pypi-uri "slowaes" version))
696 "02dzajm83a7lqgxf6r3hgj64wfmcxz8gs4nvgxpvj5n19kjqlrc3"))))
697 (build-system python-build-system)
698 (arguments `(#:python ,python-2))
699 (home-page "http://code.google.com/p/slowaes/")
700 (synopsis "Implementation of AES in Python")
701 (description "This package contains an implementation of AES in Python.
702 This implementation is slow (hence the project name) but still useful when
703 faster ones are not available.")
704 (license license:asl2.0)))
706 (define-public python-pyaes
708 (name "python-pyaes")
713 (uri (pypi-uri "pyaes" version))
716 "13vdaff15k0jyfcss4b4xvfgm8xyv0nrbyw5n1qc7lrqbi0b3h82"))))
717 (build-system python-build-system)
718 (home-page "https://github.com/ricmoo/pyaes")
719 (synopsis "Implementation of AES in Python")
720 (description "This package contains a pure-Python implementation of the
721 AES block cipher algorithm and the common modes of operation (CBC, CFB, CTR,
723 (license license:expat)))
725 (define-public python2-pyaes
726 (package-with-python2 python-pyaes))
728 (define-public python-asn1crypto
730 (name "python-asn1crypto")
736 (url "https://github.com/wbond/asn1crypto")
738 (file-name (git-file-name name version))
741 "19abibn6jw20mzi1ln4n9jjvpdka8ygm4m439hplyrdfqbvgm01r"))))
742 (build-system python-build-system)
744 '(#:phases (modify-phases %standard-phases
747 (invoke "python" "run.py" "tests"))))))
748 (home-page "https://github.com/wbond/asn1crypto")
749 (synopsis "ASN.1 parser and serializer in Python")
750 (description "asn1crypto is an ASN.1 parser and serializer with definitions
751 for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7,
752 PKCS#8, PKCS#12, PKCS#5, X.509 and TSP.")
753 (license license:expat)))
755 (define-public python2-asn1crypto
756 (package-with-python2 python-asn1crypto))
758 (define-public python-pynacl
760 (name "python-pynacl")
765 (uri (pypi-uri "PyNaCl" version))
766 (modules '((guix build utils)))
769 ;; Remove spurious dependency on python-wheel, can be removed
771 (substitute* "setup.py"
773 ;; Remove bundled libsodium.
774 (delete-file-recursively "src/libsodium")
778 "01b56hxrbif3hx8l6rwz5kljrgvlbj7shmmd2rjh0hn7974a5sal"))))
779 (build-system python-build-system)
781 `(#:modules (,@%python-build-system-modules
786 (modify-phases (@ (guix build python-build-system) %standard-phases)
787 (add-before 'build 'use-system-sodium
789 (setenv "SODIUM_INSTALL" "system")
793 (let ((build-directory
794 (car (scandir "build" (cut string-prefix? "lib" <>)))))
796 (string-append "./build/" build-directory ":"
797 (getenv "PYTHONPATH")))
798 (invoke "pytest" "-vv")))))))
800 `(("python-hypothesis" ,python-hypothesis)
801 ("python-pytest" ,python-pytest)))
803 `(("python-cffi" ,python-cffi)
804 ("python-six" ,python-six)
805 ("libsodium" ,libsodium)))
806 (home-page "https://github.com/pyca/pynacl/")
807 (synopsis "Python bindings to libsodium")
809 "PyNaCl is a Python binding to libsodium, which is a fork of the
810 Networking and Cryptography library. These libraries have a stated goal
811 of improving usability, security and speed.")
812 (license license:asl2.0)))
814 (define-public python-blurhash
816 (name "python-blurhash")
820 ;; Tests not included in pypi release and releases not tagged in git repo.
823 (url "https://github.com/halcy/blurhash-python")
824 (commit "22e081ef1c24da1bb5c5eaa2c1d6649724deaef8")))
825 (file-name (git-file-name name version))
828 "1qq6mhydlp7q3na4kmaq3871h43wh3pyfyxr4b79bia73wjdylxf"))))
829 (build-system python-build-system)
832 (modify-phases %standard-phases
835 (delete-file "setup.cfg")
836 (invoke "pytest"))))))
838 `(("python-numpy" ,python-numpy)
839 ("python-pillow" ,python-pillow)
840 ("python-pytest" ,python-pytest)))
841 (home-page "https://github.com/halcy/blurhash-python")
843 "Pure-Python implementation of the blurhash algorithm")
845 "Pure-Python implementation of the blurhash algorithm.")
846 (license license:expat)))
848 (define-public python-ecpy
855 (uri (pypi-uri "ECPy" version))
858 "1gc3i5s93zq6x1nkaxkq1dvmsc12vmrw0hns9f5s1hcb78ni52c8"))))
859 (build-system python-build-system)
861 `(("python-future" ,python-future)))
862 (home-page "https://github.com/ubinity/ECPy")
863 (synopsis "Pure Python Elliptic Curve Library")
864 (description "This package provides a Elliptic Curve Library in pure
866 (license license:asl2.0)))
868 (define-public python2-ecpy
869 (package-with-python2 python-ecpy))
871 (define-public python-josepy
873 (name "python-josepy")
877 (uri (pypi-uri "josepy" version))
880 "11khz8malzrv375b27jjkv66z6z6khdx1v5mkkr4vq16gp3n4p7v"))))
881 (build-system python-build-system)
883 ;; The tests require flake8 >= 3.5, which is not yet packaged.
886 `(("python-cryptography" ,python-cryptography)
887 ("python-pyopenssl" ,python-pyopenssl)
888 ("python-six" ,python-six)))
889 ;; TODO Enable when we have flake8 >= 3.5.
891 ; `(("python-coverage" ,python-coverage)
892 ; ("python-flake8" ,python-flake8)
893 ; ("python-isort" ,python-isort)
894 ; ("python-mock" ,python-mock)
895 ; ("python-pytest" ,python-pytest)
896 ; ("python-pytest-cov" ,python-pytest-cov)
897 ; ("python-pytest-cache" ,python-pytest-cache)
898 ; ("python-pytest-flake8" ,python-pytest-flake8)))
899 (home-page "https://github.com/certbot/josepy")
900 (synopsis "JOSE protocol implementation in Python")
901 (description "This package provides a Python implementation of the JOSE
902 protocol (Javascript Object Signing and Encryption).")
903 (license license:asl2.0)))
905 (define-public python2-josepy
906 (package-with-python2 python-josepy))
908 (define pycryptodome-unbundle-tomcrypt-snippet
910 ;; Unbundle libtomcrypt.
911 (delete-file-recursively "src/libtom")
912 (substitute* "src/DES.c"
913 (("#include \"libtom/tomcrypt_des.c\"")
914 "#include <tomcrypt.h>"))
915 (substitute* "setup.py"
916 (("include_dirs=\\['src/', 'src/libtom/'\\]")
917 ;; FIXME: why does '-ltomcrypt' need to be added
918 ;; manually, even when 'tomcrypt' is added to 'libraries'?
919 ;; This behaviour is not documented at
920 ;; <https://docs.python.org/3/extending/building.html>.
921 "include_dirs=['src/'], libraries=['tomcrypt', 'tommath'],
922 extra_link_args=['-ltomcrypt', '-ltommath']"))))
924 (define-public python-pycryptodome
926 (name "python-pycryptodome")
931 (uri (pypi-uri "pycryptodome" version))
934 "1i4m74f88qj9ci8rpyzrbk2slmsdj5ipmwdkq6qk24byalm203li"))
935 (modules '((guix build utils)))
936 (snippet pycryptodome-unbundle-tomcrypt-snippet)))
937 (build-system python-build-system)
939 `(("libtomcrypt" ,libtomcrypt)
940 ("libtommath" ,libtommath)))
941 (home-page "https://www.pycryptodome.org")
942 (synopsis "Low-level cryptographic Python library")
944 "PyCryptodome is a self-contained Python package of low-level
945 cryptographic primitives. It's not a wrapper to a separate C library like
946 OpenSSL. To the largest possible extent, algorithms are implemented in pure
947 Python. Only the pieces that are extremely critical to performance (e.g.,
948 block ciphers) are implemented as C extensions.
950 You are expected to have a solid understanding of cryptography and security
951 engineering to successfully use these primitives. You must also be able to
952 recognize that some are obsolete (e.g., TDES) or even insecure (RC4).
954 It provides many enhancements over the last release of PyCrypto (2.6.1):
957 @item Authenticated encryption modes (GCM, CCM, EAX, SIV, OCB)
958 @item Accelerated AES on Intel platforms via AES-NI
959 @item First-class support for PyPy
960 @item Elliptic curves cryptography (NIST P-256 curve only)
961 @item Better and more compact API (nonce and iv attributes for ciphers,
962 automatic generation of random nonces and IVs, simplified CTR cipher mode, and
964 @item SHA-3 (including SHAKE XOFs) and BLAKE2 hash algorithms
965 @item Salsa20 and ChaCha20 stream ciphers
966 @item scrypt and HKDF
967 @item Deterministic (EC)DSA
968 @item Password-protected PKCS#8 key containers
969 @item Shamir’s Secret Sharing scheme
970 @item Random numbers get sourced directly from the OS (and not from a CSPRNG
972 @item Cleaner RSA and DSA key generation (largely based on FIPS 186-4)
973 @item Major clean-ups and simplification of the code base
976 This package provides drop-in compatibility with PyCrypto. It is one of two
977 PyCryptodome variants, the other being python-pycryptodomex.")
978 (license (list license:bsd-2
979 license:public-domain)))) ; code inherited from PyCrypto
981 (define-public python2-pycryptodome
982 (package-with-python2 python-pycryptodome))
984 (define-public python-pycryptodomex
985 (package (inherit python-pycryptodome)
986 (name "python-pycryptodomex")
987 (version (package-version python-pycryptodome))
991 (uri (pypi-uri "pycryptodomex" version))
993 (base32 "0lbx4qk3xmwqiidhmkj8qa7bh2lf8bwzg0xjpsh2w5zqjrc7qnvv"))
994 (modules '((guix build utils)))
995 (snippet pycryptodome-unbundle-tomcrypt-snippet)))
997 "PyCryptodome is a self-contained Python package of low-level
998 cryptographic primitives. It's not a wrapper to a separate C library like
999 OpenSSL. To the largest possible extent, algorithms are implemented in pure
1000 Python. Only the pieces that are extremely critical to performance (e.g.,
1001 block ciphers) are implemented as C extensions.
1003 You are expected to have a solid understanding of cryptography and security
1004 engineering to successfully use these primitives. You must also be able to
1005 recognize that some are obsolete (e.g., TDES) or even insecure (RC4).
1007 It provides many enhancements over the last release of PyCrypto (2.6.1):
1010 @item Authenticated encryption modes (GCM, CCM, EAX, SIV, OCB)
1011 @item Accelerated AES on Intel platforms via AES-NI
1012 @item First-class support for PyPy
1013 @item Elliptic curves cryptography (NIST P-256 curve only)
1014 @item Better and more compact API (nonce and iv attributes for ciphers,
1015 automatic generation of random nonces and IVs, simplified CTR cipher mode, and
1017 @item SHA-3 (including SHAKE XOFs) and BLAKE2 hash algorithms
1018 @item Salsa20 and ChaCha20 stream ciphers
1019 @item scrypt and HKDF
1020 @item Deterministic (EC)DSA
1021 @item Password-protected PKCS#8 key containers
1022 @item Shamir’s Secret Sharing scheme
1023 @item Random numbers get sourced directly from the OS (and not from a CSPRNG
1025 @item Cleaner RSA and DSA key generation (largely based on FIPS 186-4)
1026 @item Major clean-ups and simplification of the code base
1029 PyCryptodomex is the stand-alone version of PyCryptodome that no longer
1030 provides drop-in compatibility with PyCrypto.")))
1032 (define-public python-m2crypto
1034 (name "python-m2crypto")
1039 (uri (pypi-uri "M2Crypto" version))
1041 (base32 "09yirf3w77w6f49q6nxhrjm9c3a4y9s30s1k09chqrw8zdgx8sjc"))))
1042 (build-system python-build-system)
1044 `(;; FIXME: Tests start failing with time due to date checks in TLS
1047 (inputs `(("openssl" ,openssl)))
1048 (native-inputs `(("swig" ,swig)))
1049 (home-page "https://gitlab.com/m2crypto/m2crypto")
1050 (synopsis "Python crypto and TLS toolkit")
1051 (description "@code{M2Crypto} is a complete Python wrapper for OpenSSL
1052 featuring RSA, DSA, DH, EC, HMACs, message digests, symmetric ciphers
1053 (including AES); TLS functionality to implement clients and servers; HTTPS
1054 extensions to Python's httplib, urllib, and xmlrpclib; unforgeable HMAC'ing
1055 AuthCookies for web session management; FTP/TLS client and server; S/MIME;
1056 M2Crypto can also be used to provide TLS for Twisted. Smartcards supported
1057 through the Engine interface.")
1058 (properties `((python2-variant . ,(delay python2-m2crypto))))
1059 (license license:expat)))
1061 (define-public python2-m2crypto
1062 (let ((m2crypto (package-with-python2
1063 (strip-python2-variant python-m2crypto))))
1064 (package/inherit m2crypto
1066 `(("python2-typing" ,python2-typing))))))
1068 (define-public python-pykeepass
1070 (name "python-pykeepass")
1075 ;; Source tarball on PyPI doesn't include tests.
1077 (url "https://github.com/libkeepass/pykeepass")
1079 (file-name (git-file-name name version))
1081 (base32 "1symxf4ahylynihnp9z4z3lh2vy65ipvg8s4hjrnn936hcaaxghk"))))
1082 (build-system python-build-system)
1085 (modify-phases %standard-phases
1086 (add-after 'unpack 'make-kdbx-writable
1087 ;; Tests have to write to the .kdbx files in the test directory.
1089 (with-directory-excursion "tests"
1090 (for-each make-file-writable (find-files "."))
1092 (add-before 'build 'patch-requirements
1094 ;; Update requirements from dependency==version
1095 ;; to dependency>=version.
1096 (substitute* "setup.py"
1100 `(("python-argon2-cffi" ,python-argon2-cffi)
1101 ("python-construct" ,python-construct)
1102 ("python-dateutil" ,python-dateutil)
1103 ("python-future" ,python-future)
1104 ("python-lxml" ,python-lxml)
1105 ("python-pycryptodomex" ,python-pycryptodomex)))
1106 (home-page "https://github.com/libkeepass/pykeepass")
1107 (synopsis "Python library to interact with keepass databases")
1109 "This library allows you to write entries to a KeePass database. It
1110 supports KDBX3 and KDBX4.")
1111 ;; There are no copyright headers in the source code. The LICENSE file
1113 (license license:gpl3+)))
1115 (define-public python-pylibscrypt
1117 (name "python-pylibscrypt")
1122 (uri (pypi-uri "pylibscrypt" version))
1125 "1b3rgzl6dbzs08vhv41b6y4n5189wv7lr27acxn104hs45745abs"))))
1126 (build-system python-build-system)
1129 (modify-phases %standard-phases
1130 (add-before 'build 'hard-code-path-to-libscrypt
1131 (lambda* (#:key inputs #:allow-other-keys)
1132 (let ((libscrypt (assoc-ref inputs "libscrypt")))
1133 (substitute* "pylibscrypt/pylibscrypt.py"
1134 (("find_library\\('scrypt'\\)")
1135 (string-append "'" libscrypt "/lib/libscrypt.so'")))
1137 ;; The library can use various scrypt implementations and tests all of
1138 ;; them. Since we only provide a single implementation, most tests
1139 ;; fail. Simply skip them.
1141 ;; FIXME: Using "libscrypt" is the second best choice. The best one
1142 ;; requires "hashlib.scrypt", provided by Python 3.6+ built with OpenSSL
1143 ;; 1.1+. Use that as soon as Guix provides it.
1145 `(("libscrypt" ,libscrypt)))
1146 (home-page "https://github.com/jvarho/pylibscrypt")
1147 (synopsis "Scrypt for Python")
1148 (description "There are a lot of different scrypt modules for Python, but
1149 none of them have everything that I'd like, so here's one more. It uses
1151 (license license:isc)))
1153 (define-public python-libnacl
1155 (name "python-libnacl")
1160 (uri (pypi-uri "libnacl" version))
1163 "0srx7i264v4dq9and8y6gpzzhrg8jpxs5iy9ggw4plimfj0rjfdm"))))
1164 (build-system python-build-system)
1167 (modify-phases %standard-phases
1168 (add-after 'unpack 'locate-libsodium
1169 (lambda* (#:key inputs #:allow-other-keys)
1170 (substitute* "libnacl/__init__.py"
1171 (("/usr/local/lib/libsodium.so")
1172 (string-append (assoc-ref inputs "libsodium")
1173 "/lib/libsodium.so")))
1176 `(("python-pyhamcrest" ,python-pyhamcrest)))
1178 `(("libsodium" ,libsodium)))
1179 (home-page "https://libnacl.readthedocs.org/")
1180 (synopsis "Python bindings for libsodium based on ctypes")
1181 (description "@code{libnacl} is used to gain direct access to the
1182 functions exposed by @code{NaCl} library via @code{libsodium}. It has
1183 been constructed to maintain extensive documentation on how to use
1184 @code{NaCl} as well as being completely portable.")
1185 (license license:asl2.0)))
1187 (define-public python-pyotp
1189 (name "python-pyotp")
1194 (uri (pypi-uri "pyotp" version))
1196 (base32 "0jsqfmx9i7j8z81r4zazv76xzy1fcq8v9s2r4kvx7ajfndq3z2h3"))))
1197 (build-system python-build-system)
1198 (home-page "https://github.com/pyauth/pyotp")
1199 (synopsis "Python One Time Password Library")
1201 "PyOTP is a Python library for generating and verifying one-time
1202 passwords. It can be used to implement two-factor (2FA) or multi-factor
1203 (MFA) authentication methods in web applications and in other systems that
1204 require users to log in.")
1205 (license license:expat)))
1207 (define-public python-scrypt
1209 (name "python-scrypt")
1214 (uri (pypi-uri "scrypt" version))
1217 "0hjk71k3mgnl8siikm9lii9im8kv0rb7inkjzx78rnancra48xxr"))))
1218 (build-system python-build-system)
1220 `(("openssl" ,openssl)))
1221 (home-page "https://bitbucket.org/mhallin/py-scrypt")
1222 (synopsis "Bindings for the scrypt key derivation function library")
1223 (description "This is a set of Python bindings for the scrypt key
1224 derivation function.")
1225 (license license:bsd-2)))
1227 (define-public python-service-identity
1229 (name "python-service-identity")
1234 (uri (pypi-uri "service_identity" version))
1237 "0b9f5qiqjy8ralzgwjgkhx82h6h8sa7532psmb8mkd65md5aan08"))))
1238 (build-system python-build-system)
1240 `(("python-attrs" ,python-attrs)
1241 ("python-pyasn1" ,python-pyasn1)
1242 ("python-pyasn1-modules" ,python-pyasn1-modules)
1243 ("python-pyopenssl" ,python-pyopenssl)))
1244 (home-page "https://service-identity.readthedocs.io/")
1245 (synopsis "Service identity verification for PyOpenSSL")
1247 "@code{service_identity} aspires to give you all the tools you need
1248 for verifying whether a certificate is valid for the intended purposes.
1249 In the simplest case, this means host name verification. However,
1250 service_identity implements RFC 6125 fully and plans to add other
1251 relevant RFCs too.")
1252 (license license:expat)))
1254 (define-public python2-service-identity
1255 (package-with-python2 python-service-identity))
1257 (define-public python-hkdf
1259 (name "python-hkdf")
1264 (uri (pypi-uri "hkdf" version))
1267 "1jhxk5vhxmxxjp3zj526ry521v9inzzl8jqaaf0ma65w6k332ak2"))))
1268 (build-system python-build-system)
1270 `(("python-nose" ,python-nose)))
1271 (home-page "https://github.com/casebeer/python-hkdf")
1272 (synopsis "HMAC-based Extract-and-Expand Key Derivation Function (HKDF)")
1273 (description "This package provides a Python implementation of the HMAC Key
1274 Derivation function (HKDF) defined in RFC 5869.")
1275 (license license:bsd-2)))
1277 (define-public python-spake2
1279 (name "python-spake2")
1284 (uri (pypi-uri "spake2" version))
1287 "1x16r7lrbklvfzbacb66qv9iiih6liq1y612dqh2chgf555n2yn1"))))
1288 (build-system python-build-system)
1290 `(("python-hkdf" ,python-hkdf)))
1291 (home-page "https://github.com/warner/python-spake2")
1292 (synopsis "SPAKE2 password-authenticated key exchange in Python")
1293 (description "This package provides a Python implementation of the SPAKE2
1294 Password-Authenticated Key Exchange algorithm.")
1295 (license license:expat)))
1297 (define-public python-txtorcon
1299 (name "python-txtorcon")
1304 (uri (pypi-uri "txtorcon" version))
1307 "0fxzhsc62bhmr730vj9pzallmw56gz6iykvl28a5agrycm0bfc9p"))))
1308 (build-system python-build-system)
1310 ;; The tests fail immediately due to a missing file. Reported upstream:
1311 ;; <https://github.com/meejah/txtorcon/issues/330>
1314 `(("python-automat" ,python-automat)
1315 ("python-idna" ,python-idna)
1316 ("python-incremental" ,python-incremental)
1317 ("python-service-identity" ,python-service-identity)
1318 ("python-twisted" ,python-twisted)
1319 ("python-zope-interface" ,python-zope-interface)))
1320 (home-page "https://github.com/meejah/txtorcon")
1321 (synopsis "Twisted-based Tor controller client")
1322 (description "This package provides a Twisted-based Tor controller client,
1323 with state-tracking and configuration abstractions.")
1324 (license license:expat)))
1326 (define-public python-keyutils
1328 (name "python-keyutils")
1333 (uri (pypi-uri "keyutils" version))
1336 "0lipygpzhwzzsq2k5imb1jgkmj8y4khxdwhzadjs3bd56g6bmkx9"))))
1337 (build-system python-build-system)
1339 `(("python-pytest" ,python-pytest)
1340 ("python-pytest-runner" ,python-pytest-runner)))
1342 `(("keyutils" ,keyutils)))
1345 (home-page "https://github.com/sassoftware/python-keyutils")
1346 (synopsis "Python bindings for keyutils")
1348 "This is a set of python bindings for keyutils, a key management suite
1349 that leverages the infrastructure provided by the Linux kernel for safely
1350 storing and retrieving sensitive information in your programs.")
1351 (license license:asl2.0)))
1353 (define-public python-mcuboot-imgtool
1355 (name "python-mcuboot-imgtool")
1361 (url "https://github.com/JuulLabs-OSS/mcuboot")
1362 (commit (string-append "v" version))))
1363 (file-name (git-file-name name version))
1366 "1m1csyvzq4jx81zg635ssy1n7sc0z539z0myh872ll3nwqx7wa0q"))))
1367 (build-system python-build-system)
1370 (modify-phases %standard-phases
1371 (add-after 'unpack 'fix-broken-test
1373 (substitute* "scripts/imgtool/keys/ed25519_test.py"
1374 (("raw_sign") "sign_digest"))
1376 (add-before 'build 'change-directory
1381 `(("python-click" ,python-click)
1382 ("python-intelhex" ,python-intelhex)
1383 ("python-cryptography" ,python-cryptography)))
1384 (home-page "https://mcuboot.com")
1385 (synopsis "Tool to securely sign firmware images for booting by MCUboot")
1386 (description "MCUboot is a secure bootloader for 32-bit MCUs. This
1387 package provides a tool to securely sign firmware images for booting by
1389 (license license:expat)))
1391 (define-public python-ntlm-auth
1393 (name "python-ntlm-auth")
1398 (uri (pypi-uri "ntlm-auth" version))
1401 "16mavidki4ma5ip8srqalr19gz4f5yn3cnmmgps1fmgfr24j63rm"))))
1402 (build-system python-build-system)
1404 `(("python-cryptography" ,python-cryptography)))
1405 (home-page "https://github.com/jborean93/ntlm-auth")
1407 "Calculates NTLM Authentication codes")
1409 "This library handles the low-level details of NTLM authentication for
1410 use in authenticating with a service that uses NTLM. It will create and parse
1411 the 3 different message types in the order required and produce a base64
1412 encoded value that can be attached to the HTTP header.
1414 The goal of this library is to offer full NTLM support including signing and
1415 sealing of messages as well as supporting MIC for message integrity and the
1416 ability to customise and set limits on the messages sent. Please see Features
1417 and Backlog for a list of what is and is not currently supported.")
1418 (license license:expat)))
1420 (define-public python-secretstorage
1422 (name "python-secretstorage")
1427 (uri (pypi-uri "SecretStorage" version))
1430 "15ginv4gzxrx77n7517xnvf2jcpqc6ran12s951hc85zlr8nqrpx"))))
1431 (build-system python-build-system)
1433 '(#:tests? #f)) ; Tests require a running dbus service.
1435 `(("python-cryptography" ,python-cryptography)
1436 ("python-jeepney" ,python-jeepney)))
1437 (home-page "https://github.com/mitya57/secretstorage")
1438 (synopsis "Python bindings to FreeDesktop.org Secret Service API")
1440 "@code{python-secretstorage} provides a way for securely storing passwords
1441 and other secrets. It uses D-Bus Secret Service API that is supported by GNOME
1442 Keyring (since version 2.30) and KSecretsService. SecretStorage supports most
1443 of the functions provided by Secret Service, including creating and deleting
1444 items and collections, editing items, locking and unlocking collections
1445 (asynchronous unlocking is also supported).")
1446 (license license:bsd-3)))
1448 (define-public python-trustme
1450 (name "python-trustme")
1455 (uri (pypi-uri "trustme" version))
1457 (base32 "0v3vr5z6apnfmklf07m45kv5kaqvm6hxrkaqywch57bjd2siiywx"))))
1458 (build-system python-build-system)
1461 (modify-phases %standard-phases
1463 (lambda* (#:key inputs outputs #:allow-other-keys)
1464 (add-installed-pythonpath inputs outputs)
1465 (invoke "pytest" "-vv"))))))
1467 `(("python-more-itertools" ,python-more-itertools)
1468 ("python-pyopenssl" ,python-pyopenssl)
1469 ("python-pytest" ,python-pytest)
1470 ("python-pytest-cov" ,python-pytest-cov)
1471 ("python-service-identity" ,python-service-identity)
1472 ("python-zipp" ,python-zipp)))
1474 `(("python-cryptography" ,python-cryptography)))
1475 (home-page "https://github.com/python-trio/trustme")
1476 (synopsis "Fake a certificate authority for tests")
1478 "@code{trustme} is a tiny Python package that does one thing: it gives you
1479 a fake certificate authority (CA) that you can use to generate fake TLS certs to
1480 use in your tests.")
1481 ;; Either license applies.
1482 (license (list license:expat license:asl2.0))))
1484 (define-public python-certipy
1486 (name "python-certipy")
1491 (uri (pypi-uri "certipy" version))
1494 "0n980gqpzh0fm58h3i4mi2i10wgj606lscm1r5sk60vbf6vh8mv9"))))
1495 (build-system python-build-system)
1497 `(("python-pyopenssl" ,python-pyopenssl)))
1499 `(("python-pytest" ,python-pytest)))
1500 (home-page "https://github.com/LLNL/certipy")
1501 (synopsis "Utility to create and sign CAs and certificates")
1503 "Certipy was made to simplify the certificate creation process. To that
1504 end, certipy exposes methods for creating and managing certificate authorities,
1505 certificates, signing and building trust bundles.")
1506 (license license:bsd-3)))
1508 (define-public python-jeepney
1510 (name "python-jeepney")
1515 (uri (pypi-uri "jeepney" version))
1517 (base32 "0mw6ch5s4czpmsiwqwhcidgk27858pl8vlvb7acrxjkm4ribcnbx"))))
1518 (build-system python-build-system)
1520 `(("python-testpath" ,python-testpath)
1521 ("python-tornado" ,python-tornado)
1522 ("python-trio" ,python-trio)
1523 ("python-pytest" ,python-pytest)
1524 ("python-pytest-trio" ,python-pytest-trio)))
1525 (home-page "https://gitlab.com/takluyver/jeepney")
1526 (synopsis "Low-level, pure Python DBus protocol wrapper")
1528 "This is a low-level, pure Python DBus protocol client. It has an
1529 I/O-free core, and integration modules for different event loops.")
1530 (license license:expat)))
1532 (define-public python-argon2-cffi
1534 (name "python-argon2-cffi")
1539 (uri (pypi-uri "argon2-cffi" version))
1542 "0zgr4mnnm0p4i99023safb0qb8cgvl202nly1rvylk2b7qnrn0nq"))
1543 (modules '((guix build utils)))
1544 (snippet '(begin (delete-file-recursively "extras") #t))))
1545 (build-system python-build-system)
1548 (modify-phases %standard-phases
1551 (setenv "ARGON2_CFFI_USE_SYSTEM" "1")
1552 (invoke "python" "setup.py" "build")))
1554 (lambda* (#:key inputs outputs #:allow-other-keys)
1555 (add-installed-pythonpath inputs outputs)
1557 (invoke "python" "-m" "argon2" "--help")
1559 (invoke "python" "-m" "argon2" "-n" "1" "-t" "1" "-m" "8" "-p" "1"))))))
1561 `(("python-cffi" ,python-cffi)
1562 ("python-six" ,python-six)))
1563 (inputs `(("argon2" ,argon2)))
1565 `(("python-hypothesis" ,python-hypothesis)
1566 ("python-pytest" ,python-pytest)))
1567 (home-page "https://argon2-cffi.readthedocs.io/")
1568 (synopsis "Secure Password Hashes for Python")
1570 "Argon2 is a secure password hashing algorithm. It is designed to have
1571 both a configurable runtime as well as memory consumption. This means that you
1572 can decide how long it takes to hash a password and how much memory is required.")
1573 (license license:expat)))
1575 (define-public python-privy
1577 (name "python-privy")
1583 ;; Releases are untagged
1584 (url "https://github.com/ofek/privy")
1585 (commit "2838db3df239797c71bddacc48a4c49a83f35747")))
1586 (file-name (git-file-name name version))
1589 "1m32dh5fqc8cy7jyf1z5fs6zvmdkbq5fi98hr609gbl7s0l0y0i9"))))
1590 (build-system python-build-system)
1593 (modify-phases %standard-phases
1596 (invoke "python" "-m" "pytest"))))))
1598 `(("python-pytest" ,python-pytest)))
1600 `(("python-argon2-cffi" ,python-argon2-cffi)
1601 ("python-cryptography" ,python-cryptography)))
1602 (home-page "https://www.dropbox.com/developers")
1603 (synopsis "Library to password-protect your data")
1605 "Privy is a small and fast utility for password-protecting secret
1606 data such as API keys, cryptocurrency wallets, or seeds for digital
1608 (license (list license:expat license:asl2.0)))) ; dual licensed
1610 (define-public python-pgpy
1612 (name "python-pgpy")
1617 (uri (pypi-uri "PGPy" version))
1619 (base32 "11rrq15gmn6qbahli7czflfcngjl7zyybjlvk732my6axnf2d754"))))
1620 (build-system python-build-system)
1623 (modify-phases %standard-phases
1625 (lambda* (#:key tests? #:allow-other-keys)
1627 (invoke "pytest")))))))
1629 `(("python-cryptography" ,python-cryptography)
1630 ("python-pyasn1" ,python-pyasn1)
1631 ("python-pytest" ,python-pytest)
1632 ("python-singledispatch" ,python-singledispatch)
1633 ("python-six" ,python-six)
1634 ("python-wheel" ,python-wheel)))
1635 (home-page "https://github.com/SecurityInnovation/PGPy")
1636 (synopsis "Python implementation of OpenPGP")
1638 "Currently, PGPy can load keys and signatures of all kinds in both ASCII
1639 armored and binary formats.
1641 It can create and verify RSA, DSA, and ECDSA signatures, at the moment. It
1642 can also encrypt and decrypt messages using RSA and ECDH.")
1643 (license license:bsd-3)))
1645 (define-public python-sop
1652 (uri (pypi-uri "sop" version))
1655 "0gljyjsdn6hdmwlwwb5g5s0c031p6izamvfxp0d39x60af8k5jyf"))))
1656 (build-system python-build-system)
1658 '(#:tests? #f)) ; There are no tests, and unittest throws an error trying
1660 ; TypeError: don't know how to make test from: 0.2.0
1661 (home-page "https://gitlab.com/dkg/python-sop")
1662 (synopsis "Stateless OpenPGP Command-Line Interface")
1664 "The Stateless OpenPGP Command-Line Interface (or sop) is a
1665 specification that encourages OpenPGP implementors to provide a common,
1666 relatively simple command-line API for purposes of object security.
1668 This Python module helps implementers build such a CLI from any implementation
1669 accessible to the Python interpreter.
1671 It does not provide such an implementation itself -- this is just the
1672 scaffolding for the command line, which should make it relatively easy to
1673 supply a handful of python functions as methods to a class.")
1674 (license license:expat))) ; MIT license