gnu: icecat: Update to 78.10.0-guix0-preview1 [security fixes].
[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, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2016, 2017, 2018, 2019 Leo Famulari <leo@famulari.name>
5 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox>
6 ;;; Copyright © 2016–2021 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
8 ;;; Copyright © 2016, 2017, 2019, 2020 Eric Bavier <bavier@posteo.net>
9 ;;; Copyright © 2017 Pierre Langlois <pierre.langlois@gmx.com>
10 ;;; Copyright © 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
11 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
12 ;;; Copyright © 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
13 ;;; Copyright © 2018, 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
14 ;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
15 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
16 ;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
17 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
18 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
19 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
20 ;;; Copyright © 2020 Hendur Saga <hendursaga@yahoo.com>
21 ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
22 ;;; Copyright © 2021 Ellis Kenyő <me@elken.dev>
23 ;;;
24 ;;; This file is part of GNU Guix.
25 ;;;
26 ;;; GNU Guix is free software; you can redistribute it and/or modify it
27 ;;; under the terms of the GNU General Public License as published by
28 ;;; the Free Software Foundation; either version 3 of the License, or (at
29 ;;; your option) any later version.
30 ;;;
31 ;;; GNU Guix is distributed in the hope that it will be useful, but
32 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
33 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 ;;; GNU General Public License for more details.
35 ;;;
36 ;;; You should have received a copy of the GNU General Public License
37 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
38
39 (define-module (gnu packages crypto)
40 #:use-module (gnu packages)
41 #:use-module (gnu packages admin)
42 #:use-module (gnu packages aidc)
43 #:use-module (gnu packages attr)
44 #:use-module (gnu packages autotools)
45 #:use-module (gnu packages boost)
46 #:use-module (gnu packages check)
47 #:use-module (gnu packages compression)
48 #:use-module (gnu packages crates-io)
49 #:use-module (gnu packages cryptsetup)
50 #:use-module (gnu packages documentation)
51 #:use-module (gnu packages gettext)
52 #:use-module (gnu packages gnupg)
53 #:use-module (gnu packages golang)
54 #:use-module (gnu packages graphviz)
55 #:use-module (gnu packages image)
56 #:use-module (gnu packages kerberos)
57 #:use-module (gnu packages libbsd)
58 #:use-module (gnu packages libffi)
59 #:use-module (gnu packages linux)
60 #:use-module (gnu packages lsof)
61 #:use-module (gnu packages man)
62 #:use-module (gnu packages multiprecision)
63 #:use-module (gnu packages nettle)
64 #:use-module (gnu packages password-utils)
65 #:use-module (gnu packages perl)
66 #:use-module (gnu packages perl-check)
67 #:use-module (gnu packages pkg-config)
68 #:use-module (gnu packages python)
69 #:use-module (gnu packages python-xyz)
70 #:use-module (gnu packages readline)
71 #:use-module (gnu packages search)
72 #:use-module (gnu packages serialization)
73 #:use-module (gnu packages shells)
74 #:use-module (gnu packages sqlite)
75 #:use-module (gnu packages tcl)
76 #:use-module (gnu packages tls)
77 #:use-module (gnu packages version-control)
78 #:use-module (gnu packages xml)
79 #:use-module ((guix licenses) #:prefix license:)
80 #:use-module (guix packages)
81 #:use-module (guix download)
82 #:use-module (guix git-download)
83 #:use-module (guix build-system cargo)
84 #:use-module (guix build-system cmake)
85 #:use-module (guix build-system copy)
86 #:use-module (guix build-system gnu)
87 #:use-module (guix build-system go)
88 #:use-module (guix build-system perl)
89 #:use-module (guix utils)
90 #:use-module (srfi srfi-1)
91 #:use-module (srfi srfi-26))
92
93 (define-public libdecaf
94 (package
95 (name "libdecaf")
96 (version "1.0.1")
97 (source (origin
98 (method git-fetch)
99 (uri (git-reference
100 (url "git://git.code.sf.net/p/ed448goldilocks/code")
101 (commit
102 (string-append "v" version))))
103 (file-name
104 (git-file-name name version))
105 (sha256
106 (base32 "1ajgmyvc6a4m1h2hg1g4wz7ibx10x1xys9m6ancnmmf1f2srlfly"))))
107 (build-system cmake-build-system)
108 (outputs '("out" "python" "doc"))
109 (arguments
110 `(#:configure-flags '("-DENABLE_STATIC=OFF")
111 #:phases
112 (modify-phases %standard-phases
113 (add-after 'unpack 'patch-python-binding
114 (lambda _
115 (substitute* "python/setup.py"
116 (("gmake")
117 "make")
118 (("'\\.\\.', 'build', 'lib', 'libdecaf\\.so'")
119 "'..', '..', 'build', 'src', 'libdecaf.so'"))))
120 (add-after 'install 'install-python-binding
121 (lambda* (#:key outputs #:allow-other-keys)
122 (with-directory-excursion "../source/python"
123 (invoke "python" "setup.py" "install"
124 (string-append "--prefix=" (assoc-ref outputs "python"))
125 "--root=/"))))
126 (add-after 'install-python-binding 'install-documentation
127 (lambda* (#:key outputs #:allow-other-keys)
128 (invoke "make" "doc")
129 (let* ((doc (assoc-ref outputs "doc"))
130 (dest (string-append doc "/share/doc")))
131 (copy-recursively "doc" dest)))))))
132 (native-inputs
133 `(("dot" ,graphviz)
134 ("doxygen" ,doxygen)
135 ("python" ,python-wrapper)))
136 (synopsis "Decaf Elliptic Curve Library")
137 (description "The libdecaf library is an implementation of elliptic curve
138 cryptography using the Montgomery and Edwards curves Curve25519, Ed25519,
139 Ed448-Goldilocks and Curve448, using the Decaf encoding.")
140 (home-page "http://ed448goldilocks.sourceforge.net/")
141 (license (list license:expat ;library
142 license:bsd-2)))) ;python bindings
143
144 (define-public libsodium
145 (package
146 (name "libsodium")
147 (version "1.0.18")
148 (source (origin
149 (method url-fetch)
150 (uri (list (string-append
151 "https://download.libsodium.org/libsodium/"
152 "releases/libsodium-" version ".tar.gz")
153 (string-append
154 "https://download.libsodium.org/libsodium/"
155 "releases/old/libsodium-" version ".tar.gz")))
156 (sha256
157 (base32
158 "1h9ncvj23qbbni958knzsli8dvybcswcjbx0qjjgi922nf848l3g"))))
159 (build-system gnu-build-system)
160 (synopsis "Portable NaCl-based crypto library")
161 (description
162 "Sodium is a new easy-to-use high-speed software library for network
163 communication, encryption, decryption, signatures, etc.")
164 (license license:isc)
165 (home-page "https://libsodium.org")))
166
167 (define-public libmd
168 (package
169 (name "libmd")
170 (version "1.0.3")
171 (source (origin
172 (method url-fetch)
173 (uri
174 (list
175 (string-append "https://archive.hadrons.org/software/libmd/libmd-"
176 version ".tar.xz")
177 (string-append "https://libbsd.freedesktop.org/releases/libmd-"
178 version ".tar.xz")))
179 (sha256
180 (base32
181 "0jmga8y94h857ilra3qjaiax3wd5pd6mx1h120zhl9fcjmzhj0js"))))
182 (build-system gnu-build-system)
183 (synopsis "Message Digest functions from BSD systems")
184 (description
185 "The currently provided message digest algorithms are:
186 @itemize
187 @item MD2
188 @item MD4
189 @item MD5
190 @item RIPEMD-160
191 @item SHA-1
192 @item SHA-2 (SHA-256, SHA-384 and SHA-512)
193 @end itemize")
194 (license (list license:bsd-3
195 license:bsd-2
196 license:isc
197 license:public-domain))
198 (home-page "https://www.hadrons.org/software/libmd/")))
199
200 (define-public signify
201 (package
202 (name "signify")
203 (version "30")
204 (home-page "https://github.com/aperezdc/signify")
205 (source (origin
206 (method url-fetch)
207 (uri (string-append "https://github.com/aperezdc/signify/releases"
208 "/download/v" version "/signify-" version ".tar.xz"))
209 (sha256
210 (base32
211 "11l67j04gyxnlw6zrzsygqs5cgsc1sww1rh0apl05yay131hd17n"))))
212 (build-system gnu-build-system)
213 ;; TODO Build with libwaive (described in README.md), to implement something
214 ;; like OpenBSD's pledge().
215 (arguments
216 `(#:make-flags
217 (list "CC=gcc"
218 (string-append "PREFIX=" (assoc-ref %outputs "out")))
219 #:phases
220 (modify-phases %standard-phases
221 (delete 'configure))))
222 (native-inputs
223 `(("pkg-config" ,pkg-config)))
224 (inputs
225 `(("libbsd" ,libbsd)))
226 (synopsis "Create and verify cryptographic signatures")
227 (description "The signify utility creates and verifies cryptographic
228 signatures using the elliptic curve Ed25519. This is a Linux port of the
229 OpenBSD tool of the same name.")
230 ;; This package includes third-party code that was originally released under
231 ;; various non-copyleft licenses. See the source files for clarification.
232 (license (list license:bsd-3 license:bsd-4 license:expat license:isc
233 license:public-domain (license:non-copyleft
234 "file://base64.c"
235 "See base64.c in the distribution for
236 the license from IBM.")))))
237
238 (define-public rust-minisign
239 (package
240 (name "rust-minisign")
241 (version "0.5.20")
242 (source
243 (origin
244 (method url-fetch)
245 (uri (crate-uri "minisign" version))
246 (file-name
247 (string-append name "-" version ".tar.gz"))
248 (sha256
249 (base32
250 "0xmcvh2snravghaar8igc6b9r3s1snnmf9qam9l3zyhm4987767y"))))
251 (build-system cargo-build-system)
252 (arguments
253 `(#:cargo-inputs
254 (("rust-getrandom" ,rust-getrandom-0.1)
255 ("rust-rpassword" ,rust-rpassword-4)
256 ("rust-scrypt" ,rust-scrypt-0.3))))
257 (home-page "https://github.com/jedisct1/rust-minisign")
258 (synopsis "Crate to sign files and verify signatures")
259 (description
260 "This package provides a crate to sign files and verify signatures.")
261 (license license:expat)))
262
263 (define-public go-minisign
264 (package
265 (name "go-minisign")
266 (version "0.1.0")
267 (source
268 (origin
269 (method git-fetch)
270 (uri (git-reference
271 (url "https://github.com/jedisct1/go-minisign")
272 (commit version)))
273 (file-name (git-file-name name version))
274 (sha256
275 (base32
276 "0wc0rk5m60yz52f0cncmbgq67yvb1rcx91gvzjg6jpc4mpw2db27"))
277 (modules '((guix build utils)))
278 (snippet
279 '(begin (delete-file-recursively "vendor") #t))))
280 (build-system go-build-system)
281 (arguments
282 '(#:import-path "github.com/jedisct1/go-minisign"))
283 (propagated-inputs
284 `(("go-golang-org-x-crypto" ,go-golang-org-x-crypto)))
285 (home-page "https://github.com/jedisct1/go-minisign")
286 (synopsis "Minisign verification library for Golang")
287 (description "A Golang library to verify Minisign signatures.")
288 (license license:expat)))
289
290 (define-public encfs
291 (package
292 (name "encfs")
293 (version "1.9.5")
294 (source
295 (origin
296 (method url-fetch)
297 (uri
298 (string-append "https://github.com/vgough/encfs/releases/download/v"
299 version "/encfs-" version ".tar.gz"))
300 (sha256
301 (base32
302 "0qzxavvv20577bxvly8s7d3y7bqasqclc2mllp0ddfncjm9z02a7"))
303 (modules '((guix build utils)))
304 ;; Remove bundled dependencies in favour of proper inputs.
305 (snippet '(begin
306 (for-each delete-file-recursively
307 '("vendor/github.com/leethomason/tinyxml2"
308 "vendor/github.com/google/googletest"))
309 #t))))
310 (build-system cmake-build-system)
311 (native-inputs
312 `(("gettext" ,gettext-minimal)
313
314 ;; Test dependencies.
315 ("expect" ,expect)
316 ("googletest-source" ,(package-source googletest))
317 ("perl" ,perl)))
318 (inputs
319 `(("attr" ,attr)
320 ("fuse" ,fuse)
321 ("openssl" ,openssl)
322 ("tinyxml2" ,tinyxml2)))
323 (arguments
324 `(#:configure-flags (list "-DUSE_INTERNAL_TINYXML=OFF")
325 #:phases
326 (modify-phases %standard-phases
327 (add-after 'unpack 'unpack-googletest
328 (lambda* (#:key inputs #:allow-other-keys)
329 (mkdir-p "vendor/github.com/google/googletest")
330 (copy-recursively (assoc-ref inputs "googletest-source")
331 "vendor/github.com/google/googletest")
332 #t))
333 (add-before 'configure 'patch-CMakeLists.txt
334 (lambda _
335 ;; Prevent CMake from adding libc on the system include path.
336 ;; Otherwise it will interfere with the libc used by GCC and
337 ;; ultimately cause #include_next errors.
338 (substitute* "CMakeLists.txt"
339 (("include_directories \\(SYSTEM \\$\\{Intl_INCLUDE_DIRS\\}\\)")
340 ""))
341 #t))
342 (add-before 'check 'make-unittests
343 (lambda _
344 (invoke "make" "unittests"))))))
345 (home-page "https://vgough.github.io/encfs")
346 (synopsis "Encrypted virtual file system")
347 (description
348 "EncFS creates a virtual encrypted file system in user-space. Each file
349 created under an EncFS mount point is stored as a separate encrypted file on
350 the underlying file system. Like most encrypted file systems, EncFS is meant
351 to provide security against off-line attacks, such as a drive falling into
352 the wrong hands.")
353 (license (list license:expat ; internal/easylogging++.h
354 license:lgpl3+ ; encfs library
355 license:gpl3+)))) ; command-line tools
356
357 (define-public keyutils
358 (package
359 (name "keyutils")
360 (version "1.6.1")
361 (source
362 (origin
363 (method url-fetch)
364 (uri
365 (string-append "https://people.redhat.com/dhowells/keyutils/keyutils-"
366 version ".tar.bz2"))
367 (sha256
368 (base32 "1kk4pmyflgplkgxn2bzpc069ph9c9jdd9ikcsyd5pnaimqi5gcf8"))
369 (modules '((guix build utils)))
370 ;; Create relative symbolic links instead of absolute ones to /lib/*.
371 (snippet '(begin
372 (substitute* "Makefile" (("\\$\\(LNS\\) \\$\\(LIBDIR\\)/")
373 "$(LNS) "))
374 #t))))
375 (build-system gnu-build-system)
376 (arguments
377 `(#:phases (modify-phases %standard-phases
378 (delete 'configure)) ; no configure script
379 #:make-flags (list "CC=gcc"
380 "RPATH=-Wl,-rpath,$(DESTDIR)$(LIBDIR)"
381 (string-append "DESTDIR="
382 (assoc-ref %outputs "out"))
383 "INCLUDEDIR=/include"
384 "LIBDIR=/lib"
385 "MANDIR=/share/man"
386 "SHAREDIR=/share/keyutils")
387 #:test-target "test"))
388 (inputs
389 `(("mit-krb5" ,mit-krb5)))
390 (home-page "https://people.redhat.com/dhowells/keyutils/")
391 (synopsis "Linux key management utilities")
392 (description
393 "Keyutils is a set of utilities for managing the key retention facility in
394 the Linux kernel, which can be used by file systems, block devices, and more to
395 gain and retain the authorization and encryption keys required to perform
396 secure operations. ")
397 (license (list license:lgpl2.1+ ; the files keyutils.*
398 license:gpl2+)))) ; the rest
399
400 ;; There is no release candidate but commits point out a version number,
401 ;; furthermore no tarball exists.
402 (define-public eschalot
403 (let ((commit "0bf31d88a11898c19b1ed25ddd2aff7b35dbac44")
404 (revision "1"))
405 (package
406 (name "eschalot")
407 (version (string-append "1.2.0-" revision "." (string-take commit 7)))
408 (source
409 (origin
410 (method git-fetch)
411 (uri (git-reference
412 (url "https://github.com/schnabear/eschalot")
413 (commit commit)))
414 (file-name (string-append name "-" version))
415 (sha256
416 (base32
417 "0lj38ldh8vzi11wp4ghw4k0fkwp0s04zv8k8d473p1snmbh7mx98"))))
418 (inputs
419 `(("openssl" ,openssl-1.0))) ; for openssl/{bn,pem,rsa,sha}.h
420 (build-system gnu-build-system)
421 (arguments
422 `(#:make-flags (list (string-append "CC=" ,(cc-for-target))
423 (string-append "PREFIX=" (assoc-ref %outputs "out"))
424 (string-append "INSTALL=" "install"))
425 ;; XXX: make test would run a !VERY! long hashing of names with the use
426 ;; of a wordlist, the amount of computing time this would waste on build
427 ;; servers is in no relation to the size or importance of this small
428 ;; application, therefore we run our own tests on eschalot and worgen.
429 #:phases
430 (modify-phases %standard-phases
431 (delete 'configure)
432 (replace 'check
433 (lambda _
434 (invoke "./worgen" "8-12" "top1000.txt" "3-10" "top400nouns.txt"
435 "3-6" "top150adjectives.txt" "3-6")
436 (invoke "./eschalot" "-r" "^guix|^guixsd")
437 (invoke "./eschalot" "-r" "^gnu|^free")
438 (invoke "./eschalot" "-r" "^cyber|^hack")
439 (invoke "./eschalot" "-r" "^troll")))
440 ;; Make install can not create the bin dir, create it.
441 (add-before 'install 'create-bin-dir
442 (lambda* (#:key outputs #:allow-other-keys)
443 (let* ((out (assoc-ref outputs "out"))
444 (bin (string-append out "/bin")))
445 (mkdir-p bin)
446 #t))))))
447 (home-page "https://github.com/schnabear/eschalot")
448 (synopsis "Tor hidden service name generator")
449 (description
450 "Eschalot is a tor hidden service name generator, it allows one to
451 produce customized vanity .onion addresses using a brute-force method. Searches
452 for valid names can be run with regular expressions and wordlists. For the
453 generation of wordlists the included tool @code{worgen} can be used. There is
454 no man page, refer to the home page for usage details.")
455 (license (list license:isc license:expat)))))
456
457 (define-public ssss
458 (package
459 (name "ssss")
460 (version "0.5")
461 (source (origin
462 (method url-fetch)
463 (uri (string-append "http://point-at-infinity.org/ssss/ssss-"
464 version ".tar.gz"))
465 (sha256
466 (base32
467 "15grn2fp1x8p92kxkwbmsx8rz16g93y9grl3hfqbh1jn21ama5jx"))))
468 (build-system gnu-build-system)
469 (arguments
470 `(#:tests? #f ; No test suite
471 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
472 "CC=gcc")
473 #:phases
474 (modify-phases %standard-phases
475 (delete 'configure) ; no configuration to be done
476 (replace 'install
477 (lambda* (#:key outputs #:allow-other-keys)
478 (let* ((outdir (assoc-ref outputs "out"))
479 (bindir (string-append outdir "/bin"))
480 (docdir (string-append outdir
481 "/share/doc/ssss-"
482 ,version)))
483 (install-file "ssss-combine" bindir)
484 (install-file "ssss-split" bindir)
485 (install-file "ssss.1" docdir)
486 (install-file "ssss.1.html" docdir)
487 #t))))))
488 (inputs
489 `(("gmp" ,gmp)))
490 (native-inputs
491 `(("xmltoman" ,xmltoman)))
492 (home-page "http://point-at-infinity.org/ssss/")
493 (synopsis "Shamir's secret sharing scheme implementation")
494 (description "@command{ssss-split} and @command{ssss-combine} are utilities that split
495 and combine secrets securely using Shamir's secret sharing scheme. This implementation
496 allows for a threshold scheme where the minimum number of shares can be less than the
497 total number of shares generated.")
498 (license license:gpl2+)))
499
500 (define-public tomb
501 (package
502 (name "tomb")
503 (version "2.9")
504 (source (origin
505 (method url-fetch)
506 (uri (string-append "https://files.dyne.org/tomb/releases/"
507 "Tomb-" version ".tar.gz"))
508 (sha256
509 (base32
510 "136nfnpaz29hngwwnzrmc858gpnvnb977gf4ldbpapw1h1k3r8mk"))))
511 (build-system gnu-build-system)
512 (native-inputs `(("sudo" ,sudo))) ;presence needed for 'check' phase
513 (inputs
514 `(("zsh" ,zsh)
515 ("gnupg" ,gnupg)
516 ("cryptsetup" ,cryptsetup)
517 ("e2fsprogs" ,e2fsprogs) ;for mkfs.ext4
518 ("gettext" ,gettext-minimal) ;used at runtime
519 ("lsof" ,lsof)
520 ("mlocate" ,mlocate)
521 ("pinentry" ,pinentry)
522 ("qrencode" ,qrencode)
523 ("steghide" ,steghide)
524 ("util-linux" ,util-linux)))
525 (arguments
526 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
527 ;; The "sudo" input is needed only to satisfy dependency checks in the
528 ;; 'check' phase. The "sudo" used at runtime should come from the
529 ;; system's setuid-programs, so ensure no reference is kept.
530 #:disallowed-references (,sudo)
531 ;; TODO: Build and install gtk and qt trays
532 #:phases
533 (modify-phases %standard-phases
534 (delete 'configure) ;no configuration to be done
535 (add-after 'install 'i18n
536 (lambda* (#:key make-flags #:allow-other-keys)
537 (apply invoke "make" "-C" "extras/translations"
538 "install" make-flags)
539 #t))
540 (add-after 'install 'wrap
541 (lambda* (#:key inputs outputs #:allow-other-keys)
542 (let ((out (assoc-ref outputs "out")))
543 (wrap-program (string-append out "/bin/tomb")
544 `("PATH" ":" prefix
545 (,(string-append (assoc-ref inputs "mlocate") "/bin")
546 ,@(map (lambda (program)
547 (or (and=> (which program) dirname)
548 (error "program not found:" program)))
549 '("seq" "mkfs.ext4" "pinentry"
550 "gpg" "cryptsetup" "gettext" "lsof"
551 "qrencode" "steghide" "findmnt" "getent")))))
552 #t)))
553 (delete 'check)
554 (add-after 'wrap 'check
555 (lambda* (#:key outputs #:allow-other-keys)
556 ;; Running the full tests requires sudo/root access for
557 ;; cryptsetup, which is not available in the build environment.
558 ;; But we can run `tomb dig` without root, so make sure that
559 ;; works. TODO: It Would Be Nice to check the expected "index",
560 ;; "search", "bury", and "exhume" features are available by
561 ;; querying `tomb -h`.
562 (let ((tomb (string-append (assoc-ref outputs "out")
563 "/bin/tomb")))
564 (invoke tomb "dig" "-s" "10" "secrets.tomb")
565 #t))))))
566 (home-page "https://www.dyne.org/software/tomb")
567 (synopsis "File encryption for secret data")
568 (description
569 "Tomb is an application to manage the creation and access of encrypted
570 storage files: it can be operated from commandline and it can integrate with a
571 user's graphical desktop.")
572 (license license:gpl3+)))
573
574 (define-public scrypt
575 (package
576 (name "scrypt")
577 (version "1.3.1")
578 (source
579 (origin
580 (method url-fetch)
581 (uri (string-append "https://www.tarsnap.com/scrypt/scrypt-"
582 version ".tgz"))
583 (sha256
584 (base32
585 "1hnl0r6pmyxiy4dmafmqk1db7wpc0x9rqpzqcwr9d2cmghcj6byz"))))
586 (build-system gnu-build-system)
587 (arguments
588 `(#:license-file-regexp "COPYRIGHT"
589 #:phases (modify-phases %standard-phases
590 (add-after 'unpack 'patch-$PATH-assumptions
591 (lambda _
592 (substitute* "configure"
593 (("\\{POSIX_PATH\\}")
594 "{PATH}"))
595 (substitute* "Makefile.in"
596 (("command -p") ""))
597 #t))
598 (add-after 'install 'install-docs
599 (lambda* (#:key outputs #:allow-other-keys)
600 (let* ((out (assoc-ref %outputs "out"))
601 (doc (string-append out "/share/doc/" ,name "-" ,version)))
602 (install-file "FORMAT" doc)
603 #t))))))
604 (inputs
605 `(("openssl" ,openssl)))
606 (home-page "https://www.tarsnap.com/scrypt.html")
607 (synopsis "Memory-hard encryption tool based on scrypt")
608 (description "This package provides a simple password-based encryption
609 utility as a demonstration of the @code{scrypt} key derivation function.
610 @code{Scrypt} is designed to be far more resistant against hardware brute-force
611 attacks than alternative functions such as @code{PBKDF2} or @code{bcrypt}.")
612 (license license:bsd-2)))
613
614 (define-public libscrypt
615 (package
616 (name "libscrypt")
617 (version "1.21")
618 (source
619 (origin
620 (method git-fetch)
621 (uri (git-reference
622 (url "https://github.com/technion/libscrypt")
623 (commit (string-append "v" version))))
624 (file-name (git-file-name name version))
625 (sha256
626 (base32
627 "1d76ys6cp7fi4ng1w3mz2l0p9dbr7ljbk33dcywyimzjz8bahdng"))))
628 (build-system gnu-build-system)
629 (outputs (list "out" "static"))
630 (arguments
631 `(#:make-flags (list (string-append "PREFIX=" %output)
632 "CC=gcc")
633 #:phases
634 (modify-phases %standard-phases
635 (delete 'configure) ; no configure script
636 (add-after 'install 'install:static
637 (lambda* (#:key outputs #:allow-other-keys)
638 (let* ((out (assoc-ref outputs "out"))
639 (lib (string-append out "/lib")))
640 (install-file "libscrypt.a" lib)
641 #t))))))
642 (home-page "https://lolware.net/libscrypt.html")
643 (synopsis "Password hashing library")
644 (description "@code{libscrypt} implements @code{scrypt} key derivation
645 function. It is designed to be far more secure against hardware brute-force
646 attacks than alternative functions such as @code{PBKDF2} or @code{bcrypt}.")
647 (license license:bsd-3)))
648
649 (define-public perl-math-random-isaac-xs
650 (package
651 (name "perl-math-random-isaac-xs")
652 (version "1.004")
653 (source
654 (origin
655 (method url-fetch)
656 (uri (string-append "mirror://cpan/authors/id/J/JA/JAWNSY/"
657 "Math-Random-ISAAC-XS-" version ".tar.gz"))
658 (sha256
659 (base32
660 "0yxqqcqvj51fn7b7j5xqhz65v74arzgainn66c6k7inijbmr1xws"))))
661 (build-system perl-build-system)
662 (native-inputs
663 `(("perl-module-build" ,perl-module-build)
664 ("perl-test-nowarnings" ,perl-test-nowarnings)))
665 (home-page "https://metacpan.org/release/Math-Random-ISAAC-XS")
666 (synopsis "C implementation of the ISAAC PRNG algorithm")
667 (description "ISAAC (Indirection, Shift, Accumulate, Add, and Count) is a
668 fast pseudo-random number generator. It is suitable for applications where a
669 significant amount of random data needs to be produced quickly, such as
670 solving using the Monte Carlo method or for games. The results are uniformly
671 distributed, unbiased, and unpredictable unless you know the seed.
672
673 This package implements the same interface as @code{Math::Random::ISAAC}.")
674 (license license:public-domain)))
675
676 (define-public perl-math-random-isaac
677 (package
678 (name "perl-math-random-isaac")
679 (version "1.004")
680 (source
681 (origin
682 (method url-fetch)
683 (uri (string-append "mirror://cpan/authors/id/J/JA/JAWNSY/"
684 "Math-Random-ISAAC-" version ".tar.gz"))
685 (sha256
686 (base32
687 "0z1b3xbb3xz71h25fg6jgsccra7migq7s0vawx2rfzi0pwpz0wr7"))))
688 (build-system perl-build-system)
689 (native-inputs
690 `(("perl-test-nowarnings" ,perl-test-nowarnings)))
691 (propagated-inputs
692 `(("perl-math-random-isaac-xs" ,perl-math-random-isaac-xs)))
693 (home-page "https://metacpan.org/release/Math-Random-ISAAC")
694 (synopsis "Perl interface to the ISAAC PRNG algorithm")
695 (description "ISAAC (Indirection, Shift, Accumulate, Add, and Count) is a
696 fast pseudo-random number generator. It is suitable for applications where a
697 significant amount of random data needs to be produced quickly, such as
698 solving using the Monte Carlo method or for games. The results are uniformly
699 distributed, unbiased, and unpredictable unless you know the seed.
700
701 This package provides a Perl interface to the ISAAC pseudo random number
702 generator.")
703 (license license:public-domain)))
704
705 (define-public perl-crypt-random-source
706 (package
707 (name "perl-crypt-random-source")
708 (version "0.14")
709 (source
710 (origin
711 (method url-fetch)
712 (uri (string-append "mirror://cpan/authors/id/E/ET/ETHER/"
713 "Crypt-Random-Source-" version ".tar.gz"))
714 (sha256
715 (base32 "1rpdds3sy5l1fhngnkrsgwsmwd54wpicx3i9ds69blcskwkcwkpc"))))
716 (build-system perl-build-system)
717 (native-inputs
718 `(("perl-module-build-tiny" ,perl-module-build-tiny)
719 ("perl-test-fatal" ,perl-test-fatal)))
720 (propagated-inputs
721 `(("perl-capture-tiny" ,perl-capture-tiny)
722 ("perl-module-find" ,perl-module-find)
723 ("perl-module-runtime" ,perl-module-runtime)
724 ("perl-moo" ,perl-moo)
725 ("perl-namespace-clean" ,perl-namespace-clean)
726 ("perl-sub-exporter" ,perl-sub-exporter)
727 ("perl-type-tiny" ,perl-type-tiny)))
728 (home-page "https://metacpan.org/release/Crypt-Random-Source")
729 (synopsis "Get weak or strong random data from pluggable sources")
730 (description "This module provides implementations for a number of
731 byte-oriented sources of random data.")
732 (license license:perl-license)))
733
734 (define-public perl-math-random-secure
735 (package
736 (name "perl-math-random-secure")
737 (version "0.080001")
738 (source
739 (origin
740 (method url-fetch)
741 (uri (string-append "mirror://cpan/authors/id/F/FR/FREW/"
742 "Math-Random-Secure-" version ".tar.gz"))
743 (sha256
744 (base32
745 "0dgbf4ncll4kmgkyb9fsaxn0vf2smc9dmwqzgh3259zc2zla995z"))))
746 (build-system perl-build-system)
747 (native-inputs
748 `(("perl-list-moreutils" ,perl-list-moreutils)
749 ("perl-test-leaktrace" ,perl-test-leaktrace)
750 ("perl-test-sharedfork" ,perl-test-sharedfork)
751 ("perl-test-warn" ,perl-test-warn)))
752 (inputs
753 `(("perl-crypt-random-source" ,perl-crypt-random-source)
754 ("perl-math-random-isaac" ,perl-math-random-isaac)
755 ("perl-math-random-isaac-xs" ,perl-math-random-isaac-xs)
756 ("perl-moo" ,perl-moo)))
757 (home-page "https://metacpan.org/release/Math-Random-Secure")
758 (synopsis "Cryptographically secure replacement for rand()")
759 (description "This module is intended to provide a
760 cryptographically-secure replacement for Perl's built-in @code{rand} function.
761 \"Crytographically secure\", in this case, means:
762
763 @enumerate
764 @item No matter how many numbers you see generated by the random number
765 generator, you cannot guess the future numbers, and you cannot guess the seed.
766 @item There are so many possible seeds that it would take decades, centuries,
767 or millennia for an attacker to try them all.
768 @item The seed comes from a source that generates relatively strong random
769 data on your platform, so the seed itself will be as random as possible.
770 @end enumerate\n")
771 (license license:artistic2.0)))
772
773 (define-public crypto++
774 (package
775 (name "crypto++")
776 (version "8.5.0")
777 (source (origin
778 (method git-fetch)
779 (uri
780 (git-reference
781 (url "https://github.com/weidai11/cryptopp")
782 (commit
783 (string-append "CRYPTOPP_"
784 (string-replace-substring version "." "_")))))
785 (sha256
786 (base32
787 "0in7rlazq91vfi519g9wr7bh87hii47cimxv7fmj0f88vhjaidq3"))))
788 (build-system gnu-build-system)
789 (arguments
790 `(#:make-flags
791 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
792 ;; Override "/sbin/ldconfig" with simply "echo" since
793 ;; we don't need ldconfig(8).
794 "LDCONF=echo")
795 #:phases
796 (modify-phases %standard-phases
797 (add-after 'unpack 'disable-native-optimisation
798 ;; This package installs more than just headers. Ensure that the
799 ;; cryptest.exe binary & static library aren't CPU model specific.
800 (lambda _
801 (substitute* "GNUmakefile"
802 ((" -march=native") ""))
803 #t))
804 (delete 'configure)
805 (replace 'build
806 ;; By default, only the static library is built.
807 (lambda* (#:key (make-flags '()) #:allow-other-keys)
808 (apply invoke "make" "shared"
809 "-j" (number->string (parallel-job-count))
810 make-flags)))
811 (add-after 'install 'install-shared-library-links
812 ;; By default, only .so and .so.x.y.z are installed.
813 ;; Create all the ‘intermediates’ expected by dependent packages.
814 (lambda* (#:key outputs #:allow-other-keys)
815 (let* ((out (assoc-ref outputs "out"))
816 (lib (string-append out "/lib"))
817 (prefix "libcryptopp.so.")
818 (target (string-append prefix ,version)))
819 (with-directory-excursion lib
820 (symlink target
821 (string-append prefix ,(version-major+minor version)))
822 (symlink target
823 (string-append prefix ,(version-major version)))
824 #t))))
825 (add-after 'install 'install-pkg-config
826 (lambda* (#:key outputs #:allow-other-keys)
827 (let* ((out (assoc-ref outputs "out"))
828 (pkg-dir (string-append out "/lib/pkgconfig")))
829 (mkdir-p pkg-dir)
830 (with-output-to-file (string-append pkg-dir "/libcrypto++.pc")
831 (lambda _
832 (display
833 (string-append
834 "prefix=" out "\n"
835 "libdir=" out "/lib\n"
836 "includedir=" out "/include\n\n"
837 "Name: libcrypto++-" ,version "\n"
838 "Description: Class library of cryptographic schemes\n"
839 "Version: " ,version "\n"
840 "Libs: -L${libdir} -lcryptopp\n"
841 "Cflags: -I${includedir}\n"))
842 #t))))))))
843 (native-inputs
844 `(("unzip" ,unzip)))
845 (home-page "https://cryptopp.com/")
846 (synopsis "C++ class library of cryptographic schemes")
847 (description "Crypto++ is a C++ class library of cryptographic schemes.")
848 ;; The compilation is distributed under the Boost license; the individual
849 ;; files in the compilation are in the public domain.
850 (license (list license:boost1.0 license:public-domain))))
851
852 (define-public libb2
853 (package
854 (name "libb2")
855 (version "0.98.1")
856 (source (origin
857 (method url-fetch)
858 (uri (string-append
859 "https://github.com/BLAKE2/libb2/releases/download/v"
860 version "/libb2-" version ".tar.gz"))
861 (sha256
862 (base32
863 "0bn7yrzdixdvzm46shbhpkqbr6zyqyxiqn7a7x54ag3mrvfnyqjk"))))
864 (build-system gnu-build-system)
865 (arguments
866 `(#:configure-flags
867 (list
868 ,@(if (any (cute string-prefix? <> (or (%current-system)
869 (%current-target-system)))
870 '("x86_64" "i686"))
871 ;; fat only checks for Intel optimisations
872 '("--enable-fat")
873 '())
874 "--disable-native"))) ;don't optimise at build time
875 (home-page "https://blake2.net/")
876 (synopsis "Library implementing the BLAKE2 family of hash functions")
877 (description
878 "libb2 is a portable implementation of the BLAKE2 family of cryptographic
879 hash functions. It includes optimised implementations for IA-32 and AMD64
880 processors, and an interface layer that automatically selects the best
881 implementation for the processor it is run on.
882
883 @dfn{BLAKE2} (RFC 7693) is a family of high-speed cryptographic hash functions
884 that are faster than MD5, SHA-1, SHA-2, and SHA-3, yet are at least as secure
885 as the latest standard, SHA-3. It is an improved version of the SHA-3 finalist
886 BLAKE.")
887 (license license:public-domain)))
888
889 (define-public rhash
890 (package
891 (name "rhash")
892 (version "1.3.9")
893 (source
894 (origin
895 (method url-fetch)
896 (uri (string-append "mirror://sourceforge/rhash/rhash/" version
897 "/rhash-" version "-src.tar.gz"))
898 (file-name (string-append "rhash-" version ".tar.gz"))
899 (sha256
900 (base32
901 "1xn9fqa6rlnhsbgami45g82dlw9i1skg2sri3ydiinwak5ph1ca2"))))
902 (build-system gnu-build-system)
903 (arguments
904 `(#:configure-flags
905 (list (string-append "--prefix=" (assoc-ref %outputs "out"))
906 ,@(let ((target (%current-target-system)))
907 (if target
908 `((string-append "--target=" ,target)
909 (string-append "--cc="
910 (assoc-ref %build-inputs "cross-gcc")
911 "/bin/" ,target "-gcc"))
912 '())))
913 #:make-flags
914 ;; The binaries in /bin need some help finding librhash.so.0.
915 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
916 #:test-target "test" ; ‘make check’ just checks the sources
917 #:phases
918 (modify-phases %standard-phases
919 (replace 'configure
920 ;; ./configure is not GNU autotools' and doesn't gracefully handle
921 ;; unrecognized options, so we must call it manually.
922 (lambda* (#:key configure-flags #:allow-other-keys)
923 (apply invoke "./configure" configure-flags)))
924 (add-before 'check 'patch-/bin/sh
925 (lambda _
926 (substitute* "Makefile"
927 (("/bin/sh") (which "sh")))
928 #t))
929 (add-after 'install 'install-library-extras
930 (lambda* (#:key make-flags #:allow-other-keys)
931 (apply invoke
932 "make" "-C" "librhash"
933 "install-lib-headers" "install-so-link"
934 make-flags))))))
935 (home-page "https://sourceforge.net/projects/rhash/")
936 (synopsis "Utility for computing hash sums")
937 (description "RHash is a console utility for calculation and verification
938 of magnet links and a wide range of hash sums like CRC32, MD4, MD5, SHA1,
939 SHA256, SHA512, SHA3, AICH, ED2K, Tiger, DC++ TTH, BitTorrent BTIH, GOST R
940 34.11-94, RIPEMD-160, HAS-160, EDON-R, Whirlpool and Snefru.")
941 (license (license:non-copyleft "file://COPYING"))))
942
943 (define-public botan
944 (package
945 (name "botan")
946 (version "2.17.3")
947 (source (origin
948 (method url-fetch)
949 (uri (string-append "https://botan.randombit.net/releases/"
950 "Botan-" version ".tar.xz"))
951 (sha256
952 (base32
953 "121vn1aryk36cpks70kk4c4cfic5g0qs82bf92xap9258ijkn4kr"))))
954 (build-system gnu-build-system)
955 (arguments
956 '(#:phases
957 (modify-phases %standard-phases
958 (replace 'configure
959 (lambda* (#:key inputs outputs #:allow-other-keys)
960 (let* ((out (assoc-ref %outputs "out"))
961 (lib (string-append out "/lib")))
962 ;; Upstream tests and benchmarks with -O3.
963 (setenv "CXXFLAGS" "-O3")
964 (invoke "python" "./configure.py"
965 (string-append "--prefix=" out)
966 ;; Otherwise, the `botan` executable cannot find
967 ;; libbotan.
968 (string-append "--ldflags=-Wl,-rpath=" lib)
969
970 "--with-os-feature=getentropy"
971 "--with-rst2man"
972
973 ;; Recommended by upstream
974 "--with-zlib" "--with-bzip2" "--with-sqlite3"))))
975 (add-before 'check 'library-path-for-tests
976 (lambda _ (setenv "LD_LIBRARY_PATH" (getcwd))))
977 (replace 'check
978 (lambda _ (invoke "./botan-test"))))))
979 (native-inputs
980 `(("python" ,python-wrapper)
981 ("python-docutils" ,python-docutils)))
982 (inputs
983 `(("sqlite" ,sqlite)
984 ("bzip2" ,bzip2)
985 ("zlib" ,zlib)))
986 (synopsis "Cryptographic library in C++11")
987 (description "Botan is a cryptography library, written in C++11, offering
988 the tools necessary to implement a range of practical systems, such as TLS/DTLS,
989 PKIX certificate handling, PKCS#11 and TPM hardware support, password hashing,
990 and post-quantum crypto schemes. In addition to the C++, botan has a C89 API
991 specifically designed to be easy to call from other languages. A Python binding
992 using ctypes is included, and several other language bindings are available.")
993 (home-page "https://botan.randombit.net")
994 (license license:bsd-2)))
995
996 (define-public ccrypt
997 (package
998 (name "ccrypt")
999 (version "1.11")
1000 (source (origin
1001 (method url-fetch)
1002 (uri (string-append "mirror://sourceforge/ccrypt/"
1003 version "/ccrypt-" version ".tar.gz"))
1004 (sha256
1005 (base32
1006 "0kx4a5mhmp73ljknl2lcccmw9z3f5y8lqw0ghaymzvln1984g75i"))))
1007 (build-system gnu-build-system)
1008 (home-page "http://ccrypt.sourceforge.net")
1009 (synopsis "Command-line utility for encrypting and decrypting files and streams")
1010 (description "@command{ccrypt} is a utility for encrypting and decrypting
1011 files and streams. It was designed as a replacement for the standard unix
1012 @command{crypt} utility, which is notorious for using a very weak encryption
1013 algorithm. @command{ccrypt} is based on the Rijndael block cipher, a version of
1014 which is also used in the Advanced Encryption Standard (AES, see
1015 @url{http://www.nist.gov/aes}). This cipher is believed to provide very strong
1016 security.")
1017 (license license:gpl2)))
1018
1019 (define-public asignify
1020 (let ((commit "f58e7977a599f040797975d649ed318e25cbd2d5")
1021 (revision "0"))
1022 (package
1023 (name "asignify")
1024 (version (git-version "1.1" revision commit))
1025 (source (origin
1026 (method git-fetch)
1027 (uri (git-reference
1028 (url "https://github.com/vstakhov/asignify")
1029 (commit commit)))
1030 (file-name (git-file-name name version))
1031 (sha256
1032 (base32
1033 "1zl68qq6js6fdahxzyhvhrpyrwlv8c2zhdplycnfxyr1ckkhq8dw"))))
1034 (build-system gnu-build-system)
1035 (arguments
1036 `(#:configure-flags
1037 (list "--enable-openssl"
1038 (string-append "--with-openssl="
1039 (assoc-ref %build-inputs "openssl")))))
1040 (native-inputs
1041 `(("autoconf" ,autoconf)
1042 ("automake" ,automake)
1043 ("libtool" ,libtool)))
1044 (inputs
1045 `(("openssl" ,openssl)))
1046 (home-page "https://github.com/vstakhov/asignify")
1047 (synopsis "Cryptographic authentication and encryption tool and library")
1048 (description "Asignify offers public cryptographic signatures and
1049 encryption with a library or a command-line tool. The tool is heavily inspired
1050 by signify as used in OpenBSD. The main goal of this project is to define a
1051 high level API for signing files, validating signatures and encrypting using
1052 public-key cryptography. Asignify is designed to be portable and self-contained
1053 with zero external dependencies. Asignify can verify OpenBSD signatures, but it
1054 cannot sign messages in OpenBSD format yet.")
1055 (license license:bsd-2))))
1056
1057 (define-public enchive
1058 (package
1059 (name "enchive")
1060 (version "3.5")
1061 (source (origin
1062 (method git-fetch)
1063 (uri (git-reference
1064 (url "https://github.com/skeeto/enchive")
1065 (commit version)))
1066 (sha256
1067 (base32
1068 "0fdrfc5l42lj2bvmv9dmkmhmm7qiszwk7cmdvnqad3fs7652g0qa"))
1069 (file-name (git-file-name name version))))
1070 (build-system gnu-build-system)
1071 (arguments
1072 '(#:tests? #f ; no check target '
1073 #:make-flags (list "CC=gcc" "PREFIX=$(out)")
1074 #:phases (modify-phases %standard-phases
1075 (delete 'configure)
1076 (add-after 'install 'post-install
1077 (lambda _
1078 (let* ((out (assoc-ref %outputs "out"))
1079 (lisp (string-append out "/share/emacs/site-lisp")))
1080 (install-file "enchive-mode.el" lisp)
1081 #t))))))
1082 (synopsis "Encrypted personal archives")
1083 (description
1084 "Enchive is a tool to encrypt files to yourself for long-term
1085 archival. It's a focused, simple alternative to more complex solutions such as
1086 GnuPG or encrypted filesystems. Enchive has no external dependencies and is
1087 trivial to build for local use. Portability is emphasized over performance.")
1088 (home-page "https://github.com/skeeto/enchive")
1089 (license license:unlicense)))
1090
1091 (define-public libsecp256k1
1092 (let ((commit "dbd41db16a0e91b2566820898a3ab2d7dad4fe00"))
1093 (package
1094 (name "libsecp256k1")
1095 (version (git-version "20200615" "1" commit))
1096 (source (origin
1097 (method git-fetch)
1098 (uri (git-reference
1099 (url "https://github.com/bitcoin-core/secp256k1")
1100 (commit commit)))
1101 (sha256
1102 (base32
1103 "1fcpnksq5cqwqzshn5f0lq94b73p3frwbp04hgmmbnrndpqg6mpy"))
1104 (file-name (git-file-name name version))))
1105 (build-system gnu-build-system)
1106 (arguments
1107 '(#:configure-flags '("--enable-module-recovery"
1108 "--enable-experimental"
1109 "--enable-module-ecdh"
1110 "--enable-shared")))
1111 (native-inputs
1112 `(("autoconf" ,autoconf)
1113 ("automake" ,automake)
1114 ("libtool" ,libtool)))
1115 ;; WARNING: This package might need additional configure flags to run properly.
1116 ;; See https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/libsecp256k1.
1117 (synopsis "C library for EC operations on curve secp256k1")
1118 (description
1119 "Optimized C library for EC operations on curve secp256k1.
1120
1121 This library is a work in progress and is being used to research best
1122 practices. Use at your own risk.
1123
1124 Features:
1125
1126 @itemize
1127 @item secp256k1 ECDSA signing/verification and key generation.
1128 @item Adding/multiplying private/public keys.
1129 @item Serialization/parsing of private keys, public keys, signatures.
1130 @item Constant time, constant memory access signing and pubkey generation.
1131 @item Derandomized DSA (via RFC6979 or with a caller provided function.)
1132 @item Very efficient implementation.
1133 @end itemize\n")
1134 (home-page "https://github.com/bitcoin-core/secp256k1")
1135 (license license:unlicense))))
1136
1137 (define-public libsecp256k1-bitcoin-cash
1138 (package
1139 (name "libsecp256k1-bitcoin-cash")
1140 (version "0.22.1")
1141 (source
1142 (origin
1143 (method git-fetch)
1144 (uri (git-reference
1145 (url "https://github.com/Bitcoin-ABC/secp256k1")
1146 (commit (string-append "v" version))))
1147 (file-name (git-file-name name version))
1148 (sha256
1149 (base32 "1rnif3iny6pz1r3g69bagzr342mm3x0v66b60csnmm1rg44bd5v1"))))
1150 (build-system gnu-build-system)
1151 (native-inputs
1152 `(("autoconf" ,autoconf)
1153 ("automake" ,automake)
1154 ("libtool" ,libtool)))
1155 (arguments
1156 '(#:configure-flags '("--enable-module-recovery"
1157 "--enable-experimental"
1158 "--enable-module-ecdh"
1159 "--disable-jni"
1160 "--with-bignum=no"
1161 "--enable-module-schnorr"
1162 "--disable-static"
1163 "--enable-shared")))
1164 (synopsis "Optimized C library for EC operations on curve secp256k1")
1165 (description
1166 "Optimized C library for cryptographic operations on curve secp256k1.
1167
1168 This library is used for consensus critical cryptographic operations on the
1169 Bitcoin Cash network.
1170
1171 Features:
1172
1173 @itemize
1174 @item secp256k1 ECDSA signing/verification and key generation.
1175 @item secp256k1 Schnorr signing/verification (Bitcoin Cash Schnorr variant).
1176 @item Additive and multiplicative tweaking of secret/public keys.
1177 @item Serialization/parsing of secret keys, public keys, signatures.
1178 @item Constant time, constant memory access signing and pubkey generation.
1179 @item Derandomized ECDSA (via RFC6979 or with a caller provided function).
1180 @item Very efficient implementation.
1181 @item Suitable for embedded systems.
1182 @item Optional module for public key recovery.
1183 @item Optional module for ECDH key exchange (experimental).
1184 @item Optional module for multiset hash (experimental).
1185 @end itemize\n")
1186 (home-page "https://github.com/Bitcoin-ABC/secp256k1")
1187 (license license:expat)))
1188
1189 (define-public stoken
1190 (package
1191 (name "stoken")
1192 (version "0.92")
1193 (source (origin
1194 (method url-fetch)
1195 (uri (string-append "mirror://sourceforge/stoken/"
1196 "stoken-" version ".tar.gz"))
1197 (sha256
1198 (base32
1199 "0npgr6y85gzwksy8jkwa4yzvqwjprwnplx3yiw3ayk4f0ldlhaxa"))))
1200 (build-system gnu-build-system)
1201 (native-inputs
1202 `(("pkg-config" ,pkg-config)))
1203 (inputs
1204 `(("nettle" ,nettle)
1205 ("libxml2" ,libxml2)))
1206 (home-page "http://stoken.sf.net")
1207 (synopsis "Software Token for cryptographic authentication")
1208 (description
1209 "@code{stoken} is a token code generator compatible with RSA SecurID
1210 128-bit (AES) tokens. This package contains a standalone command-line program
1211 that allows for importing token seeds, generating token codes, and various
1212 utility/testing functions.")
1213 (license license:lgpl2.1+)))
1214
1215 (define-public hpenc
1216 (package
1217 (name "hpenc")
1218 (version "3.0")
1219 (source (origin
1220 (method git-fetch)
1221 (uri (git-reference
1222 (url "https://github.com/vstakhov/hpenc")
1223 (commit version)))
1224 (file-name (git-file-name name version))
1225 (sha256
1226 (base32
1227 "1fb5yi3d2k8kd4zm7liiqagpz610y168xrr1cvn7cbq314jm2my1"))))
1228 (build-system gnu-build-system)
1229 (arguments
1230 `(#:tests? #f ; No test suite
1231 #:make-flags
1232 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1233 ;; Build the program and the docs.
1234 "SUBDIRS=src doc")
1235 #:phases
1236 (modify-phases %standard-phases
1237 (delete 'configure) ; No ./configure script
1238 (add-after 'unpack 'patch-path
1239 (lambda _
1240 (substitute* '("src/Makefile" "doc/Makefile")
1241 (("/usr/bin/install")
1242 "install"))))
1243 (add-before 'install 'make-output-directories
1244 (lambda* (#:key outputs #:allow-other-keys)
1245 (let* ((out (assoc-ref outputs "out"))
1246 (bin (string-append out "/bin"))
1247 (man1 (string-append out "/share/man/man1")))
1248 (mkdir-p bin)
1249 (mkdir-p man1)
1250 #t))))))
1251 (inputs
1252 `(("libsodium" ,libsodium)
1253 ("openssl" ,openssl)))
1254 (synopsis "High-performance command-line tool for stream encryption")
1255 (description "Hpenc is a command-line tool for performing authenticated
1256 encryption (AES-GCM and ChaCha20-Poly1305) of streaming data. It does not
1257 perform an asymmetric key exchange, instead requiring the user to distribute
1258 pre-shared keys out of band. It is designed to handle large amounts of data
1259 quickly by using all your CPU cores and hardware acceleration.")
1260 (home-page "https://github.com/vstakhov/hpenc")
1261 (license license:bsd-3)))
1262
1263 (define-public minisign
1264 (package
1265 (name "minisign")
1266 (version "0.9")
1267 (source
1268 (origin
1269 (method url-fetch)
1270 (uri
1271 (string-append "https://github.com/jedisct1/minisign/releases/download/"
1272 version "/minisign-" version ".tar.gz"))
1273 (sha256
1274 (base32 "1h9cfvvm6lqq33b2wdar1x3w4k7zyrscavllyb0l5dmcdabq60r2"))))
1275 (build-system cmake-build-system)
1276 (arguments
1277 ; No test suite
1278 `(#:tests? #f))
1279 (native-inputs
1280 `(("pkg-config" ,pkg-config)))
1281 (inputs
1282 `(("libsodium" ,libsodium)))
1283 (home-page "https://jedisct1.github.io/minisign")
1284 (synopsis "Tool to sign files and verify signatures")
1285 (description
1286 "Minisign is a dead simple tool to sign files and verify signatures. It is
1287 portable, lightweight, and uses the highly secure Ed25519 public-key signature
1288 system. Signature written by minisign can be verified using OpenBSD's
1289 signify tool: public key files and signature files are compatible. However,
1290 minisign uses a slightly different format to store secret keys. Minisign
1291 signatures include trusted comments in addition to untrusted comments.
1292 Trusted comments are signed, thus verified, before being displayed.")
1293 (license license:isc)))
1294
1295 (define-public libolm
1296 (package
1297 (name "libolm")
1298 (version "3.2.2")
1299 (source (origin
1300 (method git-fetch)
1301 (uri (git-reference
1302 (url "https://git.matrix.org/git/olm")
1303 (commit version)))
1304 (sha256
1305 (base32
1306 "0qji25wiwmkxyfpraxj96c54hyayqmjkvwh0gsy5gb5pz5bp4mcy"))
1307 (file-name (git-file-name name version))))
1308 (build-system cmake-build-system)
1309 (arguments
1310 `(#:phases
1311 (modify-phases %standard-phases
1312 (replace 'check
1313 (lambda _
1314 (with-directory-excursion "tests"
1315 (invoke "ctest" ".")))))))
1316 (synopsis "Implementation of the olm and megolm cryptographic ratchets")
1317 (description "The libolm library implements the Double Ratchet
1318 cryptographic ratchet. It is written in C and C++11, and exposed as a C
1319 API.")
1320 (home-page "https://matrix.org/docs/projects/other/olm/")
1321 (license license:asl2.0)))
1322
1323 (define-public hash-extender
1324 (let ((commit "cb8aaee49f93e9c0d2f03eb3cafb429c9eed723d")
1325 (revision "2"))
1326 (package
1327 (name "hash-extender")
1328 (version (git-version "0.0" revision commit))
1329 (source (origin
1330 (method git-fetch)
1331 (uri (git-reference
1332 (url "https://github.com/iagox86/hash_extender")
1333 (commit commit)))
1334 (sha256
1335 (base32
1336 "1fj118566hr1wv03az2w0iqknazsqqkak0mvlcvwpgr6midjqi9b"))
1337 (file-name (git-file-name name version))))
1338 (build-system gnu-build-system)
1339 (arguments
1340 `(#:phases
1341 (modify-phases %standard-phases
1342 (delete 'configure)
1343 (replace 'check
1344 (lambda _
1345 (invoke "./hash_extender_test")))
1346 (replace 'install
1347 (lambda* (#:key outputs #:allow-other-keys)
1348 (let* ((outdir (assoc-ref outputs "out"))
1349 (bindir (string-append outdir "/bin"))
1350 (docdir (string-append outdir
1351 "/share/doc/hash-extender-"
1352 ,version)))
1353 (install-file "hash_extender" bindir)
1354 (install-file "README.md" docdir)
1355 #t))))))
1356 (inputs
1357 `(("openssl" ,openssl)))
1358 (synopsis "Tool for hash length extension attacks")
1359 (description "@command{hash_extender} is a utility for performing hash
1360 length extension attacks supporting MD4, MD5, RIPEMD-160, SHA-0, SHA-1,
1361 SHA-256, SHA-512, and WHIRLPOOL hashes.")
1362 (home-page "https://github.com/iagox86/hash_extender")
1363 (license license:bsd-3))))
1364
1365 (define-public mkp224o
1366 (package
1367 (name "mkp224o")
1368 (version "1.5.0")
1369 (source (origin
1370 (method git-fetch)
1371 (uri (git-reference
1372 (url "https://github.com/cathugger/mkp224o")
1373 (commit (string-append "v" version))))
1374 (sha256
1375 (base32
1376 "0b2cn96wg4l8jkkqqp8l2295xlmm2jc8nrw6rdqb5g0zkpfmrxbb"))
1377 (file-name (git-file-name name version))))
1378 (build-system gnu-build-system)
1379 (arguments
1380 `(#:tests? #f ; no test suite
1381 #:phases
1382 (modify-phases %standard-phases
1383 (replace 'install
1384 (lambda* (#:key outputs #:allow-other-keys)
1385 (let* ((outdir (assoc-ref outputs "out"))
1386 (bindir (string-append outdir "/bin")))
1387 (install-file "mkp224o" bindir)
1388 #t))))))
1389 (native-inputs
1390 `(("autoconf" ,autoconf)))
1391 (inputs
1392 `(("libsodium" ,libsodium)))
1393 (synopsis "Tor hidden service v3 name generator")
1394 (description "@code{mkp224o} generates valid ed25519 (hidden service
1395 version 3) onion addresses. It allows one to produce customized vanity .onion
1396 addresses using a brute-force method.")
1397 (home-page "https://github.com/cathugger/mkp224o")
1398 (license license:cc0)))
1399
1400 (define-public transcrypt
1401 (package
1402 (name "transcrypt")
1403 (version "2.1.0")
1404 (source
1405 (origin
1406 (method git-fetch)
1407 (uri (git-reference
1408 (url "https://github.com/elasticdog/transcrypt")
1409 (commit (string-append "v" version))))
1410 (sha256
1411 (base32 "0bpz1hazbhfb6pqi68x55kq6a31bgh6vwij836slmi4jqiwvnh5a"))
1412 (file-name (git-file-name name version))))
1413 (inputs
1414 `(("git" ,git)
1415 ("openssl" ,openssl)))
1416 (build-system copy-build-system)
1417 (arguments
1418 `(#:install-plan
1419 '(("transcrypt" "bin/transcrypt")
1420 ("man/transcrypt.1" "share/man/man1/transcrypt.1")
1421 ("contrib/bash/transcrypt"
1422 "share/bash-completion/completions/transcrypt")
1423 ("contrib/zsh/_transcrypt"
1424 "share/zsh/site-functions/_transcrypt"))))
1425 (home-page "https://github.com/elasticdog/transcrypt")
1426 (synopsis "Transparently encrypt files within a git repository")
1427 (description
1428 "Transcrypt is a script to configure transparent encryption of sensitive
1429 files stored in a Git repository. Files that you choose will be automatically
1430 encrypted when you commit them, and automatically decrypted when you check
1431 them out. The process will degrade gracefully, so even people without your
1432 encryption password can safely commit changes to the repository's
1433 non-encrypted files.")
1434 (license license:expat)))