gnu: sbcl-cl-cffi-gtk: Update to 20200417.
[jackhill/guix/guix.git] / gnu / packages / python-crypto.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
3 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 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 Tobias Geerinckx-Rice <me@tobias.gr>
12 ;;; Copyright © 2016, 2017 ng0 <ng0@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 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 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 ;;;
26 ;;; This file is part of GNU Guix.
27 ;;;
28 ;;; GNU Guix is free software; you can redistribute it and/or modify it
29 ;;; under the terms of the GNU General Public License as published by
30 ;;; the Free Software Foundation; either version 3 of the License, or (at
31 ;;; your option) any later version.
32 ;;;
33 ;;; GNU Guix is distributed in the hope that it will be useful, but
34 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
35 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 ;;; GNU General Public License for more details.
37 ;;;
38 ;;; You should have received a copy of the GNU General Public License
39 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
40
41 (define-module (gnu packages python-crypto)
42 #:use-module (guix packages)
43 #:use-module (guix download)
44 #:use-module (guix git-download)
45 #:use-module (guix build-system python)
46 #:use-module (gnu packages)
47 #:use-module (gnu packages check)
48 #:use-module (gnu packages crypto)
49 #:use-module (gnu packages kerberos)
50 #:use-module (gnu packages libffi)
51 #:use-module (gnu packages multiprecision)
52 #:use-module (gnu packages password-utils)
53 #:use-module (gnu packages protobuf)
54 #:use-module (gnu packages python)
55 #:use-module (gnu packages python-check)
56 #:use-module (gnu packages python-web)
57 #:use-module (gnu packages python-xyz)
58 #:use-module (gnu packages time)
59 #:use-module (gnu packages tls)
60 #:use-module ((guix licenses) #:prefix license:)
61 #:use-module (srfi srfi-1))
62
63 (define-public python-base58
64 (package
65 (name "python-base58")
66 (version "1.0.3")
67 (source
68 (origin
69 (method url-fetch)
70 (uri (pypi-uri "base58" version))
71 (sha256
72 (base32
73 "0q1yr0n5jaf17xq98m7dma6z4rh8p19ch55l1s09gi3rk5ckqycs"))))
74 (build-system python-build-system)
75 (native-inputs
76 `(("python-pyhamcrest" ,python-pyhamcrest)))
77 (home-page "https://github.com/keis/base58")
78 (synopsis "Base58 and Base58Check implementation")
79 (description "Base58 and Base58Check implementation compatible
80 with what is used by the Bitcoin network.")
81 (license license:expat)))
82
83 (define-public python-bcrypt
84 (package
85 (name "python-bcrypt")
86 (version "3.1.7")
87 (source
88 (origin
89 (method url-fetch)
90 (uri (pypi-uri "bcrypt" version))
91 (sha256
92 (base32 "0hhywhxx301cxivgxrpslrangbfpccc8y83qbwn1f57cab3nj00b"))))
93 (build-system python-build-system)
94 (native-inputs
95 `(("python-pycparser" ,python-pycparser)
96 ("python-pytest" ,python-pytest)))
97 (propagated-inputs
98 `(("python-cffi" ,python-cffi)
99 ("python-six" ,python-six)))
100 (home-page "https://github.com/pyca/bcrypt/")
101 (synopsis
102 "Modern password hashing library")
103 (description
104 "Bcrypt is a Python module which provides a password hashing method based
105 on the Blowfish password hashing algorithm, as described in
106 @url{http://static.usenix.org/events/usenix99/provos.html,\"A Future-Adaptable
107 Password Scheme\"} by Niels Provos and David Mazieres.")
108 (license license:asl2.0)))
109
110 (define-public python2-bcrypt
111 (package-with-python2 python-bcrypt))
112
113 (define-public python-passlib
114 (package
115 (name "python-passlib")
116 (version "1.7.2")
117 (source
118 (origin
119 (method url-fetch)
120 (uri (pypi-uri "passlib" version))
121 (sha256
122 (base32 "1a5ngap7kq0b4azq8nlfg6xg5bcl1i0v1sbynhmbr631jgpnqrld"))))
123 (build-system python-build-system)
124 (native-inputs
125 `(("python-nose" ,python-nose)))
126 (propagated-inputs
127 `(("python-py-bcrypt" ,python-py-bcrypt)))
128 (arguments
129 `(#:phases
130 (modify-phases %standard-phases
131 (add-before 'check 'set-PYTHON_EGG_CACHE
132 ;; some tests require access to "$HOME/.cython"
133 (lambda* _ (setenv "PYTHON_EGG_CACHE" "/tmp") #t)))))
134 (home-page "https://bitbucket.org/ecollins/passlib")
135 (synopsis "Comprehensive password hashing framework")
136 (description
137 "Passlib is a password hashing library for Python 2 & 3, which provides
138 cross-platform implementations of over 30 password hashing algorithms, as well
139 as a framework for managing existing password hashes. It's designed to be
140 useful for a wide range of tasks, from verifying a hash found in /etc/shadow,
141 to providing full-strength password hashing for multi-user application.")
142 (license license:bsd-3)))
143
144 (define-public python2-passlib
145 (package-with-python2 python-passlib))
146
147 (define-public python-py-bcrypt
148 (package
149 (name "python-py-bcrypt")
150 (version "0.4")
151 (source
152 (origin
153 (method url-fetch)
154 (uri (pypi-uri "py-bcrypt" version))
155 (sha256
156 (base32
157 "0y6smdggwi5s72v6p1nn53dg6w05hna3d264cq6kas0lap73p8az"))))
158 (build-system python-build-system)
159 (home-page "https://code.google.com/p/py-bcrypt")
160 (synopsis
161 "Bcrypt password hashing and key derivation")
162 (description
163 "A python wrapper of OpenBSD's Blowfish password hashing code. This
164 system hashes passwords using a version of Bruce Schneier's Blowfish block
165 cipher with modifications designed to raise the cost of off-line password
166 cracking and frustrate fast hardware implementation. The computation cost of
167 the algorithm is parametrised, so it can be increased as computers get faster.
168 The intent is to make a compromise of a password database less likely to
169 result in an attacker gaining knowledge of the plaintext passwords (e.g. using
170 John the Ripper).")
171 ;; "sha2.c" is under BSD-3;
172 ;; "blowfish.c" and "bcrypt.c" are under BSD-4;
173 ;; the rest is under ISC.
174 (license (list license:isc license:bsd-3 license:bsd-4))))
175
176 (define-public python2-py-bcrypt
177 (package-with-python2 python-py-bcrypt))
178
179 (define-public python-pyblake2
180 (package
181 (name "python-pyblake2")
182 (version "1.1.2")
183 (source
184 (origin
185 (method url-fetch)
186 (uri (pypi-uri "pyblake2" version))
187 (sha256
188 (base32
189 "0gz9hgznv5zw4qjq43xa56y0yikimx30gffvibxzm0nv5sq7xk2w"))))
190 (build-system python-build-system)
191 (home-page "https://github.com/dchest/pyblake2")
192 (synopsis "BLAKE2 hash function for Python")
193 (description "BLAKE2 is a cryptographic hash function, which offers
194 stronger security while being as fast as MD5 or SHA-1, and comes in two
195 flavors: @code{BLAKE2b}, optimized for 64-bit platforms and produces digests
196 of any size between 1 and 64 bytes, and @code{BLAKE2s}, optimized for 8- to
197 32-bit platforms and produces digests of any size between 1 and 32 bytes.
198
199 This package provides a Python interface for BLAKE2.")
200 ;; The COPYING file declares it as public domain, with the option to
201 ;; alternatively use and redistribute it under a variety of permissive
202 ;; licenses. cc0 is explicitly mentioned in setup.py and pyblake2module.c.
203 (license (list license:public-domain license:cc0))))
204
205 (define-public python-paramiko
206 (package
207 (name "python-paramiko")
208 (version "2.4.2")
209 (source
210 (origin
211 (method url-fetch)
212 (uri (pypi-uri "paramiko" version))
213 (sha256
214 (base32
215 "1jqgj2gl1pz7bi2aab1r2xq0ml0gskmm9p235cg9y32nydymm5x8"))))
216 (build-system python-build-system)
217 (arguments
218 `(;; FIXME: Tests require many unpackaged libraries, see dev-requirements.txt.
219 #:tests? #f))
220 (propagated-inputs
221 `(("python-bcrypt" ,python-bcrypt)
222 ("python-pyasn1" ,python-pyasn1)
223 ("python-pynacl" ,python-pynacl)
224 ("python-cryptography" ,python-cryptography)))
225 (home-page "https://www.paramiko.org/")
226 (synopsis "SSHv2 protocol library")
227 (description "Paramiko is a python implementation of the SSHv2 protocol,
228 providing both client and server functionality. While it leverages a Python C
229 extension for low level cryptography (PyCrypto), Paramiko itself is a pure
230 Python interface around SSH networking concepts.")
231 (license license:lgpl2.1+)))
232
233 (define-public python2-paramiko
234 (package-with-python2 python-paramiko))
235
236 (define-public python-ecdsa
237 (package
238 (name "python-ecdsa")
239 (version "0.14.1")
240 (source
241 (origin
242 (method url-fetch)
243 (uri (pypi-uri "ecdsa" version))
244 (sha256
245 (base32 "13nx5cbfxc0gnax5zwdmp9xc40qd1llk62mv85jyrvqkbw017ik4"))))
246 (build-system python-build-system)
247 (arguments
248 '(#:phases
249 (modify-phases %standard-phases
250 (replace 'check
251 (lambda _ (invoke "pytest"))))))
252 (propagated-inputs
253 `(("python-six" ,python-six)))
254 (native-inputs
255 `(("openssl" ,openssl)
256 ("python-pytest" ,python-pytest)))
257 (home-page "https://github.com/warner/python-ecdsa")
258 (synopsis "ECDSA cryptographic signature library (pure python)")
259 (description
260 "This is an easy-to-use implementation of ECDSA cryptography (Elliptic
261 Curve Digital Signature Algorithm), implemented purely in Python. With this
262 library, you can quickly create keypairs (signing key and verifying key), sign
263 messages, and verify the signatures. The keys and signatures are very short,
264 making them easy to handle and incorporate into other protocols.")
265 (license license:expat)))
266
267 (define-public python2-ecdsa
268 (package-with-python2 python-ecdsa))
269
270 ;;; Pycrypto is abandoned upstream:
271 ;;;
272 ;;; https://github.com/dlitz/pycrypto/issues/173
273 ;;;
274 ;;; TODO Remove this package from GNU Guix.
275 (define-public python-pycrypto
276 (package
277 (name "python-pycrypto")
278 (version "2.6.1")
279 (source
280 (origin
281 (method url-fetch)
282 (uri (pypi-uri "pycrypto" version))
283 (patches (search-patches "python-pycrypto-CVE-2013-7459.patch"))
284 (sha256
285 (base32
286 "0g0ayql5b9mkjam8hym6zyg6bv77lbh66rv1fyvgqb17kfc1xkpj"))))
287 (build-system python-build-system)
288 (inputs
289 `(("python" ,python)
290 ("gmp" ,gmp)))
291 (arguments
292 `(#:phases
293 (modify-phases %standard-phases
294 (add-before 'build 'set-build-env
295 ;; pycrypto runs an autoconf configure script behind the scenes
296 (lambda _ (setenv "CONFIG_SHELL" (which "bash")) #t)))))
297 (home-page "https://www.dlitz.net/software/pycrypto/")
298 (synopsis "Cryptographic modules for Python")
299 (description
300 "Pycrypto is a collection of both secure hash functions (such as SHA256
301 and RIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal,
302 etc.). The package is structured to make adding new modules easy.")
303 (license license:public-domain)))
304
305 (define-public python2-pycrypto
306 (let ((pycrypto (package-with-python2 python-pycrypto)))
307 (package (inherit pycrypto)
308 (inputs
309 `(("python" ,python-2)
310 ,@(alist-delete
311 "python"
312 (package-inputs pycrypto)))))))
313
314 (define-public python-kerberos
315 (package
316 (name "python-kerberos")
317 (version "1.3.0")
318 (source
319 (origin
320 (method url-fetch)
321 (uri (pypi-uri "kerberos" version))
322 (sha256
323 (base32
324 "19663qxmma0i8bfbjc2iwy5hgq0g4pfb75r023v5dps68zfvffgh"))))
325 (build-system python-build-system)
326 (inputs
327 `(("mit-krb5" ,mit-krb5)))
328 (home-page "https://github.com/apple/ccs-pykerberos")
329 (synopsis
330 "Python Kerberos library used by CalendarServer")
331 (description
332 "This Python package is a high-level wrapper for Kerberos (GSSAPI)
333 operations. The goal is to avoid having to build a module that wraps the
334 entire Kerberos.framework, and instead offer a limited set of functions that
335 do what is needed for client/server Kerberos authentication based on
336 <http://www.ietf.org/rfc/rfc4559.txt>.")
337 (license license:asl2.0)))
338
339 (define-public python-keyring
340 (package
341 (name "python-keyring")
342 (version "21.0.0")
343 (source
344 (origin
345 (method url-fetch)
346 (uri (pypi-uri "keyring" version))
347 (sha256
348 (base32
349 "1k0w3yh3fz0qp0cvkxdiinq9jzbrnc6bd88qpjz34x3cgcr94psz"))
350 (modules '((guix build utils)))
351 (snippet
352 ;; https://github.com/jaraco/keyring/issues/414
353 '(begin (substitute* "tests/test_packaging.py"
354 (("ep, =") "(ep,) =")) #t))))
355 (build-system python-build-system)
356 (arguments
357 `(#:phases
358 (modify-phases %standard-phases
359 (replace 'check
360 (lambda _
361 ;; Not clear why this test fails.
362 (delete-file "tests/test_packaging.py")
363 (substitute* "pytest.ini"
364 (("--black ") ""))
365 (invoke "pytest"))))))
366 (native-inputs
367 `(("python-pytest" ,python-pytest)
368 ("python-pytest-checkdocs" ,python-pytest-checkdocs)
369 ("python-pytest-cov" ,python-pytest-cov)
370 ("python-pytest-flake8" ,python-pytest-flake8)
371 ("python-setuptools-scm" ,python-setuptools-scm)))
372 (propagated-inputs
373 `(("python-importlib-metadata" ,python-importlib-metadata)
374 ("python-secretstorage" ,python-secretstorage)))
375 (home-page "https://github.com/jaraco/keyring")
376 (synopsis "Store and access your passwords safely")
377 (description
378 "The Python keyring lib provides a easy way to access the system keyring
379 service from python. It can be used in any application that needs safe
380 password storage.")
381 ;; "MIT" and PSF dual license
382 (properties `((python2-variant . ,(delay python2-keyring))))
383 (license license:x11)))
384
385 (define-public python2-keyring
386 (let ((keyring (package-with-python2
387 (strip-python2-variant python-keyring))))
388 (package
389 (inherit keyring)
390 (name "python2-keyring")
391 (version "8.7")
392 (source
393 (origin
394 (method url-fetch)
395 (uri (pypi-uri "keyring" version))
396 (sha256
397 (base32
398 "0482rmi2x6p78wl2kz8qzyq21xz1sbbfwnv5x7dggar4vkwxhzfx"))))
399 (arguments
400 `(#:python ,python-2))
401 (native-inputs
402 `(("python2-pytest" ,python2-pytest)
403 ("python2-pytest-runner" ,python2-pytest-runner)
404 ("python2-setuptools-scm" ,python2-setuptools-scm)))
405 (propagated-inputs
406 `(("python2-pycrypto" ,python2-pycrypto))))))
407
408 (define-public python-keyrings.alt
409 (package
410 (name "python-keyrings.alt")
411 (version "3.4.0")
412 (source
413 (origin
414 (method url-fetch)
415 (uri (pypi-uri "keyrings.alt" version))
416 (sha256
417 (base32
418 "0gdjdqpq2hf770p6iwi891mil0vbsdhvy88x0v8b2w4y4b28lcli"))
419 (modules '((guix build utils)))
420 (snippet
421 '(begin
422 (delete-file "keyrings/alt/_win_crypto.py")
423 ;; Rely on python-keyring>20:
424 ;; https://github.com/jaraco/keyrings.alt/issues/33
425 (substitute* '("keyrings/alt/tests/test_Gnome.py"
426 "keyrings/alt/tests/test_Google.py"
427 "keyrings/alt/tests/test_Windows.py"
428 "keyrings/alt/tests/test_file.py"
429 "keyrings/alt/tests/test_pyfs.py")
430 (("keyring.tests.test_backend") "keyring.testing.backend")
431 (("keyring.tests.util") "keyring.testing.util"))
432 #t))))
433 (build-system python-build-system)
434 (native-inputs
435 `(("python-keyring" ,python-keyring)
436 ("python-pytest" ,python-pytest)
437 ("python-setuptools-scm" ,python-setuptools-scm)))
438 (home-page "https://github.com/jaraco/keyrings.alt")
439 (synopsis "Alternate keyring implementations")
440 (description "Keyrings in this package may have security risks or other
441 implications. These backends were extracted from the main keyring project to
442 make them available for those who wish to employ them, but are discouraged for
443 general production use. Include this module and use its backends at your own
444 risk.")
445 (license license:expat)))
446
447 (define-public python-certifi
448 (package
449 (name "python-certifi")
450 (version "2019.3.9")
451 (source (origin
452 (method url-fetch)
453 (uri (pypi-uri "certifi" version))
454 (sha256
455 (base32
456 "1bnpw7hrf9i1l9gfxjnzi45hkrvzz0pyn9ia8m4mw7sxhgb08qdj"))))
457 (build-system python-build-system)
458 (home-page "https://certifi.io/")
459 (synopsis "Python CA certificate bundle")
460 (description
461 "Certifi is a Python library that contains a CA certificate bundle, which
462 is used by the Requests library to verify HTTPS requests.")
463 (license license:asl2.0)))
464
465 (define-public python2-certifi
466 (package-with-python2 python-certifi))
467
468 (define-public python-cryptography-vectors
469 (package
470 (name "python-cryptography-vectors")
471 (version "2.7")
472 (source
473 (origin
474 (method url-fetch)
475 (uri (pypi-uri "cryptography_vectors" version))
476 (sha256
477 (base32
478 "1g38zw90510azyfrj6mxbslx2gp9yrnv5dac0w2819k9ssdznbgi"))))
479 (build-system python-build-system)
480 (home-page "https://github.com/pyca/cryptography")
481 (synopsis "Test vectors for the cryptography package")
482 (description
483 "This package contains test vectors for the cryptography package.")
484 ;; Distributed under either BSD-3 or ASL2.0
485 (license (list license:bsd-3 license:asl2.0))))
486
487 (define-public python2-cryptography-vectors
488 (package-with-python2 python-cryptography-vectors))
489
490 (define-public python-cryptography
491 (package
492 (name "python-cryptography")
493 (version "2.7")
494 (source
495 (origin
496 (method url-fetch)
497 (uri (pypi-uri "cryptography" version))
498 (sha256
499 (base32
500 "1inlnr36kl36551c9rcad99jmhk81v33by3glkadwdcgmi17fd76"))))
501 (build-system python-build-system)
502 (inputs
503 `(("openssl" ,openssl)))
504 (propagated-inputs
505 `(("python-asn1crypto" ,python-asn1crypto)
506 ("python-cffi" ,python-cffi)
507 ("python-six" ,python-six)
508 ("python-idna" ,python-idna)
509 ("python-iso8601" ,python-iso8601)))
510 (native-inputs
511 `(("python-cryptography-vectors" ,python-cryptography-vectors)
512 ("python-hypothesis" ,python-hypothesis)
513 ("python-pretend" ,python-pretend)
514 ("python-pytz" ,python-pytz)
515 ("python-pytest" ,python-pytest)))
516 (home-page "https://github.com/pyca/cryptography")
517 (synopsis "Cryptographic recipes and primitives for Python")
518 (description
519 "cryptography is a package which provides cryptographic recipes and
520 primitives to Python developers. It aims to be the “cryptographic standard
521 library” for Python. The package includes both high level recipes, and low
522 level interfaces to common cryptographic algorithms such as symmetric ciphers,
523 message digests and key derivation functions.")
524 ;; Distributed under either BSD-3 or ASL2.0
525 (license (list license:bsd-3 license:asl2.0))
526 (properties `((python2-variant . ,(delay python2-cryptography))))))
527
528 (define-public python2-cryptography
529 (let ((crypto (package-with-python2
530 (strip-python2-variant python-cryptography))))
531 (package (inherit crypto)
532 (propagated-inputs
533 `(("python2-ipaddress" ,python2-ipaddress)
534 ("python2-backport-ssl-match-hostname"
535 ,python2-backport-ssl-match-hostname)
536 ("python2-enum34" ,python2-enum34)
537 ,@(package-propagated-inputs crypto))))))
538
539 (define-public python-pyopenssl
540 (package
541 (name "python-pyopenssl")
542 (version "19.0.0")
543 (source
544 (origin
545 (method url-fetch)
546 (uri (pypi-uri "pyOpenSSL" version))
547 (sha256
548 (base32
549 "007j40y7x3k8xj54dy2qnij9lldfp71k9mkflhd9vqbdiwrndjmf"))))
550 (build-system python-build-system)
551 (arguments
552 '(#:phases
553 (modify-phases %standard-phases
554 (delete 'check)
555 (add-after 'install 'check
556 (lambda* (#:key inputs outputs #:allow-other-keys)
557 (add-installed-pythonpath inputs outputs)
558 ;; PyOpenSSL runs tests against a certificate with a fixed
559 ;; expiry time. To ensure successful builds in the future,
560 ;; set the time to roughly the release date.
561 (invoke "faketime" "2019-01-01" "py.test" "-v" "-k"
562 (string-append
563 ;; This test tries to look up certificates from
564 ;; the compiled-in default path in OpenSSL, which
565 ;; does not exist in the build environment.
566 "not test_fallback_default_verify_paths "
567 ;; This test attempts to make a connection to
568 ;; an external web service.
569 "and not test_set_default_verify_paths")))))))
570 (propagated-inputs
571 `(("python-cryptography" ,python-cryptography)
572 ("python-six" ,python-six)))
573 (inputs
574 `(("openssl" ,openssl)))
575 (native-inputs
576 `(("libfaketime" ,libfaketime)
577 ("python-flaky" ,python-flaky)
578 ("python-pretend" ,python-pretend)
579 ("python-pytest" ,python-pytest)))
580 (home-page "https://github.com/pyca/pyopenssl")
581 (synopsis "Python wrapper module around the OpenSSL library")
582 (description
583 "PyOpenSSL is a high-level wrapper around a subset of the OpenSSL
584 library.")
585 (license license:asl2.0)))
586
587 (define-public python2-pyopenssl
588 (package-with-python2 python-pyopenssl))
589
590 (define-public python-ed25519
591 (package
592 (name "python-ed25519")
593 (version "1.4")
594 (source
595 (origin
596 (method url-fetch)
597 (uri (pypi-uri "ed25519" version))
598 (sha256
599 (base32
600 "0ahx1nkxa0xis3cw0h5c4fpgv8mq4znkq7kajly33lc3317bk499"))))
601 (build-system python-build-system)
602 (home-page "https://github.com/warner/python-ed25519")
603 (synopsis "Ed25519 public-key signatures")
604 (description "Ed25519 public-key signatures")
605 (license license:expat)))
606
607 (define-public python2-ed25519
608 (package-with-python2 python-ed25519))
609
610 (define-public python-axolotl-curve25519
611 (package
612 (name "python-axolotl-curve25519")
613 (version "0.1")
614 (source
615 (origin
616 (method git-fetch)
617 (uri (git-reference
618 (url "https://github.com/tgalal/python-axolotl-curve25519")
619 (commit "e4a9c4de0eae27223200579c58d1f8f6d20637e2")))
620 (file-name (string-append name "-" version "-checkout"))
621 (sha256
622 (base32
623 "0agap5q0hmvf6cwzjqc05kw53pjgf6942pcivpazksmg1vk400ra"))))
624 (build-system python-build-system)
625 (arguments
626 `(;; Prevent creation of the egg. This works around
627 ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20765
628 #:configure-flags '("--root=/")))
629 (home-page "https://github.com/tgalal/python-axolotl-curve25519")
630 (synopsis "Python wrapper for curve25519 library")
631 (description "This is a python wrapper for the curve25519 library
632 with ed25519 signatures. The C code was pulled from
633 libaxolotl-android. At the moment this wrapper is meant for use by
634 python-axolotl.")
635 (license (list license:gpl3 ; Most files
636 license:bsd-3)))) ; curve/curve25519-donna.c
637
638 (define-public python2-axolotl-curve25519
639 (package-with-python2 python-axolotl-curve25519))
640
641 (define-public python-axolotl
642 (package
643 (name "python-axolotl")
644 (version "0.1.39")
645 (source
646 (origin
647 (method git-fetch)
648 (uri (git-reference
649 (url "https://github.com/tgalal/python-axolotl")
650 (commit version)))
651 (file-name (git-file-name name version))
652 (patches (search-patches "python-axolotl-AES-fix.patch"))
653 (sha256
654 (base32 "0xm9qgcwf6fq7rhzfcviwhbzcbj4i7wkxkab2z55fy1x82lya9g6"))))
655 (build-system python-build-system)
656 (arguments
657 `(#:phases
658 (modify-phases %standard-phases
659 ;; Don't install tests
660 (add-before 'install 'remove-tests
661 (lambda _
662 (for-each delete-file-recursively
663 '("axolotl/tests" "build/lib/axolotl/tests"))
664 #t)))))
665 (propagated-inputs
666 `(("python-axolotl-curve25519" ,python-axolotl-curve25519)
667 ("python-dateutil" ,python-dateutil)
668 ("python-protobuf" ,python-protobuf)
669 ("python-pycrypto" ,python-pycrypto)))
670 (home-page "https://github.com/tgalal/python-axolotl")
671 (synopsis "Python port of libaxolotl-android")
672 (description "This is a python port of libaxolotl-android. This
673 is a ratcheting forward secrecy protocol that works in synchronous and
674 asynchronous messaging environments.")
675 (license license:gpl3)))
676
677 (define-public python2-axolotl
678 (package-with-python2 python-axolotl))
679
680 ;; SlowAES isn't compatible with Python 3.
681 (define-public python2-slowaes
682 (package
683 (name "python2-slowaes")
684 (version "0.1a1")
685 (source
686 (origin
687 (method url-fetch)
688 (uri (pypi-uri "slowaes" version))
689 (sha256
690 (base32
691 "02dzajm83a7lqgxf6r3hgj64wfmcxz8gs4nvgxpvj5n19kjqlrc3"))))
692 (build-system python-build-system)
693 (arguments `(#:python ,python-2))
694 (home-page "http://code.google.com/p/slowaes/")
695 (synopsis "Implementation of AES in Python")
696 (description "This package contains an implementation of AES in Python.
697 This implementation is slow (hence the project name) but still useful when
698 faster ones are not available.")
699 (license license:asl2.0)))
700
701 (define-public python-pyaes
702 (package
703 (name "python-pyaes")
704 (version "1.6.1")
705 (source
706 (origin
707 (method url-fetch)
708 (uri (pypi-uri "pyaes" version))
709 (sha256
710 (base32
711 "13vdaff15k0jyfcss4b4xvfgm8xyv0nrbyw5n1qc7lrqbi0b3h82"))))
712 (build-system python-build-system)
713 (home-page "https://github.com/ricmoo/pyaes")
714 (synopsis "Implementation of AES in Python")
715 (description "This package contains a pure-Python implementation of the
716 AES block cipher algorithm and the common modes of operation (CBC, CFB, CTR,
717 ECB and OFB).")
718 (license license:expat)))
719
720 (define-public python2-pyaes
721 (package-with-python2 python-pyaes))
722
723 (define-public python-asn1crypto
724 (package
725 (name "python-asn1crypto")
726 (version "0.24.0")
727 (source
728 (origin
729 (method git-fetch)
730 (uri (git-reference
731 (url "https://github.com/wbond/asn1crypto.git")
732 (commit version)))
733 (file-name (git-file-name name version))
734 (sha256
735 (base32
736 "10lai2cs5mnz3gpaffbw1m7b885ls8328q5wxm35vfmcip1f0xmb"))))
737 (build-system python-build-system)
738 (home-page "https://github.com/wbond/asn1crypto")
739 (synopsis "ASN.1 parser and serializer in Python")
740 (description "asn1crypto is an ASN.1 parser and serializer with definitions
741 for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7,
742 PKCS#8, PKCS#12, PKCS#5, X.509 and TSP.")
743 (license license:expat)))
744
745 (define-public python2-asn1crypto
746 (package-with-python2 python-asn1crypto))
747
748 (define-public python-pynacl
749 (package
750 (name "python-pynacl")
751 (version "1.3.0")
752 (source
753 (origin
754 (method url-fetch)
755 (uri (pypi-uri "PyNaCl" version))
756 (modules '((guix build utils)))
757 ;; Remove bundled libsodium.
758 (snippet '(begin (delete-file-recursively "src/libsodium")
759 #t))
760 (sha256
761 (base32
762 "0330wyvggm19xhmwmz9rrr97lzbv3siwfy50gmax3vvgs7nh0q8c"))))
763 (build-system python-build-system)
764 (arguments
765 `(#:phases
766 (modify-phases %standard-phases
767 (add-before 'build 'use-system-sodium
768 (lambda _
769 (setenv "SODIUM_INSTALL" "system")
770 #t)))))
771 (native-inputs
772 `(("python-hypothesis" ,python-hypothesis)
773 ("python-pytest" ,python-pytest)))
774 (propagated-inputs
775 `(("python-cffi" ,python-cffi)
776 ("python-six" ,python-six)
777 ("libsodium" ,libsodium)))
778 (home-page "https://github.com/pyca/pynacl/")
779 (synopsis "Python bindings to libsodium")
780 (description
781 "PyNaCl is a Python binding to libsodium, which is a fork of the
782 Networking and Cryptography library. These libraries have a stated goal
783 of improving usability, security and speed.")
784 (license license:asl2.0)))
785
786 (define-public python2-pynacl
787 (package-with-python2 python-pynacl))
788
789 (define-public python2-pgpdump
790 (package
791 (name "python2-pgpdump")
792 (version "1.5")
793 (source
794 (origin
795 (method url-fetch)
796 (uri (pypi-uri "pgpdump" version))
797 (sha256
798 (base32
799 "0s4nh8h7qsdj2yf29bspjs1zvxd4lcd11r6g11dp7fppgf2h0iqw"))))
800 (build-system python-build-system)
801
802 ;; Currently fails to build with Python 3.
803 (arguments `(#:python ,python-2))
804
805 (home-page "https://github.com/toofishes/python-pgpdump")
806 (synopsis "Python library for parsing PGP packets")
807 (description
808 "Python-pgpdump is an OpenPGP packet parser based on
809 @uref{http://www.mew.org/~kazu/proj/pgpdump/, pgpdump}. It notably supports:
810
811 @itemize
812 @item signature packets;
813 @item public key packets;
814 @item secret key packets;
815 @item trust, user ID, and user attribute packets;
816 @item ASCII-armor decoding and CRC check.
817 @end itemize\n")
818 (license license:bsd-3)))
819
820 (define-public python2-roca-detect
821 (package
822 (name "python2-roca-detect")
823 (version "1.0.8")
824 (source
825 (origin
826 (method url-fetch)
827 (uri (pypi-uri "roca-detect" version))
828 (sha256
829 (base32
830 "1di4akyw2lf5r8zfwvyhkilz8jv8g4b66rgaqwfabmjwma6gnw27"))))
831 (build-system python-build-system)
832 (native-inputs
833 ;; TODO: apk_parse_ph4, pyjks
834 `(("python2-dateutil" ,python2-dateutil)
835 ("python2-six" ,python2-six)
836 ("python2-cryptography" ,python2-cryptography)
837 ("python2-future" ,python2-future)
838 ("python2-coloredlogs" ,python2-coloredlogs)
839 ("python2-pgpdump" ,python2-pgpdump)))
840 (arguments
841 `(;; Basic testing routine is quite simple and works with Py3
842 ;; but the rest of the code that processes the different
843 ;; key formats and extracts the modulus for inspection is
844 ;; not yet fully py3 ready.
845 #:python ,python-2))
846 (home-page "https://github.com/crocs-muni/roca")
847 (synopsis "ROCA detection tool")
848 (description
849 "This tool is related to the paper entitled @i{Return of the
850 Coppersmith’s Attack: Practical Factorization of Widely Used RSA Moduli}. It
851 enables you to test public RSA keys for a presence of the described
852 vulnerability. Currently the tool supports the following key formats: X.509
853 Certificate (DER encoded, PEM encoded), RSA PEM (encoded private key, public
854 key), SSH public key, ASC-encoded OpenPGP key, APK Android application, LDIFF
855 file, and more.")
856 (license license:gpl3)))
857
858 (define-public python-blurhash
859 (package
860 (name "python-blurhash")
861 (version "1.1.4")
862 (source
863 (origin
864 ;; Tests not included in pypi release and releases not tagged in git repo.
865 (method git-fetch)
866 (uri (git-reference
867 (url "https://github.com/halcy/blurhash-python")
868 (commit "22e081ef1c24da1bb5c5eaa2c1d6649724deaef8")))
869 (file-name (git-file-name name version))
870 (sha256
871 (base32
872 "1qq6mhydlp7q3na4kmaq3871h43wh3pyfyxr4b79bia73wjdylxf"))))
873 (build-system python-build-system)
874 (arguments
875 '(#:phases
876 (modify-phases %standard-phases
877 (replace 'check
878 (lambda _
879 (delete-file "setup.cfg")
880 (invoke "pytest"))))))
881 (native-inputs
882 `(("python-numpy" ,python-numpy)
883 ("python-pillow" ,python-pillow)
884 ("python-pytest" ,python-pytest)))
885 (home-page "https://github.com/halcy/blurhash-python")
886 (synopsis
887 "Pure-Python implementation of the blurhash algorithm")
888 (description
889 "Pure-Python implementation of the blurhash algorithm.")
890 (license license:expat)))
891
892 (define-public python-ecpy
893 (package
894 (name "python-ecpy")
895 (version "0.10.0")
896 (source
897 (origin
898 (method url-fetch)
899 (uri (pypi-uri "ECPy" version))
900 (sha256
901 (base32
902 "1gc3i5s93zq6x1nkaxkq1dvmsc12vmrw0hns9f5s1hcb78ni52c8"))))
903 (build-system python-build-system)
904 (propagated-inputs
905 `(("python-future" ,python-future)))
906 (home-page "https://github.com/ubinity/ECPy")
907 (synopsis "Pure Python Elliptic Curve Library")
908 (description "This package provides a Elliptic Curve Library in pure
909 Python.")
910 (license license:asl2.0)))
911
912 (define-public python2-ecpy
913 (package-with-python2 python-ecpy))
914
915 (define-public python-josepy
916 (package
917 (name "python-josepy")
918 (version "1.1.0")
919 (source (origin
920 (method url-fetch)
921 (uri (pypi-uri "josepy" version))
922 (sha256
923 (base32
924 "11khz8malzrv375b27jjkv66z6z6khdx1v5mkkr4vq16gp3n4p7v"))))
925 (build-system python-build-system)
926 (arguments
927 ;; The tests require flake8 >= 3.5, which is not yet packaged.
928 '(#:tests? #f))
929 (propagated-inputs
930 `(("python-cryptography" ,python-cryptography)
931 ("python-pyopenssl" ,python-pyopenssl)
932 ("python-six" ,python-six)))
933 ;; TODO Enable when we have flake8 >= 3.5.
934 ; (native-inputs
935 ; `(("python-coverage" ,python-coverage)
936 ; ("python-flake8" ,python-flake8)
937 ; ("python-isort" ,python-isort)
938 ; ("python-mock" ,python-mock)
939 ; ("python-pytest" ,python-pytest)
940 ; ("python-pytest-cov" ,python-pytest-cov)
941 ; ("python-pytest-cache" ,python-pytest-cache)
942 ; ("python-pytest-flake8" ,python-pytest-flake8)))
943 (home-page "https://github.com/certbot/josepy")
944 (synopsis "JOSE protocol implementation in Python")
945 (description "This package provides a Python implementation of the JOSE
946 protocol (Javascript Object Signing and Encryption).")
947 (license license:asl2.0)))
948
949 (define-public python2-josepy
950 (package-with-python2 python-josepy))
951
952 (define-public python-pycryptodome
953 (package
954 (name "python-pycryptodome")
955 (version "3.7.3")
956 (source
957 (origin
958 (method url-fetch)
959 (uri (pypi-uri "pycryptodome" version))
960 (sha256
961 (base32
962 "0dh6ky5ngxayyn5f6n7gdamjl49g3khz6pdx9sdnag1zwi8248hs"))))
963 (build-system python-build-system)
964 (home-page "https://www.pycryptodome.org")
965 (synopsis "Cryptographic library for Python")
966 (description "This package provides a cryptographic library for Python.
967
968 It brings the following enhancements with respect to the last official version
969 of PyCrypto:
970
971 @itemize
972 @item Authenticated encryption modes (GCM, CCM, EAX, SIV, OCB)
973 @item Accelerated AES on Intel platforms via AES-NI
974 @item First class support for PyPy
975 @item Elliptic curves cryptography (NIST P-256 curve only)
976 @item Better and more compact API (nonce and iv attributes for ciphers,
977 automatic generation of random nonces and IVs, simplified CTR cipher mode, and
978 more)
979 @item SHA-3 (including SHAKE XOFs) and BLAKE2 hash algorithms
980 @item Salsa20 and ChaCha20 stream ciphers
981 @item scrypt and HKDF
982 @item Deterministic (EC)DSA
983 @item Password-protected PKCS#8 key containers
984 @item Shamir’s Secret Sharing scheme
985 @item Random numbers get sourced directly from the OS (and not from a CSPRNG
986 in userspace)
987 @item Cleaner RSA and DSA key generation (largely based on FIPS 186-4)
988 @item Major clean ups and simplification of the code base
989 @end itemize\n")
990 (license license:bsd-2)))
991
992 (define-public python2-pycryptodome
993 (package-with-python2 python-pycryptodome))
994
995 (define-public python-m2crypto
996 (package
997 (name "python-m2crypto")
998 (version "0.35.2")
999 (source
1000 (origin
1001 (method url-fetch)
1002 (uri (pypi-uri "M2Crypto" version))
1003 (sha256
1004 (base32 "09yirf3w77w6f49q6nxhrjm9c3a4y9s30s1k09chqrw8zdgx8sjc"))))
1005 (build-system python-build-system)
1006 (inputs `(("openssl" ,openssl)))
1007 (home-page "https://gitlab.com/m2crypto/m2crypto")
1008 (synopsis "Python crypto and TLS toolkit")
1009 (description "@code{M2Crypto} is a complete Python wrapper for OpenSSL
1010 featuring RSA, DSA, DH, EC, HMACs, message digests, symmetric ciphers
1011 (including AES); TLS functionality to implement clients and servers; HTTPS
1012 extensions to Python's httplib, urllib, and xmlrpclib; unforgeable HMAC'ing
1013 AuthCookies for web session management; FTP/TLS client and server; S/MIME;
1014 M2Crypto can also be used to provide TLS for Twisted. Smartcards supported
1015 through the Engine interface.")
1016 (properties `((python2-variant . ,(delay python2-m2crypto))))
1017 (license license:expat)))
1018
1019 (define-public python2-m2crypto
1020 (let ((m2crypto (package-with-python2
1021 (strip-python2-variant python-m2crypto))))
1022 (package (inherit m2crypto)
1023 (propagated-inputs
1024 `(("python2-typing" ,python2-typing))))))
1025
1026 (define-public python-pylibscrypt
1027 (package
1028 (name "python-pylibscrypt")
1029 (version "1.7.1")
1030 (source
1031 (origin
1032 (method url-fetch)
1033 (uri (pypi-uri "pylibscrypt" version))
1034 (sha256
1035 (base32
1036 "1b3rgzl6dbzs08vhv41b6y4n5189wv7lr27acxn104hs45745abs"))))
1037 (build-system python-build-system)
1038 (arguments
1039 `(#:phases
1040 (modify-phases %standard-phases
1041 (add-before 'build 'hard-code-path-to-libscrypt
1042 (lambda* (#:key inputs #:allow-other-keys)
1043 (let ((libscrypt (assoc-ref inputs "libscrypt")))
1044 (substitute* "pylibscrypt/pylibscrypt.py"
1045 (("find_library\\('scrypt'\\)")
1046 (string-append "'" libscrypt "/lib/libscrypt.so'")))
1047 #t))))
1048 ;; The library can use various scrypt implementations and tests all of
1049 ;; them. Since we only provide a single implementation, most tests
1050 ;; fail. Simply skip them.
1051 #:tests? #f))
1052 ;; FIXME: Using "libscrypt" is the second best choice. The best one
1053 ;; requires "hashlib.scrypt", provided by Python 3.6+ built with OpenSSL
1054 ;; 1.1+. Use that as soon as Guix provides it.
1055 (inputs
1056 `(("libscrypt" ,libscrypt)))
1057 (home-page "https://github.com/jvarho/pylibscrypt")
1058 (synopsis "Scrypt for Python")
1059 (description "There are a lot of different scrypt modules for Python, but
1060 none of them have everything that I'd like, so here's one more. It uses
1061 @code{libscrypt}.")
1062 (license license:isc)))
1063
1064 (define-public python-libnacl
1065 (package
1066 (name "python-libnacl")
1067 (version "1.6.1")
1068 (source
1069 (origin
1070 (method url-fetch)
1071 (uri (pypi-uri "libnacl" version))
1072 (sha256
1073 (base32
1074 "0nv7n8nfswkhl614x5mllrkvaslraa0053q11iylb337cy43vb4v"))))
1075 (build-system python-build-system)
1076 (arguments
1077 `(#:phases
1078 (modify-phases %standard-phases
1079 (add-after 'unpack 'locate-libsodium
1080 (lambda* (#:key inputs #:allow-other-keys)
1081 (substitute* "libnacl/__init__.py"
1082 (("(return ctypes.cdll.LoadLibrary\\(')libsodium.so('\\))"
1083 _ pre post)
1084 (let ((libsodium (string-append (assoc-ref inputs "libsodium")
1085 "/lib/libsodium.so")))
1086 (string-append pre libsodium post)))))))))
1087 (native-inputs
1088 `(("python-pyhamcrest" ,python-pyhamcrest)))
1089 (inputs
1090 `(("libsodium" ,libsodium)))
1091 (home-page "https://libnacl.readthedocs.org/")
1092 (synopsis "Python bindings for libsodium based on ctypes")
1093 (description "@code{libnacl} is used to gain direct access to the
1094 functions exposed by @code{NaCl} library via @code{libsodium}. It has
1095 been constructed to maintain extensive documentation on how to use
1096 @code{NaCl} as well as being completely portable.")
1097 (license license:asl2.0)))
1098
1099 (define-public python-scrypt
1100 (package
1101 (name "python-scrypt")
1102 (version "0.8.7")
1103 (source
1104 (origin
1105 (method url-fetch)
1106 (uri (pypi-uri "scrypt" version))
1107 (sha256
1108 (base32
1109 "0hjk71k3mgnl8siikm9lii9im8kv0rb7inkjzx78rnancra48xxr"))))
1110 (build-system python-build-system)
1111 (inputs
1112 `(("openssl" ,openssl)))
1113 (home-page "https://bitbucket.org/mhallin/py-scrypt")
1114 (synopsis "Bindings for the scrypt key derivation function library")
1115 (description "This is a set of Python bindings for the scrypt key
1116 derivation function.")
1117 (license license:bsd-2)))
1118
1119 (define-public python-service-identity
1120 (package
1121 (name "python-service-identity")
1122 (version "18.1.0")
1123 (source
1124 (origin
1125 (method url-fetch)
1126 (uri (pypi-uri "service_identity" version))
1127 (sha256
1128 (base32
1129 "0b9f5qiqjy8ralzgwjgkhx82h6h8sa7532psmb8mkd65md5aan08"))))
1130 (build-system python-build-system)
1131 (propagated-inputs
1132 `(("python-attrs" ,python-attrs)
1133 ("python-pyasn1" ,python-pyasn1)
1134 ("python-pyasn1-modules" ,python-pyasn1-modules)
1135 ("python-pyopenssl" ,python-pyopenssl)))
1136 (home-page "https://service-identity.readthedocs.io/")
1137 (synopsis "Service identity verification for PyOpenSSL")
1138 (description
1139 "@code{service_identity} aspires to give you all the tools you need
1140 for verifying whether a certificate is valid for the intended purposes.
1141 In the simplest case, this means host name verification. However,
1142 service_identity implements RFC 6125 fully and plans to add other
1143 relevant RFCs too.")
1144 (license license:expat)))
1145
1146 (define-public python2-service-identity
1147 (package-with-python2 python-service-identity))
1148
1149 (define-public python-hkdf
1150 (package
1151 (name "python-hkdf")
1152 (version "0.0.3")
1153 (source
1154 (origin
1155 (method url-fetch)
1156 (uri (pypi-uri "hkdf" version))
1157 (sha256
1158 (base32
1159 "1jhxk5vhxmxxjp3zj526ry521v9inzzl8jqaaf0ma65w6k332ak2"))))
1160 (build-system python-build-system)
1161 (native-inputs
1162 `(("python-nose" ,python-nose)))
1163 (home-page "https://github.com/casebeer/python-hkdf")
1164 (synopsis "HMAC-based Extract-and-Expand Key Derivation Function (HKDF)")
1165 (description "This package provides a Python implementation of the HMAC Key
1166 Derivation function (HKDF) defined in RFC 5869.")
1167 (license license:bsd-2)))
1168
1169 (define-public python-spake2
1170 (package
1171 (name "python-spake2")
1172 (version "0.8")
1173 (source
1174 (origin
1175 (method url-fetch)
1176 (uri (pypi-uri "spake2" version))
1177 (sha256
1178 (base32
1179 "1x16r7lrbklvfzbacb66qv9iiih6liq1y612dqh2chgf555n2yn1"))))
1180 (build-system python-build-system)
1181 (propagated-inputs
1182 `(("python-hkdf" ,python-hkdf)))
1183 (home-page "https://github.com/warner/python-spake2")
1184 (synopsis "SPAKE2 password-authenticated key exchange in Python")
1185 (description "This package provides a Python implementation of the SPAKE2
1186 Password-Authenticated Key Exchange algorithm.")
1187 (license license:expat)))
1188
1189 (define-public python-txtorcon
1190 (package
1191 (name "python-txtorcon")
1192 (version "19.0.0")
1193 (source
1194 (origin
1195 (method url-fetch)
1196 (uri (pypi-uri "txtorcon" version))
1197 (sha256
1198 (base32
1199 "0fxzhsc62bhmr730vj9pzallmw56gz6iykvl28a5agrycm0bfc9p"))))
1200 (build-system python-build-system)
1201 (arguments
1202 ;; The tests fail immediately due to a missing file. Reported upstream:
1203 ;; <https://github.com/meejah/txtorcon/issues/330>
1204 `(#:tests? #f))
1205 (propagated-inputs
1206 `(("python-automat" ,python-automat)
1207 ("python-idna" ,python-idna)
1208 ("python-incremental" ,python-incremental)
1209 ("python-ipaddress" ,python-ipaddress)
1210 ("python-service-identity" ,python-service-identity)
1211 ("python-twisted" ,python-twisted)
1212 ("python-zope-interface" ,python-zope-interface)))
1213 (home-page "https://github.com/meejah/txtorcon")
1214 (synopsis "Twisted-based Tor controller client")
1215 (description "This package provides a Twisted-based Tor controller client,
1216 with state-tracking and configuration abstractions.")
1217 (license license:expat)))
1218
1219 (define-public python-keyutils
1220 (package
1221 (name "python-keyutils")
1222 (version "0.6")
1223 (source
1224 (origin
1225 (method url-fetch)
1226 (uri (pypi-uri "keyutils" version))
1227 (sha256
1228 (base32
1229 "0lipygpzhwzzsq2k5imb1jgkmj8y4khxdwhzadjs3bd56g6bmkx9"))))
1230 (build-system python-build-system)
1231 (native-inputs
1232 `(("python-pytest" ,python-pytest)
1233 ("python-pytest-runner" ,python-pytest-runner)))
1234 (inputs
1235 `(("keyutils" ,keyutils)))
1236 (arguments
1237 '(#:tests? #f))
1238 (home-page "https://github.com/sassoftware/python-keyutils")
1239 (synopsis "Python bindings for keyutils")
1240 (description
1241 "This is a set of python bindings for keyutils, a key management suite
1242 that leverages the infrastructure provided by the Linux kernel for safely
1243 storing and retrieving sensitive information in your programs.")
1244 (license license:asl2.0)))
1245
1246 (define-public python-mcuboot-imgtool
1247 (package
1248 (name "python-mcuboot-imgtool")
1249 (version "1.4.0")
1250 (source
1251 (origin
1252 (method git-fetch)
1253 (uri (git-reference
1254 (url "https://github.com/JuulLabs-OSS/mcuboot")
1255 (commit (string-append "v" version))))
1256 (file-name (git-file-name name version))
1257 (sha256
1258 (base32
1259 "1m1csyvzq4jx81zg635ssy1n7sc0z539z0myh872ll3nwqx7wa0q"))))
1260 (build-system python-build-system)
1261 (arguments
1262 `(#:phases
1263 (modify-phases %standard-phases
1264 (add-after 'unpack 'fix-broken-test
1265 (lambda _
1266 (substitute* "scripts/imgtool/keys/ed25519_test.py"
1267 (("raw_sign") "sign_digest"))
1268 #t))
1269 (add-before 'build 'change-directory
1270 (lambda _
1271 (chdir "scripts")
1272 #t)))))
1273 (propagated-inputs
1274 `(("python-click" ,python-click)
1275 ("python-intelhex" ,python-intelhex)
1276 ("python-cryptography" ,python-cryptography)))
1277 (home-page "https://mcuboot.com")
1278 (synopsis "Tool to securely sign firmware images for booting by MCUboot")
1279 (description "MCUboot is a secure bootloader for 32-bit MCUs. This
1280 package provides a tool to securely sign firmware images for booting by
1281 MCUboot.")
1282 (license license:expat)))
1283
1284 (define-public python-ntlm-auth
1285 (package
1286 (name "python-ntlm-auth")
1287 (version "1.4.0")
1288 (source
1289 (origin
1290 (method url-fetch)
1291 (uri (pypi-uri "ntlm-auth" version))
1292 (sha256
1293 (base32
1294 "16mavidki4ma5ip8srqalr19gz4f5yn3cnmmgps1fmgfr24j63rm"))))
1295 (build-system python-build-system)
1296 (propagated-inputs
1297 `(("python-cryptography" ,python-cryptography)))
1298 (home-page "https://github.com/jborean93/ntlm-auth")
1299 (synopsis
1300 "Calculates NTLM Authentication codes")
1301 (description
1302 "This library handles the low-level details of NTLM authentication for
1303 use in authenticating with a service that uses NTLM. It will create and parse
1304 the 3 different message types in the order required and produce a base64
1305 encoded value that can be attached to the HTTP header.
1306
1307 The goal of this library is to offer full NTLM support including signing and
1308 sealing of messages as well as supporting MIC for message integrity and the
1309 ability to customise and set limits on the messages sent. Please see Features
1310 and Backlog for a list of what is and is not currently supported.")
1311 (license license:expat)))
1312
1313 (define-public python-secretstorage
1314 (package
1315 (name "python-secretstorage")
1316 (version "3.1.2")
1317 (source
1318 (origin
1319 (method url-fetch)
1320 (uri (pypi-uri "SecretStorage" version))
1321 (sha256
1322 (base32
1323 "1xmzr0j3066s220bss4nkgqbiwb5k4kkp2rkpqlqwjb5kfc8mnhm"))))
1324 (build-system python-build-system)
1325 (arguments
1326 '(#:tests? #f)) ; Tests require a running dbus service.
1327 (propagated-inputs
1328 `(("python-cryptography" ,python-cryptography)
1329 ("python-jeepney" ,python-jeepney)))
1330 (home-page "https://github.com/mitya57/secretstorage")
1331 (synopsis "Python bindings to FreeDesktop.org Secret Service API")
1332 (description
1333 "@code{python-secretstorage} provides a way for securely storing passwords
1334 and other secrets. It uses D-Bus Secret Service API that is supported by GNOME
1335 Keyring (since version 2.30) and KSecretsService. SecretStorage supports most
1336 of the functions provided by Secret Service, including creating and deleting
1337 items and collections, editing items, locking and unlocking collections
1338 (asynchronous unlocking is also supported).")
1339 (license license:bsd-3)))
1340
1341 (define-public python-jeepney
1342 (package
1343 (name "python-jeepney")
1344 (version "0.4.2")
1345 (source
1346 (origin
1347 (method url-fetch)
1348 (uri (pypi-uri "jeepney" version))
1349 (sha256
1350 (base32
1351 "1fz9lb5fl831sijg2j0sbki698j2z6awbblas7mz3gp9jz2xi9hb"))))
1352 (build-system python-build-system)
1353 (native-inputs
1354 `(("python-testpath" ,python-testpath)
1355 ("python-tornado" ,python-tornado)
1356 ("python-pytest" ,python-pytest)))
1357 (home-page "https://gitlab.com/takluyver/jeepney")
1358 (synopsis "Low-level, pure Python DBus protocol wrapper")
1359 (description
1360 "This is a low-level, pure Python DBus protocol client. It has an
1361 I/O-free core, and integration modules for different event loops.")
1362 (license license:expat)))
1363
1364 (define-public python-argon2-cffi
1365 (package
1366 (name "python-argon2-cffi")
1367 (version "19.2.0")
1368 (source
1369 (origin
1370 (method url-fetch)
1371 (uri (pypi-uri "argon2-cffi" version))
1372 (sha256
1373 (base32
1374 "18xxfw30gi3lwaz4vwb05iavzlrk3fa1x9fippzrgd3px8z65apz"))
1375 (modules '((guix build utils)))
1376 (snippet '(begin (delete-file-recursively "extras") #t))))
1377 (build-system python-build-system)
1378 (arguments
1379 '(#:phases
1380 (modify-phases %standard-phases
1381 (replace 'build
1382 (lambda _
1383 (setenv "ARGON2_CFFI_USE_SYSTEM" "1")
1384 (invoke "python" "setup.py" "build")))
1385 (replace 'check
1386 (lambda* (#:key inputs outputs #:allow-other-keys)
1387 (add-installed-pythonpath inputs outputs)
1388 (invoke "pytest")
1389 (invoke "python" "-m" "argon2" "--help")
1390 ;; see tox.ini
1391 (invoke "python" "-m" "argon2" "-n" "1" "-t" "1" "-m" "8" "-p" "1"))))))
1392 (propagated-inputs
1393 `(("python-cffi" ,python-cffi)
1394 ("python-six" ,python-six)))
1395 (inputs `(("argon2" ,argon2)))
1396 (native-inputs
1397 `(("python-hypothesis" ,python-hypothesis)
1398 ("python-pytest" ,python-pytest)))
1399 (home-page "https://argon2-cffi.readthedocs.io/")
1400 (synopsis "Secure Password Hashes for Python")
1401 (description
1402 "Argon2 is a secure password hashing algorithm. It is designed to have
1403 both a configurable runtime as well as memory consumption. This means that you
1404 can decide how long it takes to hash a password and how much memory is required.")
1405 (license license:expat)))
1406
1407 (define-public python-privy
1408 (package
1409 (name "python-privy")
1410 (version "6.0.0")
1411 (source
1412 (origin
1413 (method git-fetch)
1414 (uri (git-reference
1415 ;; Releases are untagged
1416 (url "https://github.com/ofek/privy")
1417 (commit "2838db3df239797c71bddacc48a4c49a83f35747")))
1418 (file-name (git-file-name name version))
1419 (sha256
1420 (base32
1421 "1m32dh5fqc8cy7jyf1z5fs6zvmdkbq5fi98hr609gbl7s0l0y0i9"))))
1422 (build-system python-build-system)
1423 (arguments
1424 '(#:phases
1425 (modify-phases %standard-phases
1426 (replace 'check
1427 (lambda _
1428 (invoke "python" "-m" "pytest"))))))
1429 (native-inputs
1430 `(("python-pytest" ,python-pytest)))
1431 (propagated-inputs
1432 `(("python-argon2-cffi" ,python-argon2-cffi)
1433 ("python-cryptography" ,python-cryptography)))
1434 (home-page "https://www.dropbox.com/developers")
1435 (synopsis "Library to password-protect your data")
1436 (description
1437 "Privy is a small and fast utility for password-protecting secret
1438 data such as API keys, cryptocurrency wallets, or seeds for digital
1439 signatures.")
1440 (license (list license:expat license:asl2.0)))) ; dual licensed