Commit | Line | Data |
---|---|---|
cc6f4912 LC |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr> | |
3 | ;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il> | |
4 | ;;; Copyright © 2015, 2016, 2017 Leo Famulari <leo@famulari.name> | |
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> | |
11 | ;;; Copyright © 2016, 2017 Tobias Geerinckx-Rice <me@tobias.gr> | |
12 | ;;; Copyright © 2016, 2017 ng0 <ng0@infotropique.org> | |
13 | ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> | |
14 | ;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net> | |
15 | ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org> | |
16 | ;;; Copyright © 2016, 2017 Arun Isaac <arunisaac@systemreboot.net> | |
17 | ;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au> | |
18 | ;;; | |
19 | ;;; This file is part of GNU Guix. | |
20 | ;;; | |
21 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
22 | ;;; under the terms of the GNU General Public License as published by | |
23 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
24 | ;;; your option) any later version. | |
25 | ;;; | |
26 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
27 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
28 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
29 | ;;; GNU General Public License for more details. | |
30 | ;;; | |
31 | ;;; You should have received a copy of the GNU General Public License | |
32 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
33 | ||
34 | (define-module (gnu packages python-crypto) | |
35 | #:use-module (guix packages) | |
36 | #:use-module (guix download) | |
37 | #:use-module (guix git-download) | |
38 | #:use-module (guix build-system python) | |
39 | #:use-module (gnu packages) | |
ac257f12 | 40 | #:use-module (gnu packages check) |
b95c17c5 | 41 | #:use-module (gnu packages crypto) |
cc6f4912 LC |
42 | #:use-module (gnu packages libffi) |
43 | #:use-module (gnu packages multiprecision) | |
44 | #:use-module (gnu packages protobuf) | |
45 | #:use-module (gnu packages python) | |
33dc54b0 | 46 | #:use-module (gnu packages time) |
cc6f4912 LC |
47 | #:use-module (gnu packages tls) |
48 | #:use-module ((guix licenses) #:prefix license:) | |
49 | #:use-module (srfi srfi-1)) | |
50 | ||
51 | (define-public python-passlib | |
52 | (package | |
53 | (name "python-passlib") | |
54 | (version "1.7.1") | |
55 | (source | |
56 | (origin | |
57 | (method url-fetch) | |
58 | (uri (pypi-uri "passlib" version)) | |
59 | (sha256 | |
60 | (base32 | |
61 | "1q2khqpj9rlcgdmkypjdq1kswvhjf72bq0zk2cv669cc2dj8z51x")))) | |
62 | (build-system python-build-system) | |
63 | (native-inputs | |
64 | `(("python-nose" ,python-nose))) | |
65 | (propagated-inputs | |
66 | `(("python-py-bcrypt" ,python-py-bcrypt))) | |
67 | (arguments | |
68 | `(#:phases | |
69 | (modify-phases %standard-phases | |
70 | (add-before 'check 'set-PYTHON_EGG_CACHE | |
71 | ;; some tests require access to "$HOME/.cython" | |
72 | (lambda* _ (setenv "PYTHON_EGG_CACHE" "/tmp") #t))))) | |
73 | (home-page "https://bitbucket.org/ecollins/passlib") | |
74 | (synopsis | |
75 | "Comprehensive password hashing framework") | |
76 | (description | |
77 | "Passlib is a password hashing library for Python 2 & 3, which provides | |
78 | cross-platform implementations of over 30 password hashing algorithms, as well | |
79 | as a framework for managing existing password hashes. It's designed to be | |
80 | useful for a wide range of tasks, from verifying a hash found in /etc/shadow, | |
81 | to providing full-strength password hashing for multi-user application.") | |
82 | (license license:bsd-3))) | |
83 | ||
84 | (define-public python2-passlib | |
85 | (package-with-python2 python-passlib)) | |
86 | ||
87 | (define-public python-py-bcrypt | |
88 | (package | |
89 | (name "python-py-bcrypt") | |
90 | (version "0.4") | |
91 | (source | |
92 | (origin | |
93 | (method url-fetch) | |
94 | (uri (string-append | |
95 | "https://pypi.python.org/packages/source/p/py-bcrypt/py-bcrypt-" | |
96 | version | |
97 | ".tar.gz")) | |
98 | (sha256 | |
99 | (base32 | |
100 | "0y6smdggwi5s72v6p1nn53dg6w05hna3d264cq6kas0lap73p8az")))) | |
101 | (build-system python-build-system) | |
102 | (home-page "https://code.google.com/p/py-bcrypt") | |
103 | (synopsis | |
104 | "Bcrypt password hashing and key derivation") | |
105 | (description | |
106 | "A python wrapper of OpenBSD's Blowfish password hashing code. This | |
107 | system hashes passwords using a version of Bruce Schneier's Blowfish block | |
108 | cipher with modifications designed to raise the cost of off-line password | |
109 | cracking and frustrate fast hardware implementation. The computation cost of | |
110 | the algorithm is parametised, so it can be increased as computers get faster. | |
111 | The intent is to make a compromise of a password database less likely to | |
112 | result in an attacker gaining knowledge of the plaintext passwords (e.g. using | |
113 | John the Ripper).") | |
114 | ;; "sha2.c" is under BSD-3; | |
115 | ;; "blowfish.c" and "bcrypt.c" are under BSD-4; | |
116 | ;; the rest is under ISC. | |
117 | (license (list license:isc license:bsd-3 license:bsd-4)))) | |
118 | ||
119 | (define-public python2-py-bcrypt | |
120 | (package-with-python2 python-py-bcrypt)) | |
121 | ||
122 | (define-public python-paramiko | |
123 | (package | |
124 | (name "python-paramiko") | |
125 | (version "2.1.2") | |
126 | (source | |
127 | (origin | |
128 | (method url-fetch) | |
129 | (uri (pypi-uri "paramiko" version)) | |
130 | (sha256 | |
131 | (base32 | |
132 | "04734n0wy3hxk6rij4fr29in5jmr70nxpc7pqi2ksbjysfz4kbjz")))) | |
133 | (build-system python-build-system) | |
134 | (arguments | |
135 | '(#:phases | |
136 | (modify-phases %standard-phases | |
137 | (replace 'check | |
138 | (lambda _ | |
139 | (zero? (system* "python" "test.py"))))))) | |
140 | (propagated-inputs | |
141 | `(("python-pyasn1" ,python-pyasn1) | |
142 | ("python-cryptography" ,python-cryptography))) | |
143 | (home-page "http://www.paramiko.org/") | |
144 | (synopsis "SSHv2 protocol library") | |
145 | (description "Paramiko is a python implementation of the SSHv2 protocol, | |
146 | providing both client and server functionality. While it leverages a Python C | |
147 | extension for low level cryptography (PyCrypto), Paramiko itself is a pure | |
148 | Python interface around SSH networking concepts.") | |
149 | (license license:lgpl2.1+))) | |
150 | ||
151 | (define-public python2-paramiko | |
152 | (package-with-python2 python-paramiko)) | |
153 | ||
154 | (define-public python-ecdsa | |
155 | (package | |
156 | (name "python-ecdsa") | |
157 | (version "0.13") | |
158 | (source | |
159 | (origin | |
160 | (method url-fetch) | |
161 | (uri (string-append | |
162 | "https://pypi.python.org/packages/source/e/ecdsa/ecdsa-" | |
163 | version | |
164 | ".tar.gz")) | |
165 | (sha256 | |
166 | (base32 | |
167 | "1yj31j0asmrx4an9xvsaj2icdmzy6pw0glfpqrrkrphwdpi1xkv4")))) | |
168 | (build-system python-build-system) | |
169 | (inputs | |
170 | `(("openssl" ,openssl))) | |
171 | (home-page | |
172 | "https://github.com/warner/python-ecdsa") | |
173 | (synopsis | |
174 | "ECDSA cryptographic signature library (pure python)") | |
175 | (description | |
176 | "This is an easy-to-use implementation of ECDSA cryptography (Elliptic | |
177 | Curve Digital Signature Algorithm), implemented purely in Python. With this | |
178 | library, you can quickly create keypairs (signing key and verifying key), sign | |
179 | messages, and verify the signatures. The keys and signatures are very short, | |
180 | making them easy to handle and incorporate into other protocols.") | |
181 | (license license:expat))) | |
182 | ||
183 | (define-public python2-ecdsa | |
184 | (package-with-python2 python-ecdsa)) | |
185 | ||
186 | ;;; Pycrypto is abandoned upstream: | |
187 | ;;; | |
188 | ;;; https://github.com/dlitz/pycrypto/issues/173 | |
189 | ;;; | |
190 | ;;; TODO Remove this package from GNU Guix. | |
191 | (define-public python-pycrypto | |
192 | (package | |
193 | (name "python-pycrypto") | |
194 | (version "2.6.1") | |
195 | (source | |
196 | (origin | |
197 | (method url-fetch) | |
198 | (uri (pypi-uri "pycrypto" version)) | |
199 | (patches (search-patches "python-pycrypto-CVE-2013-7459.patch")) | |
200 | (sha256 | |
201 | (base32 | |
202 | "0g0ayql5b9mkjam8hym6zyg6bv77lbh66rv1fyvgqb17kfc1xkpj")))) | |
203 | (build-system python-build-system) | |
204 | (inputs | |
205 | `(("python" ,python) | |
206 | ("gmp" ,gmp))) | |
207 | (arguments | |
208 | `(#:phases | |
209 | (modify-phases %standard-phases | |
210 | (add-before 'build 'set-build-env | |
211 | ;; pycrypto runs an autoconf configure script behind the scenes | |
212 | (lambda _ (setenv "CONFIG_SHELL" (which "bash")) #t))))) | |
213 | (home-page "http://www.pycrypto.org/") | |
214 | (synopsis "Cryptographic modules for Python") | |
215 | (description | |
216 | "Pycrypto is a collection of both secure hash functions (such as SHA256 | |
217 | and RIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal, | |
218 | etc.). The package is structured to make adding new modules easy.") | |
219 | (license license:public-domain))) | |
220 | ||
221 | (define-public python2-pycrypto | |
222 | (let ((pycrypto (package-with-python2 python-pycrypto))) | |
223 | (package (inherit pycrypto) | |
224 | (inputs | |
225 | `(("python" ,python-2) | |
226 | ,@(alist-delete | |
227 | "python" | |
228 | (package-inputs pycrypto))))))) | |
229 | ||
230 | (define-public python-keyring | |
231 | (package | |
232 | (name "python-keyring") | |
233 | (version "8.7") | |
234 | (source | |
235 | (origin | |
236 | (method url-fetch) | |
237 | (uri (pypi-uri "keyring" version)) | |
238 | (sha256 | |
239 | (base32 | |
240 | "0482rmi2x6p78wl2kz8qzyq21xz1sbbfwnv5x7dggar4vkwxhzfx")))) | |
241 | (build-system python-build-system) | |
242 | (native-inputs | |
243 | `(("python-setuptools-scm" ,python-setuptools-scm))) | |
244 | (propagated-inputs | |
245 | `(("python-pycrypto" ,python-pycrypto))) | |
246 | (arguments | |
247 | `(#:tests? #f)) ;TODO: tests require pytest | |
248 | (home-page "https://github.com/jaraco/keyring") | |
249 | (synopsis "Store and access your passwords safely") | |
250 | (description | |
251 | "The Python keyring lib provides a easy way to access the system keyring | |
252 | service from python. It can be used in any application that needs safe | |
253 | password storage.") | |
254 | ;; "MIT" and PSF dual license | |
255 | (license license:x11))) | |
256 | ||
257 | (define-public python2-keyring | |
258 | (package-with-python2 python-keyring)) | |
259 | ||
260 | (define-public python-certifi | |
261 | (package | |
262 | (name "python-certifi") | |
263 | (version "2017.1.23") | |
264 | (source (origin | |
265 | (method url-fetch) | |
266 | (uri (pypi-uri "certifi" version)) | |
267 | (sha256 | |
268 | (base32 | |
269 | "1klrzl3hgvcf2mjk00g0k3kk1p2z27vzwnxivwar4vhjmjvpz1w1")))) | |
270 | (build-system python-build-system) | |
271 | (home-page "https://certifi.io/") | |
272 | (synopsis "Python CA certificate bundle") | |
273 | (description | |
274 | "Certifi is a Python library that contains a CA certificate bundle, which | |
275 | is used by the Requests library to verify HTTPS requests.") | |
276 | (license license:asl2.0))) | |
277 | ||
278 | (define-public python2-certifi | |
279 | (package-with-python2 python-certifi)) | |
280 | ||
281 | (define-public python-cryptography-vectors | |
282 | (package | |
283 | (name "python-cryptography-vectors") | |
284 | (version "2.0.3") | |
285 | (source | |
286 | (origin | |
287 | (method url-fetch) | |
288 | (uri (pypi-uri "cryptography_vectors" version)) | |
289 | (sha256 | |
290 | (base32 | |
291 | "1qa117fs1yd50zn2cfxh7d9l999ds0z4h83m9m7j4fk6ffm33f5y")))) | |
292 | (build-system python-build-system) | |
293 | (home-page "https://github.com/pyca/cryptography") | |
294 | (synopsis "Test vectors for the cryptography package") | |
295 | (description | |
296 | "This package contains test vectors for the cryptography package.") | |
297 | ;; Distributed under either BSD-3 or ASL2.0 | |
298 | (license (list license:bsd-3 license:asl2.0)))) | |
299 | ||
300 | (define-public python2-cryptography-vectors | |
301 | (package-with-python2 python-cryptography-vectors)) | |
302 | ||
303 | (define-public python-cryptography | |
304 | (package | |
305 | (name "python-cryptography") | |
306 | (version "2.0.3") | |
307 | (source | |
308 | (origin | |
309 | (method url-fetch) | |
310 | (uri (pypi-uri "cryptography" version)) | |
311 | (sha256 | |
312 | (base32 | |
313 | "0fnck37zyvbzmccbp7w3jy27jgmij1992j5wyy3gxhw6a11b4jyh")))) | |
314 | (build-system python-build-system) | |
315 | (inputs | |
316 | `(("openssl" ,openssl))) | |
317 | (propagated-inputs | |
318 | `(("python-asn1crypto" ,python-asn1crypto) | |
319 | ("python-cffi" ,python-cffi) | |
320 | ("python-six" ,python-six) | |
321 | ("python-idna" ,python-idna) | |
322 | ("python-iso8601" ,python-iso8601))) | |
323 | (native-inputs | |
324 | `(("python-cryptography-vectors" ,python-cryptography-vectors) | |
325 | ("python-hypothesis" ,python-hypothesis) | |
326 | ("python-pretend" ,python-pretend) | |
327 | ("python-pytz" ,python-pytz) | |
328 | ("python-pytest" ,python-pytest-3.0))) | |
329 | (home-page "https://github.com/pyca/cryptography") | |
330 | (synopsis "Cryptographic recipes and primitives for Python") | |
331 | (description | |
332 | "cryptography is a package which provides cryptographic recipes and | |
333 | primitives to Python developers. It aims to be the “cryptographic standard | |
334 | library” for Python. The package includes both high level recipes, and low | |
335 | level interfaces to common cryptographic algorithms such as symmetric ciphers, | |
336 | message digests and key derivation functions.") | |
337 | ;; Distributed under either BSD-3 or ASL2.0 | |
338 | (license (list license:bsd-3 license:asl2.0)) | |
339 | (properties `((python2-variant . ,(delay python2-cryptography)))))) | |
340 | ||
341 | (define-public python2-cryptography | |
342 | (let ((crypto (package-with-python2 | |
343 | (strip-python2-variant python-cryptography)))) | |
344 | (package (inherit crypto) | |
345 | (propagated-inputs | |
346 | `(("python2-ipaddress" ,python2-ipaddress) | |
347 | ("python2-backport-ssl-match-hostname" | |
348 | ,python2-backport-ssl-match-hostname) | |
349 | ("python2-enum34" ,python2-enum34) | |
350 | ,@(package-propagated-inputs crypto)))))) | |
351 | ||
352 | (define-public python-pyopenssl | |
353 | (package | |
354 | (name "python-pyopenssl") | |
355 | (version "17.3.0") | |
356 | (source | |
357 | (origin | |
358 | (method url-fetch) | |
359 | (uri (pypi-uri "pyOpenSSL" version)) | |
360 | (sha256 | |
361 | (base32 | |
362 | "0xkc1wfnpg6abzllivg3ylhc63npjdy1v81f4kc08bm8cj80nqr9")))) | |
363 | (build-system python-build-system) | |
364 | (arguments | |
365 | '(#:phases | |
366 | (modify-phases %standard-phases | |
367 | (delete 'check) | |
368 | (add-after 'install 'check | |
369 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
370 | (add-installed-pythonpath inputs outputs) | |
371 | (zero? (system* "py.test" "-v" "-k" | |
372 | (string-append | |
373 | ;; This test tries to look up certificates from | |
374 | ;; the compiled-in default path in OpenSSL, which | |
375 | ;; does not exist in the build environment. | |
376 | "not test_fallback_default_verify_paths " | |
377 | ;; This test attempts to make a connection to | |
378 | ;; an external web service. | |
379 | "and not test_set_default_verify_paths")))))))) | |
380 | (propagated-inputs | |
381 | `(("python-cryptography" ,python-cryptography) | |
382 | ("python-six" ,python-six))) | |
383 | (inputs | |
384 | `(("openssl" ,openssl))) | |
385 | (native-inputs | |
386 | `(("python-flaky" ,python-flaky) | |
387 | ("python-pretend" ,python-pretend) | |
388 | ("python-pytest" ,python-pytest-3.0))) | |
389 | (home-page "https://github.com/pyca/pyopenssl") | |
390 | (synopsis "Python wrapper module around the OpenSSL library") | |
391 | (description | |
392 | "PyOpenSSL is a high-level wrapper around a subset of the OpenSSL | |
393 | library.") | |
394 | (license license:asl2.0))) | |
395 | ||
396 | (define-public python2-pyopenssl | |
397 | (package-with-python2 python-pyopenssl)) | |
398 | ||
579b4362 DM |
399 | (define-public python-ed25519 |
400 | (package | |
401 | (name "python-ed25519") | |
402 | (version "1.4") | |
403 | (source | |
404 | (origin | |
405 | (method url-fetch) | |
406 | (uri (pypi-uri "ed25519" version)) | |
407 | (sha256 | |
408 | (base32 | |
409 | "0ahx1nkxa0xis3cw0h5c4fpgv8mq4znkq7kajly33lc3317bk499")))) | |
410 | (build-system python-build-system) | |
411 | (home-page "https://github.com/warner/python-ed25519") | |
412 | (synopsis "Ed25519 public-key signatures") | |
413 | (description "Ed25519 public-key signatures") | |
414 | (license license:expat))) | |
415 | ||
416 | (define-public python2-ed25519 | |
417 | (package-with-python2 python-ed25519)) | |
418 | ||
cc6f4912 LC |
419 | (define-public python-axolotl-curve25519 |
420 | (package | |
421 | (name "python-axolotl-curve25519") | |
422 | (version "0.1") | |
423 | (source | |
424 | (origin | |
425 | (method git-fetch) | |
426 | (uri (git-reference | |
427 | (url "https://github.com/tgalal/python-axolotl-curve25519") | |
428 | (commit "e4a9c4de0eae27223200579c58d1f8f6d20637e2"))) | |
429 | (file-name (string-append name "-" version "-checkout")) | |
430 | (sha256 | |
431 | (base32 | |
432 | "0agap5q0hmvf6cwzjqc05kw53pjgf6942pcivpazksmg1vk400ra")))) | |
433 | (build-system python-build-system) | |
434 | (arguments | |
435 | `(;; Prevent creation of the egg. This works around | |
436 | ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20765 | |
437 | #:configure-flags '("--root=/"))) | |
438 | (home-page "https://github.com/tgalal/python-axolotl-curve25519") | |
439 | (synopsis "Python wrapper for curve25519 library") | |
440 | (description "This is a python wrapper for the curve25519 library | |
441 | with ed25519 signatures. The C code was pulled from | |
442 | libaxolotl-android. At the moment this wrapper is meant for use by | |
443 | python-axolotl.") | |
444 | (license (list license:gpl3 ; Most files | |
445 | license:bsd-3)))) ; curve/curve25519-donna.c | |
446 | ||
447 | (define-public python2-axolotl-curve25519 | |
448 | (package-with-python2 python-axolotl-curve25519)) | |
449 | ||
450 | (define-public python-axolotl | |
451 | (package | |
452 | (name "python-axolotl") | |
453 | (version "0.1.35") | |
454 | (source | |
455 | (origin | |
456 | (method url-fetch) | |
457 | (uri (string-append | |
458 | "https://github.com/tgalal/python-axolotl/archive/" | |
459 | version ".tar.gz")) | |
460 | (file-name (string-append name "-" version ".tar.gz")) | |
461 | (sha256 | |
462 | (base32 "1z8d89p7v40p4bwywjm9h4z28fdvra79ddw06azlkrfjbl7dxmz8")))) | |
463 | (build-system python-build-system) | |
464 | (arguments | |
465 | `(#:phases | |
466 | (modify-phases %standard-phases | |
467 | ;; Don't install tests | |
468 | (add-before 'install 'remove-tests | |
469 | (lambda _ | |
470 | (for-each delete-file-recursively | |
471 | '("axolotl/tests" "build/lib/axolotl/tests")) | |
472 | #t))))) | |
473 | (propagated-inputs | |
474 | `(("python-axolotl-curve25519" ,python-axolotl-curve25519) | |
475 | ("python-dateutil" ,python-dateutil) | |
476 | ("python-protobuf" ,python-protobuf) | |
477 | ("python-pycrypto" ,python-pycrypto))) | |
478 | (home-page "https://github.com/tgalal/python-axolotl") | |
479 | (synopsis "Python port of libaxolotl-android") | |
480 | (description "This is a python port of libaxolotl-android. This | |
481 | is a ratcheting forward secrecy protocol that works in synchronous and | |
482 | asynchronous messaging environments.") | |
483 | (license license:gpl3))) | |
484 | ||
485 | (define-public python2-axolotl | |
486 | (package-with-python2 python-axolotl)) | |
487 | ||
488 | ;; SlowAES isn't compatible with Python 3. | |
489 | (define-public python2-slowaes | |
490 | (package | |
491 | (name "python2-slowaes") | |
492 | (version "0.1a1") | |
493 | (source | |
494 | (origin | |
495 | (method url-fetch) | |
496 | (uri (pypi-uri "slowaes" version)) | |
497 | (sha256 | |
498 | (base32 | |
499 | "02dzajm83a7lqgxf6r3hgj64wfmcxz8gs4nvgxpvj5n19kjqlrc3")))) | |
500 | (build-system python-build-system) | |
501 | (arguments `(#:python ,python-2)) | |
502 | (home-page "http://code.google.com/p/slowaes/") | |
503 | (synopsis "Implementation of AES in Python") | |
504 | (description "This package contains an implementation of AES in Python. | |
505 | This implementation is slow (hence the project name) but still useful when | |
506 | faster ones are not available.") | |
507 | (license license:asl2.0))) | |
508 | ||
509 | (define-public python-pyaes | |
510 | (package | |
511 | (name "python-pyaes") | |
512 | (version "1.6.0") | |
513 | (source | |
514 | (origin | |
515 | (method url-fetch) | |
516 | (uri (pypi-uri "pyaes" version)) | |
517 | (sha256 | |
518 | (base32 | |
519 | "0bp9bjqy1n6ij1zb86wz9lqa1dhla8qr1d7w2kxyn7jbj56sbmcw")))) | |
520 | (build-system python-build-system) | |
521 | (home-page "https://github.com/ricmoo/pyaes") | |
522 | (synopsis "Implementation of AES in Python") | |
523 | (description "This package contains a pure-Python implementation of the | |
524 | AES block cipher algorithm and the common modes of operation (CBC, CFB, CTR, | |
525 | ECB and OFB).") | |
526 | (license license:expat))) | |
527 | ||
528 | (define-public python2-pyaes | |
529 | (package-with-python2 python-pyaes)) | |
b95c17c5 LC |
530 | |
531 | (define-public python-asn1crypto | |
532 | (package | |
533 | (name "python-asn1crypto") | |
534 | (version "0.22.0") | |
535 | (source | |
536 | (origin | |
537 | (method url-fetch) | |
538 | (uri (string-append "https://github.com/wbond/asn1crypto/archive/" | |
539 | version ".tar.gz")) | |
540 | (sha256 | |
541 | (base32 | |
542 | "1kn910896l3knmilla1c9ly20q181s43w1ah08lzkbm1h3j6pcz0")))) | |
543 | (build-system python-build-system) | |
544 | (home-page "https://github.com/wbond/asn1crypto") | |
545 | (synopsis "ASN.1 parser and serializer in Python") | |
546 | (description "asn1crypto is an ASN.1 parser and serializer with definitions | |
547 | for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, | |
548 | PKCS#8, PKCS#12, PKCS#5, X.509 and TSP.") | |
549 | (license license:expat))) | |
550 | ||
551 | (define-public python2-asn1crypto | |
552 | (package-with-python2 python-asn1crypto)) | |
553 | ||
554 | (define-public python-pynacl | |
555 | (package | |
556 | (name "python-pynacl") | |
557 | (version "1.1.2") | |
558 | (source | |
559 | (origin | |
560 | (method url-fetch) | |
561 | (uri (pypi-uri "PyNaCl" version)) | |
562 | (modules '((guix build utils))) | |
563 | ;; Remove bundled libsodium | |
564 | (snippet '(delete-file-recursively "src/libsodium")) | |
565 | (sha256 | |
566 | (base32 | |
567 | "135gz0020fqx8fbr9izpwyq49aww202nkqacq0cw61xz99sjpx9j")))) | |
568 | (build-system python-build-system) | |
569 | (arguments | |
570 | `(#:phases | |
571 | (modify-phases %standard-phases | |
572 | (add-before 'build 'use-system-sodium | |
573 | (lambda _ | |
574 | (setenv "SODIUM_INSTALL" "system") | |
575 | #t))))) | |
576 | (native-inputs | |
577 | `(("python-pytest" ,python-pytest))) | |
578 | (propagated-inputs | |
579 | `(("python-cffi" ,python-cffi) | |
580 | ("python-six" ,python-six) | |
581 | ("libsodium" ,libsodium))) | |
582 | (home-page "https://github.com/pyca/pynacl/") | |
583 | (synopsis "Python bindings to libsodium") | |
584 | (description | |
585 | "PyNaCl is a Python binding to libsodium, which is a fork of the | |
586 | Networking and Cryptography library. These libraries have a stated goal | |
587 | of improving usability, security and speed.") | |
588 | (license license:asl2.0))) | |
589 | ||
590 | (define-public python2-pgpdump | |
591 | (package | |
592 | (name "python2-pgpdump") | |
593 | (version "1.5") | |
594 | (source | |
595 | (origin | |
596 | (method url-fetch) | |
597 | (uri (pypi-uri "pgpdump" version)) | |
598 | (sha256 | |
599 | (base32 | |
600 | "0s4nh8h7qsdj2yf29bspjs1zvxd4lcd11r6g11dp7fppgf2h0iqw")))) | |
601 | (build-system python-build-system) | |
602 | ||
603 | ;; Currently fails to build with Python 3. | |
604 | (arguments `(#:python ,python-2)) | |
605 | ||
606 | (home-page "https://github.com/toofishes/python-pgpdump") | |
607 | (synopsis "Python library for parsing PGP packets") | |
608 | (description | |
609 | "Python-pgpdump is an OpenPGP packet parser based on | |
610 | @uref{http://www.mew.org/~kazu/proj/pgpdump/, pgpdump}. It notably supports: | |
611 | ||
612 | @itemize | |
613 | @item signature packets; | |
614 | @item public key packets; | |
615 | @item secret key packets; | |
616 | @item trust, user ID, and user attribute packets; | |
617 | @item ASCII-armor decoding and CRC check. | |
618 | @end itemize\n") | |
619 | (license license:bsd-3))) | |
620 | ||
621 | (define-public python2-roca-detect | |
622 | (package | |
623 | (name "python2-roca-detect") | |
624 | (version "1.0.8") | |
625 | (source | |
626 | (origin | |
627 | (method url-fetch) | |
628 | (uri (pypi-uri "roca-detect" version)) | |
629 | (sha256 | |
630 | (base32 | |
631 | "1di4akyw2lf5r8zfwvyhkilz8jv8g4b66rgaqwfabmjwma6gnw27")))) | |
632 | (build-system python-build-system) | |
633 | (native-inputs | |
634 | ;; TODO: apk_parse_ph4, pyjks | |
635 | `(("python2-dateutil" ,python2-dateutil) | |
636 | ("python2-six" ,python2-six) | |
637 | ("python2-cryptography" ,python2-cryptography) | |
638 | ("python2-future" ,python2-future) | |
639 | ("python2-coloredlogs" ,python2-coloredlogs) | |
640 | ("python2-pgpdump" ,python2-pgpdump))) | |
641 | (arguments | |
642 | `(;; Basic testing routine is quite simple and works with Py3 | |
643 | ;; but the rest of the code that processes the different | |
644 | ;; key formats and extracts the modulus for inspection is | |
645 | ;; not yet fully py3 ready. | |
646 | #:python ,python-2)) | |
647 | (home-page "https://github.com/crocs-muni/roca") | |
648 | (synopsis "ROCA detection tool") | |
649 | (description | |
650 | "This tool is related to the paper entitled @i{Return of the | |
651 | Coppersmith’s Attack: Practical Factorization of Widely Used RSA Moduli}. It | |
652 | enables you to test public RSA keys for a presence of the described | |
653 | vulnerability. Currently the tool supports the following key formats: X.509 | |
654 | Certificate (DER encoded, PEM encoded), RSA PEM (encoded private key, public | |
655 | key), SSH public key, ASC-encoded OpenPGP key, APK Android application, LDIFF | |
656 | file, and more.") | |
657 | (license license:gpl3))) | |
d0d5f726 DM |
658 | |
659 | (define-public python-ecpy | |
660 | (package | |
661 | (name "python-ecpy") | |
662 | (version "0.8.2") | |
663 | (source | |
664 | (origin | |
665 | (method url-fetch) | |
666 | (uri (pypi-uri "ECPy" version)) | |
667 | (sha256 | |
668 | (base32 | |
669 | "090fqnj8z0xm44jrfpll7j45r68m6kp7mjr7yxzg93j42h3sj285")))) | |
670 | (build-system python-build-system) | |
671 | (propagated-inputs | |
672 | `(("python-future" ,python-future))) | |
673 | (home-page "https://github.com/ubinity/ECPy") | |
674 | (synopsis "Pure Python Elliptic Curve Library") | |
675 | (description "This package provides a Elliptic Curve Library in pure | |
676 | Python.") | |
677 | (license license:asl2.0))) | |
678 | ||
679 | (define-public python2-ecpy | |
680 | (package-with-python2 python-ecpy)) |