projects/guix·blob rename-kernel-team · refs

2098 lines · 77.1 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 Eric Dvorsak <[email protected]>
3;;; Copyright © 2015-2021, 2023, 2024 Efraim Flashner <[email protected]>
4;;; Copyright © 2015, 2016, 2017, 2019 Leo Famulari <[email protected]>
5;;; Copyright © 2016, 2017, 2020, 2022, 2023 Marius Bakke <[email protected]>
6;;; Copyright © 2017 Ben Sturmfels <[email protected]>
7;;; Copyright © 2016 Sou Bunnbu <[email protected]>
8;;; Copyright © 2015 Cyril Roelandt <[email protected]>
9;;; Copyright © 2014, 2017 Eric Bavier <[email protected]>
10;;; Copyright © 2015, 2016 David Thompson <[email protected]>
11;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <[email protected]>
12;;; Copyright © 2016, 2017 Nikita <[email protected]>
13;;; Copyright © 2014, 2015 Mark H Weaver <[email protected]>
14;;; Copyright © 2015, 2016, 2017, 2019, 2022, 2024, 2025 Ricardo Wurmus <[email protected]>
15;;; Copyright © 2016 Danny Milosavljevic <[email protected]>
16;;; Copyright © 2016, 2017, 2020 Arun Isaac <[email protected]>
17;;; Copyright © 2017 Carlo Zancanaro <[email protected]>
18;;; Copyright © 2018 Tomáš Čech <[email protected]>
19;;; Copyright © 2018, 2021 Nicolas Goaziou <[email protected]>
20;;; Copyright © 2018 Vagrant Cascadian <[email protected]>
21;;; Copyright © 2018 Nam Nguyen <[email protected]>
22;;; Copyright © 2019, 2025 Guillaume Le Vaillant <[email protected]>
23;;; Copyright © 2019 Clément Lassieur <[email protected]>
24;;; Copyright © 2020 Alexandros Theodotou <[email protected]>
25;;; Copyright © 2020 Justus Winter <[email protected]>
26;;; Copyright © 2020, 2021 Vinicius Monego <[email protected]>
27;;; Copyright © 2021, 2022, 2023 Maxim Cournoyer <[email protected]>
28;;; Copyright © 2021 Maxime Devos <[email protected]>
29;;; Copyright © 2022 Artyom V. Poptsov <[email protected]>
30;;; Copyright © 2022 Antero Mejr <[email protected]>
31;;; Copyright © 2023 Juliana Sims <[email protected]>
32;;; Copyright © 2023, 2025 Zheng Junjie <[email protected]>
33;;; Copyright © 2024 jgart <[email protected]>
34;;; Copyright © 2025 Sharlatan Hellseher <[email protected]>
35;;; Copyright © 2025 Nguyễn Gia Phong <[email protected]>
36;;; Copyright © 2025 Adrien 'neox' Bourmault <[email protected]>
37;;;
38;;; This file is part of GNU Guix.
39;;;
40;;; GNU Guix is free software; you can redistribute it and/or modify it
41;;; under the terms of the GNU General Public License as published by
42;;; the Free Software Foundation; either version 3 of the License, or (at
43;;; your option) any later version.
44;;;
45;;; GNU Guix is distributed in the hope that it will be useful, but
46;;; WITHOUT ANY WARRANTY; without even the implied warranty of
47;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48;;; GNU General Public License for more details.
49;;;
50;;; You should have received a copy of the GNU General Public License
51;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
52
53(define-module (gnu packages python-crypto)
54 #:use-module (guix packages)
55 #:use-module (guix download)
56 #:use-module (guix gexp)
57 #:use-module (guix hg-download)
58 #:use-module (guix git-download)
59 #:use-module (guix build-system cargo)
60 #:use-module (guix build-system pyproject)
61 #:use-module (guix utils)
62 #:use-module (gnu packages)
63 #:use-module (gnu packages nss)
64 #:use-module (gnu packages bash)
65 #:use-module (gnu packages check)
66 #:use-module (gnu packages crypto)
67 #:use-module (gnu packages kerberos)
68 #:use-module (gnu packages libffi)
69 #:use-module (gnu packages lsof)
70 #:use-module (gnu packages multiprecision)
71 #:use-module (gnu packages password-utils)
72 #:use-module (gnu packages pkg-config)
73 #:use-module (gnu packages protobuf)
74 #:use-module (gnu packages python)
75 #:use-module (gnu packages python-build)
76 #:use-module (gnu packages python-check)
77 #:use-module (gnu packages python-compression)
78 #:use-module (gnu packages python-web)
79 #:use-module (gnu packages python-xyz)
80 #:use-module (gnu packages rust)
81 #:use-module (gnu packages rust-apps)
82 #:use-module (gnu packages security-token)
83 #:use-module (gnu packages swig)
84 #:use-module (gnu packages time)
85 #:use-module (gnu packages tls)
86 #:use-module (gnu packages xml)
87 #:use-module ((guix licenses) #:prefix license:)
88 #:use-module (srfi srfi-1))
89
90(define-public python-base58
91 (package
92 (name "python-base58")
93 (version "2.1.1")
94 (source
95 (origin
96 (method url-fetch)
97 (uri (pypi-uri "base58" version))
98 (sha256
99 (base32 "1317ly0db7nnjg5k58f6nqa0svfcvn446xd5bpiyi0bfbczwpl65"))))
100 (build-system pyproject-build-system)
101 (native-inputs
102 (list python-pyhamcrest
103 python-pytest
104 python-pytest-benchmark
105 python-setuptools
106 python-wheel))
107 (home-page "https://github.com/keis/base58")
108 (synopsis "Base58 and Base58Check implementation")
109 (description
110 "Base58 and Base58Check implementation compatible with what is used by
111the Bitcoin network.")
112 (license license:expat)))
113
114(define-public python-bcrypt
115 (package
116 (name "python-bcrypt")
117 (version "3.2.2") ;the latest not Rust version
118 (source
119 (origin
120 (method url-fetch)
121 (uri (pypi-uri "bcrypt" version))
122 (sha256
123 (base32 "1yvbdfmkssx1jf2lrhbs58xljmyi3p82r7rav82pf1bp44642g23"))))
124 (build-system pyproject-build-system)
125 (native-inputs
126 (list python-pytest
127 python-setuptools))
128 (propagated-inputs
129 (list python-cffi))
130 (home-page "https://github.com/pyca/bcrypt/")
131 (synopsis "Modern password hashing library")
132 (description
133 "Bcrypt is a Python module which provides a password hashing method based
134on the Blowfish password hashing algorithm, as described in
135@url{http://static.usenix.org/events/usenix99/provos.html,\"A Future-Adaptable
136Password Scheme\"} by Niels Provos and David Mazieres.")
137 (license license:asl2.0)))
138
139(define-public python-bip32utils
140 (package
141 (name "python-bip32utils")
142 (version "0.3.post4")
143 (source
144 (origin
145 (method url-fetch)
146 (uri (pypi-uri "bip32utils" version))
147 (sha256
148 (base32 "1hj8iirdwxj2f3gp0d3bmz4gfll26ixkidh6rk9qjykjpc7z8w2r"))))
149 (build-system pyproject-build-system)
150 (arguments
151 (list #:tests? #f)) ;no tests
152 (native-inputs
153 (list python-setuptools))
154 (propagated-inputs
155 (list python-ecdsa))
156 ;; Original link is gone <https://github.com/prusnak/bip32utils>.
157 (home-page "https://salsa.debian.org/debian/python-bip32utils")
158 (synopsis
159 "Python implementation of Bitcoin hierarchical deterministic wallet")
160 (description
161 "This package provides utilities for generating and using Bitcoin
162Hierarchical Deterministic wallets
163(BIP0032).")
164 (license license:expat)))
165
166(define-public python-murmurhash
167 (package
168 (name "python-murmurhash")
169 (version "1.0.10")
170 (source
171 (origin
172 (method git-fetch)
173 (uri (git-reference
174 (url "https://github.com/explosion/murmurhash")
175 (commit (string-append "v" version))))
176 (file-name (git-file-name name version))
177 (sha256
178 (base32 "02ny4391kbrssq9bf7kq75615ragvbjhsqi9hgv7wiaiz6yai1k8"))))
179 (build-system pyproject-build-system)
180 (arguments
181 (list
182 #:phases
183 #~(modify-phases %standard-phases
184 (add-after 'install 'fix-installation
185 (lambda* (#:key inputs outputs #:allow-other-keys)
186 (with-directory-excursion
187 (string-append (site-packages inputs outputs) "/murmurhash")
188 (delete-file-recursively "tests")
189 (delete-file "mrmr.pyx")
190 (for-each
191 (lambda (file)
192 (chmod file #o555))
193 (find-files "." "\\.so$")))))
194 ;; XXX: Otherwise ModuleNotFoundError, and --pyargs doesn't seem
195 ;; to fix the issue.
196 (replace 'check
197 (lambda args
198 (copy-recursively "murmurhash/tests" "tests")
199 (delete-file-recursively "murmurhash")
200 (with-directory-excursion "tests"
201 (apply (assoc-ref %standard-phases 'check) args)))))))
202 (native-inputs
203 (list python-cython
204 python-murmurhash3
205 python-pytest
206 python-setuptools))
207 (home-page "https://github.com/explosion/murmurhash")
208 (synopsis "Cython bindings for MurmurHash2")
209 (description
210 "This package provides Cython bindings for MurmurHash2.")
211 (license license:expat)))
212
213(define-public python-passlib
214 (package
215 ;; TODO: Migrate to a fork as the project is not maintained.
216 ;; See: guix/guix#8068.
217 (name "python-passlib")
218 (version "1.7.4")
219 (source
220 (origin
221 (method hg-fetch)
222 (uri (hg-reference
223 (url "https://foss.heptapod.net/python-libs/passlib")
224 (changeset version)))
225 (file-name (hg-file-name name version))
226 (sha256
227 (base32 "1knbafs3ckcc6prd1ln2r0sdkawpzx7naf749cj3ljlms8v0bsca"))))
228 (build-system pyproject-build-system)
229 (arguments
230 (list
231 ;; tests: 1099 passed, 1011 skipped, 199 warnings
232 #:test-flags
233 #~(list "--numprocesses" (number->string (min 8 (parallel-job-count)))
234 ;; AssertionError: expected 'linux' platform would have native
235 ;; support for 'des_crypt', 'md5_crypt', 'sha256_crypt',
236 ;; 'sha512_crypt'
237 #$@(map (lambda (test)
238 (string-append "--deselect=passlib/"
239 "tests/test_handlers.py::"))
240 (list "des_crypt_os_crypt_test::test_82_crypt_support"
241 "md5_crypt_os_crypt_test::test_82_crypt_support"
242 "sha256_crypt_os_crypt_test::test_82_crypt_support"
243 "sha512_crypt_os_crypt_test::test_82_crypt_support")))
244 #:phases
245 #~(modify-phases %standard-phases
246 (add-before 'check 'set-PYTHON_EGG_CACHE
247 ;; Some tests require access to "$HOME/.cython".
248 (lambda _
249 (setenv "PYTHON_EGG_CACHE" "/tmp"))))))
250 (native-inputs
251 (list python-pytest
252 python-pytest-xdist
253 python-setuptools))
254 (propagated-inputs
255 (list python-argon2-cffi python-bcrypt python-cryptography))
256 (home-page "https://foss.heptapod.net/python-libs/passlib")
257 (synopsis "Comprehensive password hashing framework")
258 (description
259 "Passlib is a password hashing library for Python 2 & 3, which provides
260cross-platform implementations of over 30 password hashing algorithms, as well
261as a framework for managing existing password hashes. It's designed to be
262useful for a wide range of tasks, from verifying a hash found in /etc/shadow,
263to providing full-strength password hashing for multi-user application.")
264 (license license:bsd-3)))
265
266(define-public python-paramiko
267 (package
268 (name "python-paramiko")
269 (version "4.0.0")
270 (source
271 (origin
272 (method url-fetch)
273 (uri (pypi-uri "paramiko" version))
274 (sha256
275 (base32 "17ynnmagd44gpp76r26rz1kldb37f79hm4ibinlckj8c71xz09ba"))))
276 (build-system pyproject-build-system)
277 (native-inputs
278 (list python-icecream
279 python-pytest
280 python-pytest-relaxed
281 python-setuptools))
282 (propagated-inputs
283 (list python-bcrypt
284 python-cryptography
285 python-invoke
286 python-pyasn1
287 python-pynacl))
288 (home-page "https://www.paramiko.org/")
289 (synopsis "SSHv2 protocol library")
290 (description "Paramiko is a python implementation of the SSHv2 protocol,
291providing both client and server functionality. While it leverages a Python C
292extension for low level cryptography (PyCrypto), Paramiko itself is a pure
293Python interface around SSH networking concepts.")
294 (license license:lgpl2.1+)))
295
296(define-public python-ecdsa
297 (package
298 (name "python-ecdsa")
299 (version "0.19.0")
300 (source
301 (origin
302 (method url-fetch)
303 (uri (pypi-uri "ecdsa" version))
304 (sha256
305 (base32 "1y3bmx6aw5klx143jas3czwbsfvr5d3fs8gm1bfh16b5k48svsk0"))))
306 (build-system pyproject-build-system)
307 (arguments
308 (list
309 ;; Test fails with error: AssertionError: KeyboardInterrupt not raised.
310 #:test-flags #~(list "-k" "not test_multithreading_with_interrupts")))
311 (native-inputs
312 (list openssl
313 python-pytest
314 python-setuptools
315 python-wheel))
316 (propagated-inputs
317 (list python-six))
318 (home-page "https://github.com/warner/python-ecdsa")
319 (synopsis "ECDSA cryptographic signature library (pure python)")
320 (description
321 "This is an easy-to-use implementation of ECDSA cryptography (Elliptic
322Curve Digital Signature Algorithm), implemented purely in Python. With this
323library, you can quickly create key pairs (signing key and verifying key), sign
324messages, and verify the signatures. The keys and signatures are very short,
325making them easy to handle and incorporate into other protocols.")
326 (license license:expat)))
327
328(define-public python-kerberos
329 (package
330 (name "python-kerberos")
331 (version "1.3.1")
332 (source
333 (origin
334 (method url-fetch)
335 (uri (pypi-uri "kerberos" version))
336 (sha256
337 (base32 "0b0a8rrwgfjrslz3jd3r5l7vr7jx5bc17sq0dbwn002f58a4dl6d"))))
338 (build-system pyproject-build-system)
339 (arguments
340 ;; No tests in PyPI, provided in Git but all of them require networking.
341 (list #:tests? #f))
342 (native-inputs
343 (list python-setuptools
344 python-wheel))
345 (inputs
346 (list mit-krb5))
347 (home-page "https://github.com/apple/ccs-pykerberos")
348 (synopsis "Python Kerberos library used by CalendarServer")
349 (description
350 "This Python package is a high-level wrapper for Kerberos (GSSAPI)
351operations. The goal is to avoid having to build a module that wraps the
352entire Kerberos.framework, and instead offer a limited set of functions that
353do what is needed for client/server Kerberos authentication based on
354<http://www.ietf.org/rfc/rfc4559.txt>.")
355 (license license:asl2.0)))
356
357(define-public python-keyring
358 (package
359 (name "python-keyring")
360 (version "25.7.0")
361 (source
362 (origin
363 (method git-fetch)
364 (uri (git-reference
365 (url "https://github.com/jaraco/keyring")
366 (commit (string-append "v" version))))
367 (file-name (git-file-name name version))
368 (sha256
369 (base32 "116nkhnldhgqd5nz0wf5zfjnkmlrpwj47pdd8p4r1zrizkr3dnxz"))))
370 (build-system pyproject-build-system)
371 (native-inputs
372 (list python-pyfakefs
373 python-pytest
374 python-setuptools
375 python-setuptools-scm))
376 (propagated-inputs
377 (list python-jaraco-classes
378 python-jaraco-context
379 python-jaraco-functools
380 python-jeepney
381 python-secretstorage))
382 (home-page "https://github.com/jaraco/keyring")
383 (synopsis "Store and access your passwords safely")
384 (description
385 "The Python keyring lib provides a easy way to access the system keyring
386service from python. It can be used in any application that needs safe
387password storage.")
388 ;; "MIT" and PSF dual license, see:
389 ;; <https://github.com/jaraco/keyring/issues/263>.
390 (license license:x11)))
391
392(define-public python-keyrings-alt
393 (package
394 (name "python-keyrings-alt")
395 (version "5.0.2")
396 (source
397 (origin
398 (method url-fetch)
399 (uri (pypi-uri "keyrings_alt" version))
400 (sha256
401 (base32 "1yv9gnmkw6kpsjgnid0k1qcd49n9csqcvf02cl88bcf8knz7w2cg"))))
402 (build-system pyproject-build-system)
403 (native-inputs
404 (list python-keyring
405 python-pytest
406 python-setuptools
407 python-setuptools-scm
408 python-wheel))
409 (propagated-inputs
410 (list python-jaraco-classes
411 python-jaraco-context))
412 (home-page "https://github.com/jaraco/keyrings.alt")
413 (synopsis "Alternate keyring implementations")
414 (description
415 "Keyrings in this package may have security risks or other implications.
416These backends were extracted from the main keyring project to make them
417available for those who wish to employ them, but are discouraged for general
418production use. Include this module and use its backends at your own risk.")
419 (license license:expat)))
420
421(define-public python-blake3
422 (package
423 (name "python-blake3")
424 (version "1.0.8")
425 (source
426 (origin
427 (method url-fetch)
428 (uri (pypi-uri "blake3" version))
429 (sha256
430 (base32 "1fk5n55cl2iigrjdwwsm6h8q6in1l19cihh44s0kbh57ypqcfg2i"))))
431 (build-system cargo-build-system)
432 (arguments
433 (list
434 #:install-source? #f
435 #:imported-modules `(,@%pyproject-build-system-modules
436 ,@%cargo-build-system-modules)
437 #:modules `((guix build cargo-build-system)
438 ((guix build pyproject-build-system) #:prefix py:)
439 (guix build utils))
440 #:phases
441 #~(modify-phases %standard-phases
442 (add-after 'build 'build-python-module
443 (assoc-ref py:%standard-phases 'build))
444 (add-after 'build-python-module 'install-python-module
445 (assoc-ref py:%standard-phases 'install)))))
446 (native-inputs
447 (list python-wrapper
448 maturin))
449 (inputs (cargo-inputs 'python-blake3))
450 (propagated-inputs (list python-typing-extensions))
451 (home-page "https://github.com/oconnor663/blake3-py")
452 (synopsis "Python bindings for the Rust blake3 crate")
453 (description "This package provides Python bindings for the Rust crate of
454blake3, a cryptographic hash function.")
455 ;; This work is released into the public domain with CC0
456 ;; 1.0. Alternatively, it is licensed under the Apache License 2.0.
457 (license (list license:asl2.0 license:cc0))))
458
459(define-public python-certauth
460 (package
461 (name "python-certauth")
462 (version "1.3.0")
463 (source
464 (origin
465 (method url-fetch)
466 (uri (pypi-uri "certauth" version))
467 (sha256
468 (base32
469 "1yxqfb5131wahjyw9pxz03bq476rcfx62s6k53xx4cqbzzgdaqkq"))))
470 (build-system pyproject-build-system)
471 (arguments
472 (list
473 #:test-flags
474 #~(list "-k" (string-join
475 (list
476 ;; Those tests uses PKCS12, which has been removed in
477 ;; pyopenssl 23.3.0:
478 "not test_custom_not_before_not_after"
479 "test_ca_cert_in_mem")
480 " and not "))
481 #:phases
482 #~(modify-phases %standard-phases
483 (add-after 'unpack 'adjust-test
484 (lambda _
485 ;; Newer PyOpenSSL no longer separates extensions with
486 ;; newline (this can be removed for >1.3.0).
487 (substitute* "test/test_certauth.py"
488 (("7334\\\\n, DNS") "7334, DNS")))))))
489 (propagated-inputs
490 (list python-pyopenssl python-tldextract))
491 (native-inputs
492 (list nss-certs-for-test python-pytest python-setuptools))
493 (home-page "https://github.com/ikreymer/certauth")
494 (synopsis "Certificate authority creation tool")
495 (description "This package provides a small library, built on top of
496pyOpenSSL, which allows for creating a custom certificate authority (CA)
497certificate, and generating on-demand dynamic host certs using that CA
498certificate. It is most useful for use with a man-in-the-middle HTTPS proxy,
499for example, for recording or replaying web content.")
500 (license license:expat)))
501
502(define-public python-certifi
503 (package
504 (name "python-certifi")
505 (version "2025.06.15")
506 (source
507 (origin
508 (method git-fetch) ; no tests in PyPI package
509 (uri (git-reference
510 (url "https://github.com/certifi/python-certifi")
511 (commit version)))
512 (file-name (git-file-name name version))
513 (sha256
514 (base32 "1yyy3c64xbwfg2b8hi1fd6vwh56fzc90jfy3czimv5i91gwrl7ba"))
515 (snippet #~(begin
516 (delete-file "certifi/cacert.pem")
517 (delete-file "certifi/core.py")
518 (with-output-to-file "certifi/core.py"
519 (lambda _
520 (display
521 "\"\"\"
522certifi.py
523~~~~~~~~~~
524This file is a Guix-specific version of core.py.
525
526This module returns the installation location of SSL_CERT_FILE or
527/etc/ssl/certs/ca-certificates.crt, or its contents.
528\"\"\"
529import os
530
531_CA_CERTS = None
532
533try:
534 _CA_CERTS = os.environ [\"SSL_CERT_FILE\"]
535except:
536 _CA_CERTS = os.path.join(\"/etc\", \"ssl\", \"certs\", \"ca-certificates.crt\")
537
538def where() -> str:
539 return _CA_CERTS
540
541def contents() -> str:
542 with open(where(), \"r\", encoding=\"ascii\") as data:
543 return data.read()")))))))
544 (build-system pyproject-build-system)
545 (native-inputs
546 (list nss-certs-for-test
547 python-pytest
548 python-setuptools
549 python-wheel))
550 (home-page "https://certifi.io/")
551 (synopsis "Python CA certificate bundle")
552 (description
553 "Certifi is a Python library that contains a CA certificate bundle, which
554is used by the Requests library to verify HTTPS requests.")
555 (license license:asl2.0)))
556
557(define-public python-cryptography-vectors
558 (package
559 (name "python-cryptography-vectors")
560 (version "44.0.0")
561 (source
562 (origin
563 (method url-fetch)
564 (uri (pypi-uri "cryptography_vectors" version))
565 (sha256
566 (base32
567 "1aw06msy65rs27yxfp4xlwfq432ny1af5cx8s7zsbfa5div2hqhh"))))
568 (build-system pyproject-build-system)
569 (arguments (list #:tests? #f)) ; No tests included.
570 (native-inputs
571 (list python-flit-core))
572 (home-page "https://github.com/pyca/cryptography")
573 (synopsis "Test vectors for the cryptography package")
574 (description
575 "This package contains test vectors for the cryptography package.")
576 ;; Distributed under either BSD-3 or ASL2.0
577 (license (list license:bsd-3 license:asl2.0))))
578
579(define-public python-cryptography
580 (package
581 (name "python-cryptography")
582 (version "44.0.0")
583 (source
584 (origin
585 (method url-fetch)
586 (uri (pypi-uri "cryptography" version))
587 (sha256
588 (base32
589 "00is2nzcl2pyhr90llga5mnbw3rvakn75rq10x1r6hhb6i7q6knd"))
590 (snippet
591 #~(begin (use-modules (guix build utils))
592 (for-each delete-file
593 (find-files "." "Cargo\\.lock$"))
594 (substitute* "pyproject.toml"
595 (("locked = true") "offline = true"))))))
596 (build-system pyproject-build-system)
597 (arguments
598 (list
599 #:imported-modules `(,@%cargo-build-system-modules
600 ,@%pyproject-build-system-modules)
601 #:modules '(((guix build cargo-build-system) #:prefix cargo:)
602 (guix build pyproject-build-system)
603 (guix build utils))
604 #:phases
605 #~(modify-phases %standard-phases
606 (add-after 'unpack 'prepare-cargo-build-system
607 (lambda args
608 (for-each
609 (lambda (phase)
610 (format #t "Running cargo phase: ~a~%" phase)
611 (apply (assoc-ref cargo:%standard-phases phase)
612 #:cargo-target #$(cargo-triplet)
613 args))
614 '(unpack-rust-crates
615 configure
616 check-for-pregenerated-files
617 patch-cargo-checksums)))))))
618 (native-inputs
619 (append
620 (list python-certifi
621 python-cffi
622 python-click
623 python-cryptography-vectors
624 python-pretend
625 python-pytest
626 python-pytest-benchmark
627 python-pytest-randomly
628 python-pytest-xdist
629 python-setuptools
630 rust
631 `(,rust "cargo"))
632 (or (and=> (%current-target-system)
633 (compose list make-rust-sysroot))
634 '())))
635 (inputs
636 (cons* maturin openssl (cargo-inputs 'python-cryptography)))
637 (propagated-inputs (list python-cffi))
638 (home-page "https://github.com/pyca/cryptography")
639 (synopsis "Cryptographic recipes and primitives for Python")
640 (description
641 "@code{cryptography} is a package which provides cryptographic recipes
642and primitives to Python developers. It aims to be the “cryptographic
643standard library” for Python. The package includes both high level recipes,
644and low level interfaces to common cryptographic algorithms such as symmetric
645ciphers, message digests and key derivation functions.")
646 ;; Distributed under either BSD-3 or ASL2.0
647 (license (list license:bsd-3 license:asl2.0))))
648
649(define-public python-pyopenssl
650 (package
651 (name "python-pyopenssl")
652 (version "24.3.0")
653 (source
654 (origin
655 (method url-fetch)
656 (uri (pypi-uri "pyopenssl" version))
657 (sha256
658 (base32
659 "0dmv720kn5ws7bs1rkn59qmhzv5wxkkgriampi34g0vxawcs1xs9"))))
660 (build-system pyproject-build-system)
661 (arguments
662 (list
663 #:phases
664 #~(modify-phases %standard-phases
665 (replace 'check
666 (lambda* (#:key tests? #:allow-other-keys)
667 (when tests?
668 ;; PyOpenSSL runs tests against a certificate with a fixed
669 ;; expiry time. To ensure successful builds in the future,
670 ;; set the time to roughly the release date.
671 (invoke "faketime" "2024-07-20" "pytest" "-vv"
672 "--deselect"
673 ;; This test seems to fail when using faketime, at
674 ;; least on aarch64-linux with OSError: [Errno 22]
675 ;; Invalid argument
676 "tests/test_ssl.py::TestDTLS::test_timeout"
677 "-k"
678 ;; This test tries to look up certificates from
679 ;; the compiled-in default path in OpenSSL, which
680 ;; does not exist in the build environment.
681 "not test_fallback_default_verify_paths ")))))))
682 (propagated-inputs (list python-cryptography))
683 (inputs (list openssl))
684 (native-inputs
685 (list libfaketime
686 python-pretend
687 python-pytest
688 python-pytest-rerunfailures
689 python-setuptools))
690 (home-page "https://github.com/pyca/pyopenssl")
691 (synopsis "Python wrapper module around the OpenSSL library")
692 (description "PyOpenSSL is a high-level wrapper around a subset of the
693OpenSSL library.")
694 (properties `((updater-extra-inputs . ("openssl"))
695 (updater-extra-native-inputs . ("libfaketime"))))
696 (license license:asl2.0)))
697
698(define-public python-ed25519
699 (package
700 (name "python-ed25519")
701 (version "1.5")
702 (source
703 (origin
704 (method git-fetch)
705 (uri (git-reference
706 (url "https://github.com/warner/python-ed25519")
707 (commit version)))
708 (file-name (git-file-name name version))
709 (sha256
710 (base32 "0adxfm12wygh2gdsn83xmp1sw7w96ni7mr7v3z3y6q0mvh9n5x0p"))))
711 (build-system pyproject-build-system)
712 (arguments
713 (list
714 #:phases
715 #~(modify-phases %standard-phases
716 ;; XXX: Use custom test back-end on python-team branch.
717 (replace 'check
718 (lambda* (#:key tests? #:allow-other-keys)
719 (when tests? (invoke "python" "test_ed25519_kat.py")))))))
720 (native-inputs (list python-setuptools))
721 (home-page "https://github.com/warner/python-ed25519")
722 (synopsis "Ed25519 public-key signatures")
723 (description
724 "This package provides Ed25519 public-key signatures in Python.")
725 (license license:expat)))
726
727(define-public python-axolotl-curve25519
728 (package
729 (name "python-axolotl-curve25519")
730 (version "0.4.1.post2")
731 (source
732 (origin
733 (method url-fetch)
734 (uri (pypi-uri "python-axolotl-curve25519" version))
735 (sha256
736 (base32
737 "18v3rfyv7xi26fb97nw1xc0l6x8wi0i4xj8dlq4gblpbjxiac187"))))
738 (build-system pyproject-build-system)
739 (arguments
740 (list
741 #:tests? #f ; No tests.
742 #:phases
743 #~(modify-phases %standard-phases
744 (add-after 'unpack 'relax-gcc-14-strictness
745 (lambda _
746 (setenv "CFLAGS"
747 (string-append "-g -O2 -Wno-error=int-conversion")))))))
748 (native-inputs (list python-setuptools))
749 (home-page "https://github.com/tgalal/python-axolotl-curve25519")
750 (synopsis "Python wrapper for curve25519 library")
751 (description "This is a python wrapper for the curve25519 library
752with ed25519 signatures. The C code was pulled from
753libaxolotl-android. At the moment this wrapper is meant for use by
754python-axolotl.")
755 (license (list license:gpl3 ; Most files
756 license:bsd-3)))) ; curve/curve25519-donna.c
757
758(define-public python-omemo-dr
759 (package
760 (name "python-omemo-dr")
761 (version "1.2.0")
762 (source
763 (origin
764 (method git-fetch)
765 (uri (git-reference
766 (url "https://dev.gajim.org/gajim/omemo-dr")
767 (commit (string-append "v" version))))
768 (file-name (git-file-name name version))
769 (sha256
770 (base32 "18snryk95wyiz5jh5wa5x58yych9d8l9hmnqq828gsb5ncxq3szk"))))
771 (build-system pyproject-build-system)
772 (arguments (list #:test-backend #~'unittest))
773 (propagated-inputs
774 (list python-cryptography python-protobuf-5 python-setuptools))
775 (home-page "https://dev.gajim.org/gajim/omemo-dr")
776 (synopsis "OMEMO cryptography library")
777 (description "OMEMO cryptography library that was forked from python-axolotl.")
778 (license license:gpl3)))
779
780(define-public python-oscrypto
781 (package
782 (name "python-oscrypto")
783 (version "1.3.0")
784 (source
785 (origin
786 (method git-fetch)
787 (uri (git-reference
788 (url "https://github.com/wbond/oscrypto/")
789 (commit version)))
790 (file-name (git-file-name name version))
791 (sha256
792 (base32 "1v5wkmzcyiqy39db8j2dvkdrv2nlsc48556h73x4dzjwd6kg4q0a"))
793 (patches
794 (list
795 (origin
796 (method url-fetch)
797 (uri
798 (string-append "https://github.com/wbond/oscrypto/commit/"
799 "3865f5d528740aa1205d16ddbee84c5b48aeb078.patch"))
800 (sha256
801 (base32
802 "1lnvh5w4x5g4vnl8l078znd040zc6k4y18dzksbj7ydad3hrq73p")))))))
803 (build-system pyproject-build-system)
804 (arguments
805 (list
806 #:test-backend #~'custom
807 #:test-flags
808 #~(list "run.py"
809 (format #f "use_openssl=~a,~a"
810 (search-input-file %build-inputs "/lib/libcrypto.so")
811 (search-input-file %build-inputs "/lib/libssl.so"))
812 "skip_internet=true"
813 "tests")
814 #:phases
815 #~(modify-phases %standard-phases
816 (add-before 'check 'set-envs
817 (lambda* (#:key inputs #:allow-other-keys)
818 (setenv
819 "SSL_CERT_FILE"
820 (search-input-file
821 inputs "/etc/ssl/certs/ca-certificates.crt")))))))
822 (propagated-inputs (list python-asn1crypto))
823 (native-inputs (list nss-certs-for-test openssl python-setuptools))
824 (home-page "https://github.com/wbond/oscrypto/")
825 (synopsis "Compiler-free Python encryption library")
826 (description
827 "@code{Python-oscrypto} is a compilation-free encryption library which
828integrates with the encryption library that is part of the operating system.
829It supports TLS (SSL) sockets, key generation, encryption, decryption,
830signing, verification and KDFs using the OS crypto libraries.")
831 (license license:expat)))
832
833(define-public python-pyaes
834 ;; XXX: Last updated in 2017.
835 (package
836 (name "python-pyaes")
837 (version "1.6.1")
838 (source
839 (origin
840 (method url-fetch)
841 (uri (pypi-uri "pyaes" version))
842 (sha256
843 (base32 "13vdaff15k0jyfcss4b4xvfgm8xyv0nrbyw5n1qc7lrqbi0b3h82"))))
844 (build-system pyproject-build-system)
845 (arguments
846 (list #:tests? #f)) ;no tests in PyPI
847 (native-inputs (list python-setuptools))
848 (home-page "https://github.com/ricmoo/pyaes")
849 (synopsis "Implementation of AES in Python")
850 (description "This package contains a pure-Python implementation of the
851AES block cipher algorithm and the common modes of operation (CBC, CFB, CTR,
852ECB and OFB).")
853 (license license:expat)))
854
855(define-public python-asn1crypto
856 (let ((commit "b763a757bb2bef2ab63620611ddd8006d5e9e4a2")
857 (revision "0"))
858 (package
859 (name "python-asn1crypto")
860 (version (git-version "1.5.1" revision commit))
861 (source
862 (origin
863 (method git-fetch)
864 (uri (git-reference
865 (url "https://github.com/wbond/asn1crypto")
866 (commit commit)))
867 (file-name (git-file-name name version))
868 (sha256
869 (base32 "0xmrms7lj87pskgirf7ff21yih76kp2688x4n24wi2pd8269lmfp"))))
870 (build-system pyproject-build-system)
871 (arguments (list #:test-backend #~'unittest))
872 (native-inputs (list python-setuptools))
873 (home-page "https://github.com/wbond/asn1crypto")
874 (synopsis "ASN.1 parser and serializer in Python")
875 (description
876 "@code{asn1crypto} is an ASN.1 parser and serializer with definitions for
877private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8,
878PKCS#12, PKCS#5, X.509 and TSP.")
879 (license license:expat))))
880
881(define-public python-pynacl
882 (package
883 (name "python-pynacl")
884 (version "1.5.0")
885 (source
886 (origin
887 (method url-fetch)
888 (uri (pypi-uri "PyNaCl" version))
889 (modules '((guix build utils)))
890 (snippet
891 '(begin
892 ;; Remove bundled libsodium.
893 (delete-file-recursively "src/libsodium")))
894 (sha256
895 (base32
896 "1fi0jbxhh3svajzldlb6gj5sr5a48v11xlmx0wb831db167l9iwa"))))
897 (build-system pyproject-build-system)
898 (arguments
899 (list
900 #:phases
901 '(modify-phases %standard-phases
902 (add-before 'build 'use-system-sodium
903 (lambda _
904 (setenv "SODIUM_INSTALL" "system"))))))
905 (native-inputs
906 (list python-hypothesis python-pytest python-setuptools python-wheel))
907 (propagated-inputs
908 (list python-cffi python-six libsodium))
909 (home-page "https://github.com/pyca/pynacl/")
910 (synopsis "Python bindings to libsodium")
911 (description
912 "PyNaCl is a Python binding to libsodium, which is a fork of the
913Networking and Cryptography library. These libraries have a stated goal
914of improving usability, security and speed.")
915 (license license:asl2.0)))
916
917(define-public python-crcmod
918 (package
919 (name "python-crcmod")
920 (version "1.7")
921 (source (origin
922 (method url-fetch)
923 (uri (pypi-uri "crcmod" version))
924 (sha256
925 (base32
926 "07k0hgr42vw2j92cln3klxka81f33knd7459cn3d8aszvfh52w6w"))))
927 (build-system pyproject-build-system)
928 (arguments
929 (list
930 #:test-backend #~'custom
931 #:test-flags #~(list "-m" "crcmod.test")))
932 (native-inputs (list python-setuptools))
933 (synopsis "CRC generator for Python")
934 (description "Python module for generating objects that compute the
935Cyclic Redundancy Check.")
936 (home-page "https://crcmod.sourceforge.net/")
937 (license license:expat)))
938
939(define-public python-blurhash
940 (package
941 (name "python-blurhash")
942 (version "1.1.5")
943 (source
944 (origin
945 (method git-fetch)
946 (uri (git-reference
947 (url "https://github.com/halcy/blurhash-python")
948 (commit (string-append "v" version))))
949 (file-name (git-file-name name version))
950 (sha256
951 (base32 "16xcjxiya773fp7bxs9i6y1wsjx88pdvlwj6bqyy9vf3ckcffcwm"))))
952 (build-system pyproject-build-system)
953 (native-inputs
954 (list python-numpy python-pillow python-pytest python-setuptools))
955 (home-page "https://github.com/halcy/blurhash-python")
956 (synopsis "Pure-Python implementation of the blurhash algorithm")
957 (description
958 "This package provides a pure Python implementation of the blurhash
959algorithm.")
960 (license license:expat)))
961
962(define-public python-ecpy
963 (package
964 (name "python-ecpy")
965 (version "1.2.5")
966 (source
967 (origin
968 (method git-fetch)
969 (uri (git-reference
970 (url "https://github.com/cslashm/ECPy")
971 (commit version)))
972 (file-name (git-file-name name version))
973 (sha256
974 (base32
975 "0p642bpqicxjkwqk4q46wqkbxhad1qiir6xz4w7xx0d4cdq7yps8"))))
976 (build-system pyproject-build-system)
977 (arguments (list #:tests? #f)) ;no tests
978 (native-inputs
979 (list python-setuptools))
980 (home-page "https://github.com/cslashm/ECPy")
981 (synopsis "Pure Python Elliptic Curve Library")
982 (description "This package provides a Elliptic Curve Library in pure
983Python.")
984 (license license:asl2.0)))
985
986(define-public python-josepy
987 (package
988 (name "python-josepy")
989 (version "2.1.0")
990 (source
991 (origin
992 (method git-fetch)
993 (uri (git-reference
994 (url "https://github.com/certbot/josepy")
995 (commit (string-append "v" version))))
996 (file-name (git-file-name name version))
997 (sha256
998 (base32 "1zplnfrmc4nps9lgl3fz434ja7lmi9v8waydflzvpi75kf5fqxc1"))))
999 (build-system pyproject-build-system)
1000 (native-inputs (list python-poetry-core python-pytest))
1001 (propagated-inputs (list python-cryptography))
1002 (home-page "https://github.com/certbot/josepy")
1003 (synopsis "JOSE protocol implementation in Python")
1004 (description
1005 "This package provides a Python implementation of the JOSE protocol
1006(Javascript Object Signing and Encryption).")
1007 (license license:asl2.0)))
1008
1009(define pycryptodome-unbundle-tomcrypt-snippet
1010 #~(begin
1011 ;; Unbundle libtomcrypt.
1012 (delete-file-recursively "src/libtom")
1013 (substitute* "src/DES.c"
1014 (("#include \"libtom/tomcrypt_des.c\"")
1015 "#include <tomcrypt.h>"))
1016 (substitute* "setup.py"
1017 (("include_dirs=\\['src/', 'src/libtom/'\\]")
1018 ;; FIXME: why does '-ltomcrypt' need to be added
1019 ;; manually, even when 'tomcrypt' is added to 'libraries'?
1020 ;; This behaviour is not documented at
1021 ;; <https://docs.python.org/3/extending/building.html>.
1022 "include_dirs=['src/'], libraries=['tomcrypt', 'tommath'],
1023 extra_link_args=['-ltomcrypt', '-ltommath']"))))
1024
1025(define-public python-pycryptodome
1026 (package
1027 (name "python-pycryptodome")
1028 (version "3.23.0")
1029 (source
1030 (origin
1031 (method git-fetch)
1032 (uri (git-reference
1033 (url "https://github.com/Legrandin/pycryptodome")
1034 (commit (string-append "v" version))))
1035 (file-name (git-file-name name version))
1036 (sha256
1037 (base32 "0j1dk55y0q7gqmig1l5b8774w63w2i7qrii1xzkpzz0c3i229i67"))
1038 (modules '((guix build utils)))
1039 (snippet pycryptodome-unbundle-tomcrypt-snippet)))
1040 (build-system pyproject-build-system)
1041 (arguments
1042 (list
1043 ;; tests: 42912 passed
1044 #:test-backend #~'custom
1045 ;; As seen in
1046 ;; <https://github.com/Legrandin/pycryptodome/blob/v3.23.0/INSTALL.rst>.
1047 #:test-flags
1048 #~(list "-m" "Crypto.SelfTest")
1049 #:phases
1050 #~(modify-phases %standard-phases
1051 (add-after 'unpack 'patch-gmp-path
1052 (lambda* (#:key inputs #:allow-other-keys)
1053 (substitute* "lib/Crypto/Math/_IntegerGMP.py"
1054 (("load_lib\\(\"gmp\"")
1055 (format #f "load_lib(~s"
1056 (search-input-file inputs "/lib/libgmp.so.10")))))))))
1057 (native-inputs
1058 (list python-pycryptodome-test-vectors
1059 python-setuptools))
1060 (inputs
1061 (list gmp
1062 libtomcrypt
1063 libtommath))
1064 (home-page "https://www.pycryptodome.org")
1065 (synopsis "Low-level cryptographic Python library")
1066 (description
1067 "PyCryptodome is a self-contained Python package of low-level
1068cryptographic primitives. It's not a wrapper to a separate C library like
1069OpenSSL. To the largest possible extent, algorithms are implemented in pure
1070Python. Only the pieces that are extremely critical to performance (e.g.,
1071block ciphers) are implemented as C extensions.
1072
1073You are expected to have a solid understanding of cryptography and security
1074engineering to successfully use these primitives. You must also be able to
1075recognize that some are obsolete (e.g., TDES) or even insecure (RC4).
1076
1077It provides many enhancements over the last release of PyCrypto (2.6.1):
1078
1079@itemize
1080@item Authenticated encryption modes (GCM, CCM, EAX, SIV, OCB)
1081@item Accelerated AES on Intel platforms via AES-NI
1082@item First-class support for PyPy
1083@item Elliptic curves cryptography (NIST P-256 curve only)
1084@item Better and more compact API (nonce and iv attributes for ciphers,
1085automatic generation of random nonces and IVs, simplified CTR cipher mode, and
1086more)
1087@item SHA-3 (including SHAKE XOFs) and BLAKE2 hash algorithms
1088@item Salsa20 and ChaCha20 stream ciphers
1089@item scrypt and HKDF
1090@item Deterministic (EC)DSA
1091@item Password-protected PKCS#8 key containers
1092@item Shamir’s Secret Sharing scheme
1093@item Random numbers get sourced directly from the OS (and not from a CSPRNG
1094in userspace)
1095@item Cleaner RSA and DSA key generation (largely based on FIPS 186-4)
1096@item Major clean-ups and simplification of the code base
1097@end itemize
1098
1099This package provides drop-in compatibility with PyCrypto. It is one of two
1100PyCryptodome variants, the other being python-pycryptodomex.")
1101 (license (list license:bsd-2
1102 license:public-domain)))) ; code inherited from PyCrypto
1103
1104(define-public python-pycryptodome-test-vectors
1105 (package
1106 (name "python-pycryptodome-test-vectors")
1107 (version "1.0.22")
1108 (source
1109 (origin
1110 (method url-fetch)
1111 (uri (pypi-uri "pycryptodome_test_vectors" version))
1112 (sha256
1113 (base32 "19bn19fpnkj39nki2dp8k26is5fpqa3q7agkhk9rvfqfvzvgx3nn"))))
1114 (build-system pyproject-build-system)
1115 (arguments
1116 (list #:tests? #f)) ;no tests
1117 (native-inputs
1118 (list python-setuptools))
1119 (home-page "https://www.pycryptodome.org")
1120 (synopsis "Test vectors for PyCryptodome")
1121 (description
1122 "This package provides test vectors for @code{PyCryptodome}.")
1123 (license (list license:bsd-2
1124 license:asl2.0))))
1125
1126(define-public python-pycryptodomex
1127 (package/inherit python-pycryptodome
1128 (name "python-pycryptodomex")
1129 (arguments
1130 (substitute-keyword-arguments arguments
1131 ((#:test-flags _)
1132 #~(list "-m" "Cryptodome.SelfTest"))
1133 ((#:phases phases #~%standard-phases)
1134 #~(modify-phases #$phases
1135 (add-before 'build 'set-separate-namespace
1136 (lambda _
1137 ;; This changes the build logic, see setup.py.
1138 (with-output-to-file ".separate_namespace"
1139 (lambda _ (display "")))))))))
1140 (synopsis
1141 "Low-level cryptographic Python library independent of the old PyCrypto")
1142 (description
1143 "PyCryptodome is a self-contained Python package of low-level
1144cryptographic primitives. It's not a wrapper to a separate C library like
1145OpenSSL. To the largest possible extent, algorithms are implemented in pure
1146Python. Only the pieces that are extremely critical to performance (e.g.,
1147block ciphers) are implemented as C extensions.
1148
1149You are expected to have a solid understanding of cryptography and security
1150engineering to successfully use these primitives. You must also be able to
1151recognize that some are obsolete (e.g., TDES) or even insecure (RC4).
1152
1153It provides many enhancements over the last release of PyCrypto (2.6.1):
1154
1155@itemize
1156@item Authenticated encryption modes (GCM, CCM, EAX, SIV, OCB)
1157@item Accelerated AES on Intel platforms via AES-NI
1158@item First-class support for PyPy
1159@item Elliptic curves cryptography (NIST P-256 curve only)
1160@item Better and more compact API (nonce and iv attributes for ciphers,
1161automatic generation of random nonces and IVs, simplified CTR cipher mode, and
1162more)
1163@item SHA-3 (including SHAKE XOFs) and BLAKE2 hash algorithms
1164@item Salsa20 and ChaCha20 stream ciphers
1165@item scrypt and HKDF
1166@item Deterministic (EC)DSA
1167@item Password-protected PKCS#8 key containers
1168@item Shamir’s Secret Sharing scheme
1169@item Random numbers get sourced directly from the OS (and not from a CSPRNG
1170in userspace)
1171@item Cleaner RSA and DSA key generation (largely based on FIPS 186-4)
1172@item Major clean-ups and simplification of the code base
1173@end itemize
1174
1175PyCryptodomex is the stand-alone version of PyCryptodome that no longer
1176provides drop-in compatibility with PyCrypto.")))
1177
1178(define-public python-m2crypto
1179 (package
1180 (name "python-m2crypto")
1181 (version "0.47.0")
1182 (source
1183 (origin
1184 (method git-fetch)
1185 (uri (git-reference
1186 (url "https://gitlab.com/m2crypto/m2crypto")
1187 (commit version)))
1188 (file-name (git-file-name name version))
1189 (sha256
1190 (base32 "090dvgnjmqidh0c318kipysiy24cn1rwbmxl4vybnqd57n65xsn8"))))
1191 (build-system pyproject-build-system)
1192 (arguments
1193 `(;; FIXME: Tests start failing with time due to date checks in TLS
1194 ;; certificates.
1195 #:tests? #f))
1196 (inputs (list openssl))
1197 (native-inputs (list swig python-setuptools))
1198 (home-page "https://gitlab.com/m2crypto/m2crypto")
1199 (synopsis "Python crypto and TLS toolkit")
1200 (description "@code{M2Crypto} is a complete Python wrapper for OpenSSL
1201featuring RSA, DSA, DH, EC, HMACs, message digests, symmetric ciphers
1202(including AES); TLS functionality to implement clients and servers; HTTPS
1203extensions to Python's httplib, urllib, and xmlrpclib; unforgeable HMAC'ing
1204AuthCookies for web session management; FTP/TLS client and server; S/MIME;
1205M2Crypto can also be used to provide TLS for Twisted. Smartcards supported
1206through the Engine interface.")
1207 (license license:expat)))
1208
1209(define-public python-pykeepass
1210 (package
1211 (name "python-pykeepass")
1212 (version "4.1.1.post1")
1213 (source
1214 (origin
1215 (method git-fetch)
1216 (uri (git-reference
1217 (url "https://github.com/libkeepass/pykeepass")
1218 (commit (string-append "v" version))))
1219 (file-name (git-file-name name version))
1220 (sha256
1221 (base32 "1ayvgklq3naydx01m7hyvf44ywczk5yzy2pk48bpfayl7bgk7q8d"))))
1222 (build-system pyproject-build-system)
1223 (arguments
1224 ;; tests: 115 passed
1225 (list #:test-backend #~'unittest))
1226 (native-inputs
1227 (list python-setuptools))
1228 (propagated-inputs
1229 (list python-argon2-cffi
1230 python-construct
1231 python-lxml
1232 python-pycryptodomex
1233 python-pyotp))
1234 (home-page "https://github.com/libkeepass/pykeepass")
1235 (synopsis "Python library to interact with keepass databases")
1236 (description
1237 "This library allows you to write entries to a KeePass database. It
1238supports KDBX3 and KDBX4.")
1239 ;; There are no copyright headers in the source code. The LICENSE file
1240 ;; indicates GPL3.
1241 (license license:gpl3+)))
1242
1243(define-public python-pykcs11
1244 (package
1245 (name "python-pykcs11")
1246 (version "1.5.18")
1247 (source
1248 (origin
1249 (method git-fetch)
1250 (uri (git-reference
1251 (url "https://github.com/LudovicRousseau/PyKCS11")
1252 (commit version)))
1253 (file-name (git-file-name name version))
1254 (sha256
1255 (base32 "1r1xn5lfnrnl62prd0a5ckmc8mggn6nqcnhsj9zg0vhf00ffs4gg"))))
1256 (build-system pyproject-build-system)
1257 (arguments
1258 (list
1259 #:phases
1260 #~(begin
1261 (use-modules (ice-9 textual-ports))
1262 (modify-phases %standard-phases
1263 (add-before 'check 'fix-test-run
1264 (lambda* (#:key inputs #:allow-other-keys)
1265 (delete-file-recursively "PyKCS11")
1266 (setenv "PYKCS11LIB" (search-input-file inputs "/lib/softhsm/libsofthsm2.so"))))
1267 (add-before 'check 'setup-softhsm
1268 (lambda _
1269 (call-with-output-file "softhsm2.conf"
1270 (lambda (port)
1271 (put-string port "directories.tokendir = /tmp/tokens/")))
1272 (setenv "SOFTHSM2_CONF" "softhsm2.conf")
1273 (mkdir "/tmp/tokens")
1274 (invoke "test/reset_softHSM.sh")))))))
1275 (native-inputs
1276 (list bash-minimal
1277 python-asn1crypto
1278 python-setuptools
1279 python-pytest
1280 softhsm
1281 swig))
1282 (home-page "https://github.com/LudovicRousseau/PyKCS11")
1283 (synopsis "PKCS#11 wrapper for Python")
1284 (description "This package provides a complete PKCS#11 wrapper for Python.")
1285 (license license:gpl3)))
1286
1287(define-public python-pylibscrypt
1288 (package
1289 (name "python-pylibscrypt")
1290 (version "2.0.0")
1291 (source
1292 (origin
1293 (method git-fetch)
1294 (uri (git-reference
1295 (url "https://github.com/jvarho/pylibscrypt")
1296 (commit (string-append "v" version))))
1297 (file-name (git-file-name name version))
1298 (sha256
1299 (base32 "0hshivwl3xznlqhrvwbylp40k1bfx4gnyzmxwldkwjhf1260zan1"))))
1300 (build-system pyproject-build-system)
1301 (native-inputs (list python-pytest python-setuptools python-wheel))
1302 (home-page "https://github.com/jvarho/pylibscrypt")
1303 (synopsis "Scrypt for Python")
1304 (description
1305 "This package provides another Scrypt module for Python.")
1306 (license license:isc)))
1307
1308(define-public python-libnacl
1309 (package
1310 (name "python-libnacl")
1311 (version "2.1.0")
1312 (source
1313 (origin
1314 (method url-fetch)
1315 (uri (pypi-uri "libnacl" version))
1316 (sha256
1317 (base32
1318 "0q18j8kfibhi5qckakhf0b0psf8nkll91nfp3yqxkri9vykqshgk"))))
1319 (build-system pyproject-build-system)
1320 (arguments
1321 `(#:phases
1322 (modify-phases %standard-phases
1323 (add-after 'unpack 'locate-libsodium
1324 (lambda* (#:key inputs #:allow-other-keys)
1325 (substitute* "libnacl/__init__.py"
1326 (("ctypes\\.util\\.find_library\\('sodium'\\)")
1327 (string-append "'"
1328 (search-input-file inputs "/lib/libsodium.so")
1329 "'")))))
1330 (replace 'check
1331 (lambda* (#:key tests? #:allow-other-keys)
1332 (when tests?
1333 (invoke "python" "-m" "unittest" "discover"
1334 "--start-directory" "tests" "-v")))))))
1335 (native-inputs
1336 (list python-poetry-core))
1337 (inputs
1338 (list libsodium))
1339 (home-page "https://libnacl.readthedocs.org/")
1340 (synopsis "Python bindings for libsodium based on ctypes")
1341 (description "@code{libnacl} is used to gain direct access to the
1342functions exposed by @code{NaCl} library via @code{libsodium}. It has
1343been constructed to maintain extensive documentation on how to use
1344@code{NaCl} as well as being completely portable.")
1345 (license license:asl2.0)))
1346
1347(define-public python-pyotp
1348 (package
1349 (name "python-pyotp")
1350 (version "2.9.0")
1351 (source
1352 (origin
1353 (method git-fetch)
1354 (uri (git-reference
1355 (url "https://github.com/pyauth/pyotp")
1356 (commit (string-append "v" version))))
1357 (file-name (git-file-name name version))
1358 (sha256
1359 (base32 "0fx253649bvs2w31jdwnr51dm0b6v1zhp7mprnis37c57vj4qczz"))))
1360 (build-system pyproject-build-system)
1361 (arguments
1362 (list
1363 #:test-flags
1364 #~(list "test.py")))
1365 (native-inputs
1366 (list python-setuptools
1367 python-pytest))
1368 (home-page "https://github.com/pyauth/pyotp")
1369 (synopsis "Python One Time Password Library")
1370 (description
1371 "PyOTP is a Python library for generating and verifying one-time
1372passwords. It can be used to implement two-factor (2FA) or multi-factor
1373(MFA) authentication methods in web applications and in other systems that
1374require users to log in.")
1375 (license license:expat)))
1376
1377;; XXX: This project was archived by the owner on Apr 20, 2025. It is now
1378;; read-only. Consider to remove when starts failing to build and nothing
1379;; depends on it.
1380(define-public python-rsa
1381 (package
1382 (name "python-rsa")
1383 (version "4.9.1")
1384 (source
1385 (origin
1386 (method url-fetch)
1387 (uri (pypi-uri "rsa" version))
1388 (sha256
1389 (base32 "0xdfs3mhdb9wjpckj7i4zyv9sr82m7hk0mfkvw3lrnlpakdvzgg7"))))
1390 (build-system pyproject-build-system)
1391 (arguments
1392 (list #:tests? #f)) ;tests are not included in PyPI archive
1393 (native-inputs
1394 (list python-poetry-core))
1395 (propagated-inputs
1396 (list python-pyasn1))
1397 (home-page "https://stuvel.eu/rsa")
1398 (synopsis "Pure-Python RSA implementation")
1399 (description "Python-RSA is a pure-Python RSA implementation. It supports
1400encryption and decryption, signing and verifying signatures, and key
1401generation according to PKCS#1 version 1.5. It can be used as a Python
1402library as well as on the command line.")
1403 (license license:asl2.0)))
1404
1405(define-public python-rsa-for-awscli-1
1406 (hidden-package
1407 (package
1408 (inherit python-rsa)
1409 (version "3.4.2")
1410 (source
1411 (origin
1412 (method url-fetch)
1413 (uri (pypi-uri "rsa" version))
1414 (sha256
1415 (base32 "1dcxvszbikgzh99ybdc7jq0zb9wspy2ds8z9mjsqiyv3q884xpr5"))))
1416 (native-inputs
1417 (list python-setuptools)))))
1418
1419(define-public python-scrypt
1420 (package
1421 (name "python-scrypt")
1422 (version "0.9.4")
1423 (source
1424 (origin
1425 (method git-fetch)
1426 (uri (git-reference
1427 (url "https://github.com/holgern/py-scrypt")
1428 (commit (string-append "v" version))))
1429 (file-name (git-file-name name version))
1430 (sha256
1431 (base32 "07mr8slhplk0pfji3pfb86281wf035c3vxg7w4g17vgry1l5fdg2"))))
1432 (build-system pyproject-build-system)
1433 (native-inputs (list python-pytest python-setuptools python-wheel))
1434 (inputs (list openssl))
1435 (home-page "https://github.com/holgern/py-scrypt")
1436 (synopsis "Bindings for the scrypt key derivation function library")
1437 (description
1438 "This package is a set of Python bindings for the scrypt key derivation
1439function.")
1440 (license license:bsd-2)))
1441
1442(define-public python-service-identity
1443 (package
1444 (name "python-service-identity")
1445 (version "24.2.0")
1446 (source
1447 (origin
1448 (method url-fetch)
1449 (uri (pypi-uri "service_identity" version))
1450 (sha256
1451 (base32 "02cfpry5alap6mf3ffq1gdq6s7a2cmgjqpb2bp6wcf8d7yhkns5q"))))
1452 (build-system pyproject-build-system)
1453 (native-inputs
1454 (list python-hatch-fancy-pypi-readme
1455 python-hatch-vcs
1456 python-hatchling
1457 python-idna
1458 python-pytest))
1459 (propagated-inputs
1460 (list python-attrs
1461 python-cryptography
1462 python-pyasn1
1463 python-pyasn1-modules
1464 python-six))
1465 (home-page "https://service-identity.readthedocs.io/")
1466 (synopsis "Service identity verification for PyOpenSSL")
1467 (description
1468 "@code{service_identity} aspires to give you all the tools you need for
1469verifying whether a certificate is valid for the intended purposes. In the
1470simplest case, this means host name verification. However, service_identity
1471implements RFC 6125 fully and plans to add other relevant RFCs too.")
1472 (license license:expat)))
1473
1474(define-public python-google-crc32c
1475 (package
1476 (name "python-google-crc32c")
1477 (version "1.3.0")
1478 (source
1479 (origin
1480 (method git-fetch)
1481 (uri (git-reference
1482 (url "https://github.com/googleapis/python-crc32c")
1483 (commit (string-append "v" version))))
1484 (file-name (git-file-name name version))
1485 (sha256
1486 (base32 "005ra4pfv71rq53198k7q6k63f529q3g6hkbxbwfcf82jr77hxga"))))
1487 (build-system pyproject-build-system)
1488 (inputs (list crc32c))
1489 (native-inputs (list python-pytest python-setuptools python-wheel))
1490 (home-page "https://github.com/googleapis/python-crc32c")
1491 (synopsis "Python wrapper of Google CRC32C")
1492 (description
1493 "This package provides a Python wrapper of the C library implementation
1494of the CRC32C hashing algorithm.")
1495 (license license:asl2.0)))
1496
1497(define-public python-shamir-mnemonic
1498 (package
1499 (name "python-shamir-mnemonic")
1500 (version "0.3.0")
1501 (source
1502 (origin
1503 (method git-fetch)
1504 (uri (git-reference
1505 (url "https://github.com/trezor/python-shamir-mnemonic")
1506 (commit (string-append "v" version))))
1507 (file-name (git-file-name name version))
1508 (sha256
1509 (base32 "0nzg1l9hrjgrw8jnji8jjl6yy8wixxipcbdjhmh6x1vn1z25ndia"))))
1510 (build-system pyproject-build-system)
1511 (native-inputs
1512 (list python-bip32utils
1513 python-poetry-core
1514 python-pytest))
1515 (propagated-inputs
1516 (list python-click))
1517 (home-page "https://github.com/trezor/python-shamir-mnemonic")
1518 (synopsis "SLIP-39 Shamir Mnemonics")
1519 (description
1520 "This package provides a reference implementation of SLIP-0039: Shamir's
1521Secret-Sharing for Mnemonic Codes. This SLIP describes a standard and
1522interoperable implementation of Shamir's secret sharing (SSS). SSS splits a
1523secret into unique parts which can be distributed among participants, and
1524requires a specified minimum number of parts to be supplied in order to
1525reconstruct the original secret. Knowledge of fewer than the required number
1526of parts does not leak information about the secret.")
1527 (license license:expat)))
1528
1529(define-public python-slip10
1530 (package
1531 (name "python-slip10")
1532 (version "1.1.0")
1533 (source
1534 (origin
1535 (method git-fetch)
1536 (uri (git-reference
1537 (url "https://github.com/trezor/python-slip10")
1538 (commit (string-append "v" version))))
1539 (file-name (git-file-name name version))
1540 (sha256
1541 (base32 "0r1p7kxg1hcc3mcda8mrrhrnx6idzik7gw8c42q4359yp633vv83"))))
1542 (build-system pyproject-build-system)
1543 (native-inputs
1544 (list python-poetry-core
1545 python-pytest))
1546 (propagated-inputs
1547 (list python-cryptography))
1548 (home-page "https://github.com/trezor/python-slip10")
1549 (synopsis "Reference implementation of SLIP10 ")
1550 (description
1551 "This package provides a reference implementation of the SLIP-0010 (see:
1552https://github.com/satoshilabs/slips, slip-0010.md) specification,which
1553generalizes the BIP-0032 (see: https://github.com/bitcoin/bips/tree,
1554bip-0032.mediawiki) derivation scheme for private and public key pairs in
1555hierarchical deterministic wallets for the curves secp256k1, NIST P-256,
1556ed25519 and curve25519.")
1557 (license license:bsd-3)))
1558
1559(define-public python-spake2
1560 (package
1561 (name "python-spake2")
1562 (version "0.9")
1563 (source
1564 (origin
1565 (method url-fetch)
1566 (uri (pypi-uri "spake2" version))
1567 (sha256
1568 (base32 "0d4kbaxi4cv8klyqh6yb0p0qiwfdwvczy1h2mzvmlfdcsnlc87s2"))))
1569 (build-system pyproject-build-system)
1570 (native-inputs (list python-pytest python-setuptools))
1571 (propagated-inputs (list python-cryptography))
1572 (home-page "https://github.com/warner/python-spake2")
1573 (synopsis "SPAKE2 password-authenticated key exchange in Python")
1574 (description "This package provides a Python implementation of the SPAKE2
1575Password-Authenticated Key Exchange algorithm.")
1576 (license license:expat)))
1577
1578(define-public python-keyutils
1579 (package
1580 (name "python-keyutils")
1581 (version "0.6")
1582 (source
1583 (origin
1584 (method url-fetch)
1585 (uri (pypi-uri "keyutils" version))
1586 (sha256
1587 (base32 "0lipygpzhwzzsq2k5imb1jgkmj8y4khxdwhzadjs3bd56g6bmkx9"))))
1588 (build-system pyproject-build-system)
1589 (arguments
1590 (list
1591 #:tests? #f
1592 #:phases
1593 #~(modify-phases %standard-phases
1594 (add-before 'build 'regenerate-c-file
1595 (lambda _
1596 (invoke "cython" "keyutils/_keyutils.pyx"))))))
1597 (native-inputs
1598 (list python-cython python-pytest python-setuptools))
1599 (inputs
1600 (list keyutils))
1601 (home-page "https://github.com/sassoftware/python-keyutils")
1602 (synopsis "Python bindings for keyutils")
1603 (description
1604 "This is a set of python bindings for keyutils, a key management suite
1605that leverages the infrastructure provided by the Linux kernel for safely
1606storing and retrieving sensitive information in your programs.")
1607 (license license:asl2.0)))
1608
1609(define-public python-mcuboot-imgtool
1610 (package
1611 (name "python-mcuboot-imgtool")
1612 (version "1.4.0")
1613 (source
1614 (origin
1615 (method git-fetch)
1616 (uri (git-reference
1617 (url "https://github.com/mcu-tools/mcuboot")
1618 (commit (string-append "v" version))))
1619 (file-name (git-file-name name version))
1620 (sha256
1621 (base32 "1m1csyvzq4jx81zg635ssy1n7sc0z539z0myh872ll3nwqx7wa0q"))))
1622 (build-system pyproject-build-system)
1623 (arguments
1624 (list
1625 #:phases
1626 #~(modify-phases %standard-phases
1627 (add-after 'unpack 'fix-broken-test
1628 (lambda _
1629 (substitute* "scripts/imgtool/keys/ed25519_test.py"
1630 (("raw_sign")
1631 "sign_digest"))))
1632 (add-before 'build 'change-directory
1633 (lambda _
1634 (chdir "scripts"))))))
1635 (native-inputs (list python-pytest python-setuptools python-wheel))
1636 (propagated-inputs (list python-click python-intelhex python-cryptography))
1637 (home-page "https://mcuboot.com")
1638 (synopsis "Tool to securely sign firmware images for booting by MCUboot")
1639 (description
1640 "MCUboot is a secure bootloader for 32-bit MCUs. This package provides a
1641tool to securely sign firmware images for booting by MCUboot.")
1642 (license license:expat)))
1643
1644(define-public python-ntlm-auth
1645 (package
1646 (name "python-ntlm-auth")
1647 (version "1.5.0")
1648 (source
1649 (origin
1650 (method git-fetch)
1651 (uri (git-reference
1652 (url "https://github.com/jborean93/ntlm-auth")
1653 (commit (string-append "v" version))))
1654 (file-name (git-file-name name version))
1655 (sha256
1656 (base32 "00dpf5bfsy07frsjihv1k10zmwcyq4bvkilbxha7h6nlwpcm2409"))))
1657 (build-system pyproject-build-system)
1658 (native-inputs
1659 (list python-pytest python-requests python-setuptools python-wheel))
1660 (propagated-inputs (list python-cryptography))
1661 (home-page "https://github.com/jborean93/ntlm-auth")
1662 (synopsis "Calculates NTLM Authentication codes")
1663 (description
1664 "This library handles the low-level details of NTLM authentication for
1665use in authenticating with a service that uses NTLM. It will create and parse
1666the 3 different message types in the order required and produce a base64
1667encoded value that can be attached to the HTTP header.
1668
1669The goal of this library is to offer full NTLM support including signing and
1670sealing of messages as well as supporting MIC for message integrity and the
1671ability to customise and set limits on the messages sent. Please see Features
1672and Backlog for a list of what is and is not currently supported.")
1673 (license license:expat)))
1674
1675(define-public python-secretstorage
1676 (package
1677 (name "python-secretstorage")
1678 (version "3.3.3")
1679 (source
1680 (origin
1681 (method url-fetch)
1682 (uri (pypi-uri "SecretStorage" version))
1683 (sha256
1684 (base32 "0xxxxr77sgmjm1rqzdd1rkan9xg0qmv8awc1pb9adv39ycz560r4"))))
1685 (build-system pyproject-build-system)
1686 (arguments
1687 '(#:tests? #f)) ; Tests require a running dbus service.
1688 (native-inputs
1689 (list python-setuptools))
1690 (propagated-inputs
1691 (list python-cryptography python-jeepney))
1692 (home-page "https://github.com/mitya57/secretstorage")
1693 (synopsis "Python bindings to FreeDesktop.org Secret Service API")
1694 (description
1695 "@code{python-secretstorage} provides a way for securely storing passwords
1696and other secrets. It uses D-Bus Secret Service API that is supported by GNOME
1697Keyring (since version 2.30) and KSecretsService. SecretStorage supports most
1698of the functions provided by Secret Service, including creating and deleting
1699items and collections, editing items, locking and unlocking collections
1700(asynchronous unlocking is also supported).")
1701 (license license:bsd-3)))
1702
1703(define-public python-trustme
1704 (package
1705 (name "python-trustme")
1706 (version "1.2.1")
1707 (source
1708 (origin
1709 (method url-fetch)
1710 (uri (pypi-uri "trustme" version))
1711 (sha256
1712 (base32 "0zz49agi7hy82fbr03xs6k9vjgiy7v8qsp426cgv8bbzphmvla35"))))
1713 (build-system pyproject-build-system)
1714 (native-inputs
1715 (list python-hatchling
1716 python-pyopenssl
1717 python-pytest
1718 python-service-identity))
1719 (propagated-inputs
1720 (list python-cryptography
1721 python-idna))
1722 (home-page "https://trustme.readthedocs.io")
1723 (synopsis "Fake a certificate authority for tests")
1724 (description
1725 "@code{trustme} is a tiny Python package that does one thing: it gives you
1726a fake certificate authority (CA) that you can use to generate fake TLS certs to
1727use in your tests.")
1728 ;; Either license applies.
1729 (license (list license:expat license:asl2.0))))
1730
1731(define-public python-certipy
1732 (package
1733 (name "python-certipy")
1734 (version "0.2.2")
1735 (source
1736 (origin
1737 (method url-fetch)
1738 (uri (pypi-uri "certipy" version))
1739 (sha256
1740 (base32 "0pm0kf079ws9s93vpkxnw3gj6a1hi34p34bicx69rqlyh7cg7wgy"))))
1741 (build-system pyproject-build-system)
1742 (propagated-inputs (list python-cryptography))
1743 (native-inputs (list python-pypa-build
1744 python-flask
1745 python-pytest
1746 python-setuptools
1747 python-wheel))
1748 (home-page "https://github.com/LLNL/certipy")
1749 (synopsis "Utility to create and sign CAs and certificates")
1750 (description
1751 "Certipy was made to simplify the certificate creation process. To that
1752end, certipy exposes methods for creating and managing certificate authorities,
1753certificates, signing and building trust bundles.")
1754 (license license:bsd-3)))
1755
1756(define-public python-jeepney
1757 (package
1758 (name "python-jeepney")
1759 (version "0.8.0")
1760 (source
1761 (origin
1762 (method url-fetch)
1763 (uri (pypi-uri "jeepney" version))
1764 (sha256
1765 (base32 "01jqrk7pn94i7bpmj834pjrw7id659gfag6wpbv04fcpap94izjy"))))
1766 (build-system pyproject-build-system)
1767 (native-inputs
1768 (list python-async-timeout
1769 python-testpath
1770 python-trio
1771 python-pytest
1772 python-pytest-asyncio
1773 python-pytest-trio
1774 ;; For the build backend
1775 python-flit-core))
1776 (home-page "https://gitlab.com/takluyver/jeepney")
1777 (synopsis "Low-level, pure Python DBus protocol wrapper")
1778 (description
1779 "This is a low-level, pure Python DBus protocol client. It has an
1780I/O-free core, and integration modules for different event loops.")
1781 (license license:expat)))
1782
1783(define-public python-argon2-cffi
1784 (package
1785 (name "python-argon2-cffi")
1786 (version "25.1.0")
1787 (source
1788 (origin
1789 (method url-fetch)
1790 (uri (pypi-uri "argon2_cffi" version))
1791 (sha256
1792 (base32 "1ha62fg9blw38q3qayjid8608fp2a57fd81cpzic9x22ib6fajk9"))))
1793 (build-system pyproject-build-system)
1794 (native-inputs
1795 (list python-hatch-fancy-pypi-readme
1796 python-hatch-vcs
1797 python-hatchling
1798 python-pytest))
1799 (propagated-inputs
1800 (list python-argon2-cffi-bindings))
1801 (home-page "https://argon2-cffi.readthedocs.io/")
1802 (synopsis "Secure Password Hashes for Python")
1803 (description
1804 "Argon2 is a secure password hashing algorithm. It is designed to have
1805both a configurable runtime as well as memory consumption. This means that you
1806can decide how long it takes to hash a password and how much memory is required.")
1807 (license license:expat)))
1808
1809(define-public python-argon2-cffi-bindings
1810 (package
1811 (name "python-argon2-cffi-bindings")
1812 (version "25.1.0")
1813 (source
1814 (origin
1815 (method url-fetch)
1816 (uri (pypi-uri "argon2_cffi_bindings" version))
1817 (sha256
1818 (base32 "179256zsrh5c51zmv9k1sc9p102j152nzxqgwhhdhmadxbkg6mxr"))))
1819 (build-system pyproject-build-system)
1820 (arguments
1821 (list
1822 #:phases
1823 #~(modify-phases %standard-phases
1824 (add-before 'build 'use-system-argon2
1825 (lambda _
1826 (setenv "ARGON2_CFFI_USE_SYSTEM" "1"))))))
1827 (native-inputs
1828 (list python-pytest
1829 python-setuptools
1830 python-setuptools-scm))
1831 (inputs
1832 (list argon2))
1833 (propagated-inputs
1834 (list python-cffi))
1835 (home-page "https://github.com/hynek/argon2-cffi-bindings")
1836 (synopsis "Low-level CFFI bindings for Argon2")
1837 (description
1838 "argon2-cffi-bindings provides low-level CFFI bindings to the official
1839implementation of the Argon2 password hashing algorithm.")
1840 (license license:expat)))
1841
1842(define-public python-privy
1843 (package
1844 (name "python-privy")
1845 (version "6.0.0")
1846 (source
1847 (origin
1848 (method git-fetch)
1849 (uri (git-reference
1850 ;; Releases are untagged
1851 (url "https://github.com/ofek/privy")
1852 (commit "2838db3df239797c71bddacc48a4c49a83f35747")))
1853 (file-name (git-file-name name version))
1854 (sha256
1855 (base32 "1m32dh5fqc8cy7jyf1z5fs6zvmdkbq5fi98hr609gbl7s0l0y0i9"))))
1856 (build-system pyproject-build-system)
1857 (native-inputs (list python-pytest python-setuptools))
1858 (propagated-inputs (list python-argon2-cffi python-cryptography))
1859 (home-page "https://www.dropbox.com/developers")
1860 (synopsis "Library to password-protect your data")
1861 (description
1862 "Privy is a small and fast utility for password-protecting secret
1863data such as API keys, cryptocurrency wallets, or seeds for digital
1864signatures.")
1865 (license (list license:expat license:asl2.0)))) ; dual licensed
1866
1867(define-public python-pgpy
1868 (package
1869 (name "python-pgpy")
1870 (version "0.6.0")
1871 (source
1872 (origin
1873 (method url-fetch)
1874 (uri (pypi-uri "PGPy" version))
1875 (sha256
1876 (base32 "10w3h934fi1ijx72ppn67a50yhkf8n1db6xx02gk2fjc7wsjx717"))))
1877 (build-system pyproject-build-system)
1878 (arguments
1879 (list #:test-flags
1880 ;; All broken tests are in this file.
1881 ;; They fail with ValueError: key_size must be at least 1024-bits.
1882 #~(list "--ignore" "tests/test_10_exceptions.py")))
1883 (native-inputs
1884 (list python-pytest python-setuptools python-wheel))
1885 (propagated-inputs (list python-cryptography python-pyasn1))
1886 (home-page "https://github.com/SecurityInnovation/PGPy")
1887 (synopsis "Python implementation of OpenPGP")
1888 (description
1889 "Currently, PGPy can load keys and signatures of all kinds in both ASCII
1890armored and binary formats.
1891
1892It can create and verify RSA, DSA, and ECDSA signatures, at the moment. It
1893can also encrypt and decrypt messages using RSA and ECDH.")
1894 (license license:bsd-3)))
1895
1896(define-public python-pyu2f
1897 (package
1898 (name "python-pyu2f")
1899 ;; Released version fails tests in Python 3.12.
1900 ;; pyu2f is no longer being developed.
1901 (properties '((commit . "064be5ab9f4282855a15c79ecb9f7eec37f3938c")
1902 (revision . "0")))
1903 (version (git-version "0.1.5"
1904 (assoc-ref properties 'revision)
1905 (assoc-ref properties 'commit)))
1906 (source
1907 (origin
1908 (method git-fetch)
1909 (uri (git-reference
1910 (url "https://github.com/google/pyu2f/")
1911 (commit (assoc-ref properties 'commit))))
1912 (file-name (git-file-name name version))
1913 (sha256
1914 (base32 "1373q4vzn449p8vsclhrsa5jb3vx9x77g2hdvibim5qwa1d724b9"))))
1915 (build-system pyproject-build-system)
1916 (arguments
1917 (list
1918 ;; This test requires the fakefs package.
1919 #:test-flags #~(list "--ignore=pyu2f/tests/hid/linux_test.py")))
1920 (native-inputs (list python-mock python-pytest python-setuptools))
1921 (propagated-inputs (list python-six))
1922 (home-page "https://github.com/google/pyu2f/")
1923 (synopsis "U2F host library for interacting with a U2F device over USB")
1924 (description
1925 "Pyu2f is a Python-based U2F host library. It provides functionality for
1926interacting with a U2F device over USB.")
1927 (license license:asl2.0)))
1928
1929(define-public python-sop
1930 (package
1931 (name "python-sop")
1932 (version "0.5.1")
1933 (source
1934 (origin
1935 (method git-fetch)
1936 (uri (git-reference
1937 (url "https://gitlab.com/dkg/python-sop")
1938 (commit (string-append "sop-" version))))
1939 (file-name (git-file-name name version))
1940 (sha256
1941 (base32 "0sin5miiiqgww0s52jz098x44nbnx003vfd4jn55bs5mgca60lll"))))
1942 (build-system pyproject-build-system)
1943 (arguments
1944 (list #:tests? #f)) ; XXX: No tests upstream.
1945 (native-inputs (list python-setuptools python-wheel))
1946 (home-page "https://gitlab.com/dkg/python-sop")
1947 (synopsis "Stateless OpenPGP Command-Line Interface")
1948 (description
1949 "The Stateless OpenPGP Command-Line Interface (or sop) is a
1950specification that encourages OpenPGP implementers to provide a common,
1951relatively simple command-line API for purposes of object security.
1952
1953This Python module helps implementers build such a CLI from any implementation
1954accessible to the Python interpreter.
1955
1956It does not provide such an implementation itself -- this is just the
1957scaffolding for the command line, which should make it relatively easy to
1958supply a handful of python functions as methods to a class.")
1959 (license license:expat))) ; MIT license
1960
1961(define-public python-starkbank-ecdsa
1962 (package
1963 (name "python-starkbank-ecdsa")
1964 (version "2.2.0")
1965 (home-page "https://github.com/starkbank/ecdsa-python")
1966 (source
1967 (origin
1968 (method git-fetch)
1969 (uri (git-reference
1970 (url home-page)
1971 (commit (string-append "v" version))))
1972 (file-name (git-file-name name version))
1973 (sha256
1974 (base32 "01zy16csrbyfhjl0kay9rbpbwc3dpr7kh2qkrbdy5a1n644fbahx"))))
1975 (arguments
1976 (list
1977 #:test-backend #~'unittest
1978 #:phases
1979 #~(modify-phases %standard-phases
1980 (add-after 'unpack 'remove-broken-test
1981 (lambda _
1982 (delete-file "tests/testOpenSSL.py"))))))
1983 (build-system pyproject-build-system)
1984 (native-inputs (list python-setuptools))
1985 (synopsis "Python ECDSA library")
1986 (description "This package provides a Python ECDSA library, optimized for
1987speed but without C extensions.")
1988 (license license:expat)))
1989
1990(define-public python-zxcvbn
1991 (package
1992 (name "python-zxcvbn")
1993 (version "4.5.0")
1994 (source
1995 (origin
1996 (method git-fetch) ;for tests
1997 (uri (git-reference
1998 (url "https://github.com/dwolfhub/zxcvbn-python")
1999 (commit (string-append "v" version))))
2000 (file-name (git-file-name name version))
2001 (sha256
2002 (base32 "0x39yi4zc1n6mjjk3rx32ick0hysyi9hv9ln69apcch4jf84j9fi"))))
2003 (build-system pyproject-build-system)
2004 (native-inputs (list python-pytest python-setuptools python-wheel))
2005 (home-page "https://github.com/dwolfhub/zxcvbn-python")
2006 (synopsis "Realistic password strength estimator Python library")
2007 (description
2008 "This is a Python implementation of the @code{zxcvbn} library created at
2009Dropbox. The original library, written for JavaScript, can be found
2010@url{https://github.com/dropbox/zxcvbn, here}. This port includes features
2011such as:
2012@enumerate
2013@item Accepts user data to be added to the dictionaries that are tested
2014against (name, birthdate, etc.)
2015@item Gives a score to the password, from 0 (terrible) to 4 (great).
2016@item Provides feedback on the password and ways to improve it.
2017@item Returns time estimates on how long it would take to guess the password
2018in different situations.
2019@end enumerate")
2020 (license license:expat)))
2021
2022(define-public python-zxcvbn-rs-py
2023 (package
2024 (name "python-zxcvbn-rs-py")
2025 (version "0.3.0")
2026 (source
2027 (origin
2028 (method git-fetch)
2029 (uri (git-reference
2030 (url "https://github.com/fief-dev/zxcvbn-rs-py")
2031 (commit (string-append "v" version))))
2032 (file-name (git-file-name name version))
2033 (sha256
2034 (base32 "0pmc68x6ycsz4g7sr48nb7cv6v46rljc3wb1vc531lyc6hsh80qm"))))
2035 (build-system pyproject-build-system)
2036 (arguments
2037 (list
2038 #:imported-modules `(,@%cargo-build-system-modules
2039 ,@%pyproject-build-system-modules)
2040 #:modules '(((guix build cargo-build-system) #:prefix cargo:)
2041 (guix build pyproject-build-system)
2042 (guix build utils))
2043 #:phases
2044 #~(modify-phases %standard-phases
2045 (add-after 'unpack 'prepare-cargo-build-system
2046 (lambda args
2047 (for-each
2048 (lambda (phase)
2049 (format #t "Running cargo phase: ~a~%" phase)
2050 (apply (assoc-ref cargo:%standard-phases phase)
2051 #:cargo-target #$(cargo-triplet)
2052 args))
2053 '(unpack-rust-crates
2054 configure
2055 check-for-pregenerated-files
2056 patch-cargo-checksums))))
2057 (add-before 'check 'prepare-for-tests
2058 (lambda _
2059 (delete-file-recursively "zxcvbn_rs_py"))))))
2060 (native-inputs
2061 (list rust
2062 `(,rust "cargo")
2063 maturin
2064 python-pytest
2065 python-wheel))
2066 (inputs
2067 (cargo-inputs 'python-zxcvbn-rs-py))
2068 (home-page "https://github.com/fief-dev/zxcvbn-rs-py")
2069 (synopsis
2070 "Python bindings for zxcvbn-rs, a password strength estimation library")
2071 (description
2072 "This package provides a library to estimate password strength. It is
2073implemented by python bindings for zxcvbn-rs and aims to be faster than
2074@code{python-zxcvbn} thanks to its Rust core.")
2075 (license license:expat)))
2076
2077;; XXX: Not maintained since 2016.
2078(define-public python-pydes
2079 (package
2080 (name "python-pydes")
2081 (version "2.0.1")
2082 (source
2083 (origin
2084 (method url-fetch)
2085 (uri (pypi-uri "pyDes" version))
2086 (sha256
2087 (base32 "04lh71f47y04vspfrdrq6a0hn060ibxvdp5z1pcr0gmqs8hqxaz2"))))
2088 (build-system pyproject-build-system)
2089 (arguments
2090 (list #:tests? #f)) ;no tests in PyPI, I could not fine Git
2091 (native-inputs (list python-setuptools))
2092 (home-page "http://twhiteman.netfirms.com/des.html") ;XXX: Dead link
2093 (synopsis
2094 "Pure python implementation of the DES and TRIPLE DES encryption algorithms")
2095 (description
2096 "This package provides a pure Python implementation of the DES and
2097TRIPLE DES encryption algorithms.")
2098 (license license:public-domain)))