Correct name and Email for ng0.
[jackhill/guix/guix.git] / gnu / packages / python-crypto.scm
CommitLineData
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>
4a78fd46 12;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is>
cc6f4912
LC
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
78cross-platform implementations of over 30 password hashing algorithms, as well
79as a framework for managing existing password hashes. It's designed to be
80useful for a wide range of tasks, from verifying a hash found in /etc/shadow,
81to 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
107system hashes passwords using a version of Bruce Schneier's Blowfish block
108cipher with modifications designed to raise the cost of off-line password
109cracking and frustrate fast hardware implementation. The computation cost of
110the algorithm is parametised, so it can be increased as computers get faster.
111The intent is to make a compromise of a password database less likely to
112result in an attacker gaining knowledge of the plaintext passwords (e.g. using
113John 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")
9687d404 125 (version "2.1.5")
cc6f4912
LC
126 (source
127 (origin
128 (method url-fetch)
129 (uri (pypi-uri "paramiko" version))
130 (sha256
131 (base32
9687d404 132 "1pf0zxzhgyy4avby3ajg5hp18b0d8iirbkdfw53z0h6w611bp0wk"))))
cc6f4912
LC
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,
146providing both client and server functionality. While it leverages a Python C
147extension for low level cryptography (PyCrypto), Paramiko itself is a pure
148Python 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
177Curve Digital Signature Algorithm), implemented purely in Python. With this
178library, you can quickly create keypairs (signing key and verifying key), sign
179messages, and verify the signatures. The keys and signatures are very short,
180making 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
217and RIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal,
218etc.). 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
252service from python. It can be used in any application that needs safe
253password 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
275is 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")
818e6d97 284 (version "2.2")
cc6f4912
LC
285 (source
286 (origin
287 (method url-fetch)
288 (uri (pypi-uri "cryptography_vectors" version))
289 (sha256
290 (base32
818e6d97 291 "03cpmi5azvipphmva7dxv8k3w7ffblvn5452rs5r6smdhxyiqq6g"))))
cc6f4912
LC
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")
818e6d97 306 (version "2.2")
cc6f4912
LC
307 (source
308 (origin
309 (method url-fetch)
310 (uri (pypi-uri "cryptography" version))
311 (sha256
312 (base32
818e6d97 313 "0j2gwr4qxvskip77z4n9nqvr4vi243n3bzij18ay4drc6sg2g87m"))))
cc6f4912
LC
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)
2dd12924 328 ("python-pytest" ,python-pytest)))
cc6f4912
LC
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
333primitives to Python developers. It aims to be the “cryptographic standard
334library” for Python. The package includes both high level recipes, and low
335level interfaces to common cryptographic algorithms such as symmetric ciphers,
336message 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")
fb9d0350 355 (version "17.5.0")
cc6f4912
LC
356 (source
357 (origin
358 (method url-fetch)
359 (uri (pypi-uri "pyOpenSSL" version))
360 (sha256
361 (base32
fb9d0350 362 "0wv78mwsdqbxqwdwllf4maqybhbj3vb8328ia04hnb558sxcy41c"))))
cc6f4912
LC
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)
2dd12924 388 ("python-pytest" ,python-pytest)))
cc6f4912
LC
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
393library.")
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
441with ed25519 signatures. The C code was pulled from
442libaxolotl-android. At the moment this wrapper is meant for use by
443python-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")
51f887f3 453 (version "0.1.39")
cc6f4912
LC
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"))
51f887f3 461 (patches (search-patches "python-axolotl-AES-fix.patch"))
cc6f4912 462 (sha256
51f887f3 463 (base32 "0badsgkgz0ir3hqynxzsfjgacppi874syvvmgccc6j164053x6zm"))))
cc6f4912
LC
464 (build-system python-build-system)
465 (arguments
466 `(#:phases
467 (modify-phases %standard-phases
468 ;; Don't install tests
469 (add-before 'install 'remove-tests
470 (lambda _
471 (for-each delete-file-recursively
472 '("axolotl/tests" "build/lib/axolotl/tests"))
473 #t)))))
474 (propagated-inputs
475 `(("python-axolotl-curve25519" ,python-axolotl-curve25519)
476 ("python-dateutil" ,python-dateutil)
477 ("python-protobuf" ,python-protobuf)
478 ("python-pycrypto" ,python-pycrypto)))
479 (home-page "https://github.com/tgalal/python-axolotl")
480 (synopsis "Python port of libaxolotl-android")
481 (description "This is a python port of libaxolotl-android. This
482is a ratcheting forward secrecy protocol that works in synchronous and
483asynchronous messaging environments.")
484 (license license:gpl3)))
485
486(define-public python2-axolotl
487 (package-with-python2 python-axolotl))
488
489;; SlowAES isn't compatible with Python 3.
490(define-public python2-slowaes
491 (package
492 (name "python2-slowaes")
493 (version "0.1a1")
494 (source
495 (origin
496 (method url-fetch)
497 (uri (pypi-uri "slowaes" version))
498 (sha256
499 (base32
500 "02dzajm83a7lqgxf6r3hgj64wfmcxz8gs4nvgxpvj5n19kjqlrc3"))))
501 (build-system python-build-system)
502 (arguments `(#:python ,python-2))
503 (home-page "http://code.google.com/p/slowaes/")
504 (synopsis "Implementation of AES in Python")
505 (description "This package contains an implementation of AES in Python.
506This implementation is slow (hence the project name) but still useful when
507faster ones are not available.")
508 (license license:asl2.0)))
509
510(define-public python-pyaes
511 (package
512 (name "python-pyaes")
6de86fd5 513 (version "1.6.1")
cc6f4912
LC
514 (source
515 (origin
516 (method url-fetch)
517 (uri (pypi-uri "pyaes" version))
518 (sha256
519 (base32
6de86fd5 520 "13vdaff15k0jyfcss4b4xvfgm8xyv0nrbyw5n1qc7lrqbi0b3h82"))))
cc6f4912
LC
521 (build-system python-build-system)
522 (home-page "https://github.com/ricmoo/pyaes")
523 (synopsis "Implementation of AES in Python")
524 (description "This package contains a pure-Python implementation of the
525AES block cipher algorithm and the common modes of operation (CBC, CFB, CTR,
526ECB and OFB).")
527 (license license:expat)))
528
529(define-public python2-pyaes
530 (package-with-python2 python-pyaes))
b95c17c5
LC
531
532(define-public python-asn1crypto
533 (package
534 (name "python-asn1crypto")
535 (version "0.22.0")
536 (source
537 (origin
538 (method url-fetch)
539 (uri (string-append "https://github.com/wbond/asn1crypto/archive/"
540 version ".tar.gz"))
c8195582 541 (file-name (string-append name "-" version ".tar.gz"))
b95c17c5
LC
542 (sha256
543 (base32
544 "1kn910896l3knmilla1c9ly20q181s43w1ah08lzkbm1h3j6pcz0"))))
545 (build-system python-build-system)
546 (home-page "https://github.com/wbond/asn1crypto")
547 (synopsis "ASN.1 parser and serializer in Python")
548 (description "asn1crypto is an ASN.1 parser and serializer with definitions
549for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7,
550PKCS#8, PKCS#12, PKCS#5, X.509 and TSP.")
551 (license license:expat)))
552
553(define-public python2-asn1crypto
554 (package-with-python2 python-asn1crypto))
555
556(define-public python-pynacl
557 (package
558 (name "python-pynacl")
6969ad0e 559 (version "1.2.0")
b95c17c5
LC
560 (source
561 (origin
562 (method url-fetch)
563 (uri (pypi-uri "PyNaCl" version))
564 (modules '((guix build utils)))
565 ;; Remove bundled libsodium
566 (snippet '(delete-file-recursively "src/libsodium"))
567 (sha256
568 (base32
6969ad0e 569 "01vjq0pxyw1mxaqy013hzs8nknmvg3kpzlzmh69jxznyipgvria5"))))
b95c17c5
LC
570 (build-system python-build-system)
571 (arguments
572 `(#:phases
573 (modify-phases %standard-phases
574 (add-before 'build 'use-system-sodium
575 (lambda _
576 (setenv "SODIUM_INSTALL" "system")
577 #t)))))
578 (native-inputs
6969ad0e
LF
579 `(("python-hypothesis" ,python-hypothesis)
580 ("python-pytest" ,python-pytest)))
b95c17c5
LC
581 (propagated-inputs
582 `(("python-cffi" ,python-cffi)
583 ("python-six" ,python-six)
584 ("libsodium" ,libsodium)))
585 (home-page "https://github.com/pyca/pynacl/")
586 (synopsis "Python bindings to libsodium")
587 (description
588 "PyNaCl is a Python binding to libsodium, which is a fork of the
589Networking and Cryptography library. These libraries have a stated goal
590of improving usability, security and speed.")
591 (license license:asl2.0)))
592
593(define-public python2-pgpdump
594 (package
595 (name "python2-pgpdump")
596 (version "1.5")
597 (source
598 (origin
599 (method url-fetch)
600 (uri (pypi-uri "pgpdump" version))
601 (sha256
602 (base32
603 "0s4nh8h7qsdj2yf29bspjs1zvxd4lcd11r6g11dp7fppgf2h0iqw"))))
604 (build-system python-build-system)
605
606 ;; Currently fails to build with Python 3.
607 (arguments `(#:python ,python-2))
608
609 (home-page "https://github.com/toofishes/python-pgpdump")
610 (synopsis "Python library for parsing PGP packets")
611 (description
612 "Python-pgpdump is an OpenPGP packet parser based on
613@uref{http://www.mew.org/~kazu/proj/pgpdump/, pgpdump}. It notably supports:
614
615@itemize
616@item signature packets;
617@item public key packets;
618@item secret key packets;
619@item trust, user ID, and user attribute packets;
620@item ASCII-armor decoding and CRC check.
621@end itemize\n")
622 (license license:bsd-3)))
623
624(define-public python2-roca-detect
625 (package
626 (name "python2-roca-detect")
627 (version "1.0.8")
628 (source
629 (origin
630 (method url-fetch)
631 (uri (pypi-uri "roca-detect" version))
632 (sha256
633 (base32
634 "1di4akyw2lf5r8zfwvyhkilz8jv8g4b66rgaqwfabmjwma6gnw27"))))
635 (build-system python-build-system)
636 (native-inputs
637 ;; TODO: apk_parse_ph4, pyjks
638 `(("python2-dateutil" ,python2-dateutil)
639 ("python2-six" ,python2-six)
640 ("python2-cryptography" ,python2-cryptography)
641 ("python2-future" ,python2-future)
642 ("python2-coloredlogs" ,python2-coloredlogs)
643 ("python2-pgpdump" ,python2-pgpdump)))
644 (arguments
645 `(;; Basic testing routine is quite simple and works with Py3
646 ;; but the rest of the code that processes the different
647 ;; key formats and extracts the modulus for inspection is
648 ;; not yet fully py3 ready.
649 #:python ,python-2))
650 (home-page "https://github.com/crocs-muni/roca")
651 (synopsis "ROCA detection tool")
652 (description
653 "This tool is related to the paper entitled @i{Return of the
654Coppersmith’s Attack: Practical Factorization of Widely Used RSA Moduli}. It
655enables you to test public RSA keys for a presence of the described
656vulnerability. Currently the tool supports the following key formats: X.509
657Certificate (DER encoded, PEM encoded), RSA PEM (encoded private key, public
658key), SSH public key, ASC-encoded OpenPGP key, APK Android application, LDIFF
659file, and more.")
660 (license license:gpl3)))
d0d5f726
DM
661
662(define-public python-ecpy
663 (package
664 (name "python-ecpy")
665 (version "0.8.2")
666 (source
667 (origin
668 (method url-fetch)
669 (uri (pypi-uri "ECPy" version))
670 (sha256
671 (base32
672 "090fqnj8z0xm44jrfpll7j45r68m6kp7mjr7yxzg93j42h3sj285"))))
673 (build-system python-build-system)
674 (propagated-inputs
675 `(("python-future" ,python-future)))
676 (home-page "https://github.com/ubinity/ECPy")
677 (synopsis "Pure Python Elliptic Curve Library")
678 (description "This package provides a Elliptic Curve Library in pure
679Python.")
680 (license license:asl2.0)))
681
682(define-public python2-ecpy
683 (package-with-python2 python-ecpy))
c1927129
LF
684
685(define-public python-josepy
686 (package
687 (name "python-josepy")
688 (version "1.0.1")
689 (source (origin
690 (method url-fetch)
691 (uri (pypi-uri "josepy" version))
692 (sha256
693 (base32
694 "1k0ahzzaq2rrjiifwbhbp7vm8z4zk0ipgiqwicil80kzlf6bhj4z"))))
695 (build-system python-build-system)
696 (arguments
697 ;; The tests require pytest >= 3.2, which is not yet packaged.
698 '(#:tests? #f))
699 (propagated-inputs
700 `(("python-cryptography" ,python-cryptography)
701 ("python-pyopenssl" ,python-pyopenssl)
702 ("python-six" ,python-six)))
703;; TODO Enable when we have pytest >= 3.2.
704; (native-inputs
705; `(("python-coverage" ,python-coverage)
706; ("python-flake8" ,python-flake8)
707; ("python-isort" ,python-isort)
708; ("python-mock" ,python-mock)
709; ("python-pytest" ,python-pytest-3.0)
710; ("python-pytest-cov" ,python-pytest-cov)
711; ("python-pytest-cache" ,python-pytest-cache)
712; ("python-pytest-flake8" ,python-pytest-flake8)))
713 (home-page "https://github.com/certbot/josepy")
714 (synopsis "JOSE protocol implementation in Python")
715 (description "This package provides a Python implementation of the JOSE
716protocol (Javascript Object Signing and Encryption).")
717 (license license:asl2.0)))
718
719(define-public python2-josepy
720 (package-with-python2 python-josepy))
d32456d5
OP
721
722(define-public python-pycryptodome
723 (package
724 (name "python-pycryptodome")
47772a4e 725 (version "3.5.1")
d32456d5
OP
726 (source
727 (origin
728 (method url-fetch)
729 (uri (pypi-uri "pycryptodome" version))
730 (sha256
731 (base32
47772a4e 732 "15mc1h5ij1b6hcqvb048kb4k0ip64n2ky0zz0rml2s78ylv7g5dp"))))
d32456d5
OP
733 (build-system python-build-system)
734 (home-page "https://www.pycryptodome.org")
735 (synopsis "Cryptographic library for Python")
736 (description "This package provides a cryptographic library for Python.
737
738It brings the following enhancements with respect to the last official version
739of PyCrypto:
740
741@itemize
742@item Authenticated encryption modes (GCM, CCM, EAX, SIV, OCB)
743@item Accelerated AES on Intel platforms via AES-NI
744@item First class support for PyPy
745@item Elliptic curves cryptography (NIST P-256 curve only)
746@item Better and more compact API (nonce and iv attributes for ciphers,
747automatic generation of random nonces and IVs, simplified CTR cipher mode, and
748more)
749@item SHA-3 (including SHAKE XOFs) and BLAKE2 hash algorithms
750@item Salsa20 and ChaCha20 stream ciphers
751@item scrypt and HKDF
752@item Deterministic (EC)DSA
753@item Password-protected PKCS#8 key containers
754@item Shamir’s Secret Sharing scheme
755@item Random numbers get sourced directly from the OS (and not from a CSPRNG
756in userspace)
757@item Cleaner RSA and DSA key generation (largely based on FIPS 186-4)
758@item Major clean ups and simplification of the code base
759@end itemize\n")
760 (license license:bsd-2)))
761
762(define-public python2-pycryptodome
763 (package-with-python2 python-pycryptodome))