gnu: python-cffi: Move to libffi.scm
[jackhill/guix/guix.git] / gnu / packages / crypto.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 David Thompson <davet@gnu.org>
3 ;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
5 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox>
6 ;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2016, 2017 ng0 <ng0@infotropique.org>
8 ;;; Copyright © 2016, 2017 Eric Bavier <bavier@member.fsf.org>
9 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
16 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25 (define-module (gnu packages crypto)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages admin)
28 #:use-module (gnu packages aidc)
29 #:use-module (gnu packages attr)
30 #:use-module (gnu packages autotools)
31 #:use-module (gnu packages boost)
32 #:use-module (gnu packages cryptsetup)
33 #:use-module (gnu packages gettext)
34 #:use-module (gnu packages gnupg)
35 #:use-module (gnu packages image)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages libbsd)
38 #:use-module (gnu packages libffi)
39 #:use-module (gnu packages linux)
40 #:use-module (gnu packages nettle)
41 #:use-module (gnu packages password-utils)
42 #:use-module (gnu packages perl)
43 #:use-module (gnu packages python)
44 #:use-module (gnu packages readline)
45 #:use-module (gnu packages search)
46 #:use-module (gnu packages serialization)
47 #:use-module (gnu packages shells)
48 #:use-module (gnu packages tcl)
49 #:use-module (gnu packages tls)
50 #:use-module (gnu packages xml)
51 #:use-module ((guix licenses) #:prefix license:)
52 #:use-module (guix packages)
53 #:use-module (guix download)
54 #:use-module (guix git-download)
55 #:use-module (guix build-system cmake)
56 #:use-module (guix build-system gnu)
57 #:use-module (guix build-system perl)
58 #:use-module (guix build-system python))
59
60 (define-public libsodium
61 (package
62 (name "libsodium")
63 (version "1.0.15")
64 (source (origin
65 (method url-fetch)
66 (uri (list (string-append
67 "https://download.libsodium.org/libsodium/"
68 "releases/libsodium-" version ".tar.gz")
69 (string-append
70 "https://download.libsodium.org/libsodium/"
71 "releases/old/libsodium-" version ".tar.gz")))
72 (sha256
73 (base32
74 "1x3qw7lsz44vcxpcn1dvwig410phg6gmv31jwj94arrgka3rwspv"))))
75 (build-system gnu-build-system)
76 (synopsis "Portable NaCl-based crypto library")
77 (description
78 "Sodium is a new easy-to-use high-speed software library for network
79 communication, encryption, decryption, signatures, etc.")
80 (license license:isc)
81 (home-page "https://libsodium.org")))
82
83 (define-public libmd
84 (package
85 (name "libmd")
86 (version "0.0.0")
87 (source (origin
88 (method url-fetch)
89 (uri (string-append
90 "https://archive.hadrons.org/software/libmd/libmd-"
91 version
92 ".tar.xz"))
93 (sha256
94 (base32
95 "121s73pgbqsnmy6xblbrkj9y44c5zzzpf2hcmh6zvcvg4dk26gzx"))))
96 (build-system gnu-build-system)
97 (synopsis "Message Digest functions from BSD systems")
98 (description
99 "The currently provided message digest algorithms are:
100 @itemize
101 @item MD2
102 @item MD4
103 @item MD5
104 @item RIPEMD-160
105 @item SHA-1
106 @item SHA-2 (SHA-256, SHA-384 and SHA-512)
107 @end itemize")
108 (license (list license:bsd-3
109 license:bsd-2
110 license:isc
111 license:public-domain))
112 (home-page "https://www.hadrons.org/software/libmd/")))
113
114 (define-public signify
115 (package
116 (name "signify")
117 (version "22")
118 (source (origin
119 (method url-fetch)
120 (uri (string-append "https://github.com/aperezdc/signify/"
121 "archive/v" version ".tar.gz"))
122 (file-name (string-append name "-" version ".tar.gz"))
123 (sha256
124 (base32
125 "0iv5bjaas70ymqchxasapin4c32c41kqzkfhc3kcjzd7rxy78msy"))))
126 (build-system gnu-build-system)
127 ;; TODO Build with libwaive (described in README.md), to implement something
128 ;; like OpenBSD's pledge().
129 (arguments
130 `(#:tests? #f ; no test suite
131 #:make-flags
132 (list "CC=gcc"
133 (string-append "PREFIX=" (assoc-ref %outputs "out")))
134 #:phases
135 (modify-phases %standard-phases
136 (delete 'configure))))
137 (native-inputs
138 `(("pkg-config" ,pkg-config)))
139 (inputs
140 `(("libbsd" ,libbsd)))
141 (synopsis "Create and verify cryptographic signatures")
142 (description "The signify utility creates and verifies cryptographic
143 signatures using the elliptic curve Ed25519. This is a Linux port of the
144 OpenBSD tool of the same name.")
145 (home-page "https://github.com/aperezdc/signify")
146 ;; This package includes third-party code that was originally released under
147 ;; various non-copyleft licenses. See the source files for clarification.
148 (license (list license:bsd-3 license:bsd-4 license:expat license:isc
149 license:public-domain (license:non-copyleft
150 "file://base64.c"
151 "See base64.c in the distribution for
152 the license from IBM.")))))
153
154
155 (define-public opendht
156 (package
157 (name "opendht")
158 (version "0.6.1")
159 (source
160 (origin
161 (method url-fetch)
162 (uri
163 (string-append
164 "https://github.com/savoirfairelinux/" name
165 "/archive/" version ".tar.gz"))
166 (file-name (string-append name "-" version ".tar.gz"))
167 (modules '((guix build utils)))
168 (snippet
169 '(begin
170 (delete-file-recursively "src/argon2")
171 (substitute* "src/Makefile.am"
172 (("./argon2/libargon2.la") "")
173 (("SUBDIRS = argon2") ""))
174 (substitute* "src/crypto.cpp"
175 (("argon2/argon2.h") "argon2.h"))
176 (substitute* "configure.ac"
177 (("src/argon2/Makefile") ""))))
178 (sha256
179 (base32
180 "09yvkmbqbym3b5md4n96qc1s9sf2n8ji404hagih45rmsj49599x"))))
181 (build-system gnu-build-system)
182 (inputs
183 `(("gnutls" ,gnutls)
184 ("nettle" ,nettle)
185 ("readline" ,readline)
186 ("argon2" ,argon2)))
187 (propagated-inputs
188 `(("msgpack" ,msgpack))) ;included in several installed headers
189 (native-inputs
190 `(("autoconf" ,autoconf)
191 ("pkg-config" ,pkg-config)
192 ("automake" ,automake)
193 ("libtool" ,libtool)))
194 (arguments
195 `(#:configure-flags '("--disable-tools" "--disable-python")
196 #:phases (modify-phases %standard-phases
197 (add-after 'unpack 'autoconf
198 (lambda _
199 (zero? (system* "autoreconf" "-vfi")))))))
200 (home-page "https://github.com/savoirfairelinux/opendht/")
201 (synopsis "Distributed Hash Table (DHT) library")
202 (description "OpenDHT is a Distributed Hash Table (DHT) library. It may
203 be used to manage peer-to-peer network connections as needed for real time
204 communication.")
205 (license license:gpl3)))
206
207 (define-public encfs
208 (package
209 (name "encfs")
210 (version "1.9.1")
211 (source
212 (origin
213 (method url-fetch)
214 (uri
215 (string-append "https://github.com/vgough/encfs/releases/download/v"
216 version "/encfs-" version ".tar.gz"))
217 (sha256
218 (base32
219 "1906254dg5hwljh0h4gyrw09ms3b57dlhjfzhfzffv50yzpkl837"))
220 (modules '((guix build utils)))
221 ;; Remove bundled dependencies in favour of proper inputs.
222 (snippet '(for-each delete-file-recursively
223 (find-files "internal" "^tinyxml2-[0-9]"
224 #:directories? #t)))))
225 (build-system cmake-build-system)
226 (native-inputs
227 `(("gettext" ,gettext-minimal)
228
229 ;; Test dependencies.
230 ("expect" ,expect)
231 ("perl" ,perl)))
232 (inputs
233 `(("attr" ,attr)
234 ("fuse" ,fuse)
235 ("openssl" ,openssl)
236 ("tinyxml2" ,tinyxml2)))
237 (arguments
238 `(#:configure-flags (list "-DUSE_INTERNAL_TINYXML=OFF")))
239 (home-page "https://vgough.github.io/encfs")
240 (synopsis "Encrypted virtual file system")
241 (description
242 "EncFS creates a virtual encrypted file system in user-space. Each file
243 created under an EncFS mount point is stored as a separate encrypted file on
244 the underlying file system. Like most encrypted file systems, EncFS is meant
245 to provide security against off-line attacks, such as a drive falling into
246 the wrong hands.")
247 (license (list license:expat ; internal/easylogging++.h
248 license:lgpl3+ ; encfs library
249 license:gpl3+)))) ; command-line tools
250
251 (define-public keyutils
252 (package
253 (name "keyutils")
254 (version "1.5.9")
255 (source
256 (origin
257 (method url-fetch)
258 (uri
259 (string-append "https://people.redhat.com/dhowells/keyutils/keyutils-"
260 version ".tar.bz2"))
261 (sha256
262 (base32
263 "1bl3w03ygxhc0hz69klfdlwqn33jvzxl1zfl2jmnb2v85iawb8jd"))
264 (modules '((guix build utils)))
265 ;; Create relative symbolic links instead of absolute ones to /lib/*
266 (snippet '(substitute* "Makefile" (("\\$\\(LNS\\) \\$\\(LIBDIR\\)/")
267 "$(LNS) ")))))
268 (build-system gnu-build-system)
269 (arguments
270 `(#:phases (modify-phases %standard-phases
271 (delete 'configure)) ; no configure script
272 #:make-flags (list "CC=gcc"
273 "RPATH=-Wl,-rpath,$(DESTDIR)$(LIBDIR)"
274 (string-append "DESTDIR="
275 (assoc-ref %outputs "out"))
276 "INCLUDEDIR=/include"
277 "LIBDIR=/lib"
278 "MANDIR=/share/man"
279 "SHAREDIR=/share/keyutils")
280 #:test-target "test"))
281 (home-page "https://people.redhat.com/dhowells/keyutils/")
282 (synopsis "Linux key management utilities")
283 (description
284 "Keyutils is a set of utilities for managing the key retention facility in
285 the Linux kernel, which can be used by file systems, block devices, and more to
286 gain and retain the authorization and encryption keys required to perform
287 secure operations. ")
288 (license (list license:lgpl2.1+ ; the files keyutils.*
289 license:gpl2+)))) ; the rest
290
291 ;; There is no release candidate but commits point out a version number,
292 ;; furthermore no tarball exists.
293 (define-public eschalot
294 (let ((commit "0bf31d88a11898c19b1ed25ddd2aff7b35dbac44")
295 (revision "1"))
296 (package
297 (name "eschalot")
298 (version (string-append "1.2.0-" revision "." (string-take commit 7)))
299 (source
300 (origin
301 (method git-fetch)
302 (uri (git-reference
303 (url "https://github.com/schnabear/eschalot")
304 (commit commit)))
305 (file-name (string-append name "-" version))
306 (sha256
307 (base32
308 "0lj38ldh8vzi11wp4ghw4k0fkwp0s04zv8k8d473p1snmbh7mx98"))))
309 (inputs
310 `(("openssl" ,openssl))) ; It needs: openssl/{bn,pem,rsa,sha}.h
311 (build-system gnu-build-system)
312 (arguments
313 `(#:make-flags (list "CC=gcc"
314 (string-append "PREFIX=" (assoc-ref %outputs "out"))
315 (string-append "INSTALL=" "install"))
316 ;; XXX: make test would run a !VERY! long hashing of names with the use
317 ;; of a wordlist, the amount of computing time this would waste on build
318 ;; servers is in no relation to the size or importance of this small
319 ;; application, therefore we run our own tests on eschalot and worgen.
320 #:phases
321 (modify-phases %standard-phases
322 (delete 'configure)
323 (replace 'check
324 (lambda _
325 (and
326 (zero? (system* "./worgen" "8-12" "top1000.txt" "3-10" "top400nouns.txt"
327 "3-6" "top150adjectives.txt" "3-6"))
328 (zero? (system* "./eschalot" "-r" "^guix|^guixsd"))
329 (zero? (system* "./eschalot" "-r" "^gnu|^free"))
330 (zero? (system* "./eschalot" "-r" "^cyber|^hack"))
331 (zero? (system* "./eschalot" "-r" "^troll")))))
332 ;; Make install can not create the bin dir, create it.
333 (add-before 'install 'create-bin-dir
334 (lambda* (#:key outputs #:allow-other-keys)
335 (let* ((out (assoc-ref outputs "out"))
336 (bin (string-append out "/bin")))
337 (mkdir-p bin)
338 #t))))))
339 (home-page "https://github.com/schnabear/eschalot")
340 (synopsis "Tor hidden service name generator")
341 (description
342 "Eschalot is a tor hidden service name generator, it allows one to
343 produce customized vanity .onion addresses using a brute-force method. Searches
344 for valid names can be run with regular expressions and wordlists. For the
345 generation of wordlists the included tool @code{worgen} can be used. There is
346 no man page, refer to the home page for usage details.")
347 (license (list license:isc license:expat)))))
348
349 (define-public tomb
350 (package
351 (name "tomb")
352 (version "2.4")
353 (source (origin
354 (method url-fetch)
355 (uri (string-append "https://files.dyne.org/tomb/"
356 "Tomb-" version ".tar.gz"))
357 (sha256
358 (base32
359 "1hv1w79as7swqj0n137vz8n8mwvcgwlvd91sdyssz41jarg7f1vr"))))
360 (build-system gnu-build-system)
361 (native-inputs `(("sudo" ,sudo))) ;presence needed for 'check' phase
362 (inputs
363 `(("zsh" ,zsh)
364 ("gnupg" ,gnupg)
365 ("cryptsetup" ,cryptsetup)
366 ("e2fsprogs" ,e2fsprogs) ;for mkfs.ext4
367 ("gettext" ,gettext-minimal) ;used at runtime
368 ("mlocate" ,mlocate)
369 ("pinentry" ,pinentry)
370 ("qrencode" ,qrencode)
371 ("steghide" ,steghide)))
372 (arguments
373 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
374 ;; TODO: Build and install gtk and qt trays
375 #:phases
376 (modify-phases %standard-phases
377 (delete 'configure) ;no configuration to be done
378 (add-after 'install 'i18n
379 (lambda* (#:key make-flags #:allow-other-keys)
380 (zero? (apply system*
381 "make" "-C" "extras/translations"
382 "install" make-flags))))
383 (add-after 'install 'wrap
384 (lambda* (#:key inputs outputs #:allow-other-keys)
385 (let ((out (assoc-ref outputs "out")))
386 (wrap-program (string-append out "/bin/tomb")
387 `("PATH" ":" prefix
388 (,(string-append (assoc-ref inputs "mlocate") "/bin")
389 ,@(map (lambda (program)
390 (or (and=> (which program) dirname)
391 (error "program not found:" program)))
392 '("seq" "mkfs.ext4" "pinentry" "sudo"
393 "gpg" "cryptsetup" "gettext"
394 "qrencode" "steghide")))))
395 #t)))
396 (delete 'check)
397 (add-after 'wrap 'check
398 (lambda* (#:key outputs #:allow-other-keys)
399 ;; Running the full tests requires sudo/root access for
400 ;; cryptsetup, which is not available in the build environment.
401 ;; But we can run `tomb dig` without root, so make sure that
402 ;; works. TODO: It Would Be Nice to check the expected "index",
403 ;; "search", "bury", and "exhume" features are available by
404 ;; querying `tomb -h`.
405 (let ((tomb (string-append (assoc-ref outputs "out")
406 "/bin/tomb")))
407 (zero? (system* tomb "dig" "-s" "10" "secrets.tomb"))))))))
408 (home-page "http://www.dyne.org/software/tomb")
409 (synopsis "File encryption for secret data")
410 (description
411 "Tomb is an application to manage the creation and access of encrypted
412 storage files: it can be operated from commandline and it can integrate with a
413 user's graphical desktop.")
414 (license license:gpl3+)))
415
416 (define-public scrypt
417 (package
418 (name "scrypt")
419 (version "1.2.1")
420 (source
421 (origin
422 (method url-fetch)
423 (uri (string-append "https://www.tarsnap.com/scrypt/scrypt-"
424 version ".tgz"))
425 (sha256
426 (base32
427 "0xy5yhrwwv13skv9im9vm76rybh9f29j2dh4hlh2x01gvbkza8a6"))))
428 (build-system gnu-build-system)
429 (arguments
430 `(#:phases (modify-phases %standard-phases
431 (add-after 'unpack 'patch-command-invocations
432 (lambda _
433 (substitute* "Makefile.in"
434 (("command -p") ""))
435 #t))
436 (add-after 'install 'install-docs
437 (lambda* (#:key outputs #:allow-other-keys)
438 (let* ((out (assoc-ref %outputs "out"))
439 (misc (string-append out "/share/doc/scrypt")))
440 (install-file "FORMAT" misc)
441 #t))))))
442 (inputs
443 `(("openssl" ,openssl)))
444 (home-page "https://www.tarsnap.com/scrypt.html")
445 (synopsis "Memory-hard encryption tool based on scrypt")
446 (description "This packages provides a simple password-based encryption
447 utility as a demonstration of the @code{scrypt} key derivation function.
448 @code{Scrypt} is designed to be far more resistant against hardware brute-force
449 attacks than alternative functions such as @code{PBKDF2} or @code{bcrypt}.")
450 (license license:bsd-2)))
451
452 (define-public python-asn1crypto
453 (package
454 (name "python-asn1crypto")
455 (version "0.22.0")
456 (source
457 (origin
458 (method url-fetch)
459 (uri (string-append "https://github.com/wbond/asn1crypto/archive/"
460 version ".tar.gz"))
461 (sha256
462 (base32
463 "1kn910896l3knmilla1c9ly20q181s43w1ah08lzkbm1h3j6pcz0"))))
464 (build-system python-build-system)
465 (home-page "https://github.com/wbond/asn1crypto")
466 (synopsis "ASN.1 parser and serializer in Python")
467 (description "asn1crypto is an ASN.1 parser and serializer with definitions
468 for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7,
469 PKCS#8, PKCS#12, PKCS#5, X.509 and TSP.")
470 (license license:expat)))
471
472 (define-public python2-asn1crypto
473 (package-with-python2 python-asn1crypto))
474
475 (define-public perl-math-random-isaac-xs
476 (package
477 (name "perl-math-random-isaac-xs")
478 (version "1.004")
479 (source
480 (origin
481 (method url-fetch)
482 (uri (string-append "mirror://cpan/authors/id/J/JA/JAWNSY/"
483 "Math-Random-ISAAC-XS-" version ".tar.gz"))
484 (sha256
485 (base32
486 "0yxqqcqvj51fn7b7j5xqhz65v74arzgainn66c6k7inijbmr1xws"))))
487 (build-system perl-build-system)
488 (native-inputs
489 `(("perl-module-build" ,perl-module-build)
490 ("perl-test-nowarnings" ,perl-test-nowarnings)))
491 (home-page "http://search.cpan.org/dist/Math-Random-ISAAC-XS")
492 (synopsis "C implementation of the ISAAC PRNG algorithm")
493 (description "ISAAC (Indirection, Shift, Accumulate, Add, and Count) is a
494 fast pseudo-random number generator. It is suitable for applications where a
495 significant amount of random data needs to be produced quickly, such as
496 solving using the Monte Carlo method or for games. The results are uniformly
497 distributed, unbiased, and unpredictable unless you know the seed.
498
499 This package implements the same interface as @code{Math::Random::ISAAC}.")
500 (license license:public-domain)))
501
502 (define-public perl-math-random-isaac
503 (package
504 (name "perl-math-random-isaac")
505 (version "1.004")
506 (source
507 (origin
508 (method url-fetch)
509 (uri (string-append "mirror://cpan/authors/id/J/JA/JAWNSY/"
510 "Math-Random-ISAAC-" version ".tar.gz"))
511 (sha256
512 (base32
513 "0z1b3xbb3xz71h25fg6jgsccra7migq7s0vawx2rfzi0pwpz0wr7"))))
514 (build-system perl-build-system)
515 (native-inputs
516 `(("perl-test-nowarnings" ,perl-test-nowarnings)))
517 (propagated-inputs
518 `(("perl-math-random-isaac-xs" ,perl-math-random-isaac-xs)))
519 (home-page "http://search.cpan.org/dist/Math-Random-ISAAC")
520 (synopsis "Perl interface to the ISAAC PRNG algorithm")
521 (description "ISAAC (Indirection, Shift, Accumulate, Add, and Count) is a
522 fast pseudo-random number generator. It is suitable for applications where a
523 significant amount of random data needs to be produced quickly, such as
524 solving using the Monte Carlo method or for games. The results are uniformly
525 distributed, unbiased, and unpredictable unless you know the seed.
526
527 This package provides a Perl interface to the ISAAC pseudo random number
528 generator.")
529 (license license:public-domain)))
530
531 (define-public perl-crypt-random-source
532 (package
533 (name "perl-crypt-random-source")
534 (version "0.12")
535 (source
536 (origin
537 (method url-fetch)
538 (uri (string-append "mirror://cpan/authors/id/E/ET/ETHER/"
539 "Crypt-Random-Source-" version ".tar.gz"))
540 (sha256
541 (base32
542 "00mw5m52sbz9nqp3f6axyrgcrihqxn7k8gv0vi1kvm1j1nc9g29h"))))
543 (build-system perl-build-system)
544 (native-inputs
545 `(("perl-module-build-tiny" ,perl-module-build-tiny)
546 ("perl-test-exception" ,perl-test-exception)))
547 (propagated-inputs
548 `(("perl-capture-tiny" ,perl-capture-tiny)
549 ("perl-module-find" ,perl-module-find)
550 ("perl-module-runtime" ,perl-module-runtime)
551 ("perl-moo" ,perl-moo)
552 ("perl-namespace-clean" ,perl-namespace-clean)
553 ("perl-sub-exporter" ,perl-sub-exporter)
554 ("perl-type-tiny" ,perl-type-tiny)))
555 (home-page "http://search.cpan.org/dist/Crypt-Random-Source")
556 (synopsis "Get weak or strong random data from pluggable sources")
557 (description "This module provides implementations for a number of
558 byte-oriented sources of random data.")
559 (license (package-license perl))))
560
561 (define-public perl-math-random-secure
562 (package
563 (name "perl-math-random-secure")
564 (version "0.080001")
565 (source
566 (origin
567 (method url-fetch)
568 (uri (string-append "mirror://cpan/authors/id/F/FR/FREW/"
569 "Math-Random-Secure-" version ".tar.gz"))
570 (sha256
571 (base32
572 "0dgbf4ncll4kmgkyb9fsaxn0vf2smc9dmwqzgh3259zc2zla995z"))))
573 (build-system perl-build-system)
574 (native-inputs
575 `(("perl-list-moreutils" ,perl-list-moreutils)
576 ("perl-test-leaktrace" ,perl-test-leaktrace)
577 ("perl-test-sharedfork" ,perl-test-sharedfork)
578 ("perl-test-warn" ,perl-test-warn)))
579 (inputs
580 `(("perl-crypt-random-source" ,perl-crypt-random-source)
581 ("perl-math-random-isaac" ,perl-math-random-isaac)
582 ("perl-math-random-isaac-xs" ,perl-math-random-isaac-xs)
583 ("perl-moo" ,perl-moo)))
584 (home-page "http://search.cpan.org/dist/Math-Random-Secure")
585 (synopsis "Cryptographically secure replacement for rand()")
586 (description "This module is intended to provide a
587 cryptographically-secure replacement for Perl's built-in @code{rand} function.
588 \"Crytographically secure\", in this case, means:
589
590 @enumerate
591 @item No matter how many numbers you see generated by the random number
592 generator, you cannot guess the future numbers, and you cannot guess the seed.
593 @item There are so many possible seeds that it would take decades, centuries,
594 or millenia for an attacker to try them all.
595 @item The seed comes from a source that generates relatively strong random
596 data on your platform, so the seed itself will be as random as possible.
597 @end enumerate\n")
598 (license license:artistic2.0)))
599
600 (define-public python-pynacl
601 (package
602 (name "python-pynacl")
603 (version "1.1.2")
604 (source
605 (origin
606 (method url-fetch)
607 (uri (pypi-uri "PyNaCl" version))
608 (modules '((guix build utils)))
609 ;; Remove bundled libsodium
610 (snippet '(delete-file-recursively "src/libsodium"))
611 (sha256
612 (base32
613 "135gz0020fqx8fbr9izpwyq49aww202nkqacq0cw61xz99sjpx9j"))))
614 (build-system python-build-system)
615 (arguments
616 `(#:phases
617 (modify-phases %standard-phases
618 (add-before 'build 'use-system-sodium
619 (lambda _
620 (setenv "SODIUM_INSTALL" "system")
621 #t)))))
622 (native-inputs
623 `(("python-pytest" ,python-pytest)))
624 (propagated-inputs
625 `(("python-cffi" ,python-cffi)
626 ("python-six" ,python-six)
627 ("libsodium" ,libsodium)))
628 (home-page "https://github.com/pyca/pynacl/")
629 (synopsis "Python bindings to libsodium")
630 (description
631 "PyNaCl is a Python binding to libsodium, which is a fork of the
632 Networking and Cryptography library. These libraries have a stated goal
633 of improving usability, security and speed.")
634 (license license:asl2.0)))