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