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