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