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