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