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