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