gnu: Add perl-crypt-openssl-bignum.
[jackhill/guix/guix.git] / gnu / packages / crypto.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 David Thompson <davet@gnu.org>
3 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
5 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox>
6 ;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
14 ;;;
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 (define-module (gnu packages crypto)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages autotools)
26 #:use-module (gnu packages boost)
27 #:use-module (gnu packages gettext)
28 #:use-module (gnu packages pkg-config)
29 #:use-module (gnu packages libbsd)
30 #:use-module (gnu packages linux)
31 #:use-module (gnu packages nettle)
32 #:use-module (gnu packages password-utils)
33 #:use-module (gnu packages perl)
34 #:use-module (gnu packages readline)
35 #:use-module (gnu packages serialization)
36 #:use-module (gnu packages tls)
37 #:use-module ((guix licenses) #:prefix license:)
38 #:use-module (guix packages)
39 #:use-module (guix download)
40 #:use-module (guix build-system gnu))
41
42 (define-public libsodium
43 (package
44 (name "libsodium")
45 (version "1.0.10")
46 (source (origin
47 (method url-fetch)
48 (uri (list (string-append
49 "http://download.libsodium.org/libsodium/"
50 "releases/libsodium-" version ".tar.gz")
51 (string-append
52 "https://download.libsodium.org/libsodium/"
53 "releases/old/libsodium-" version ".tar.gz")))
54 (sha256
55 (base32
56 "1gn45g956lyz8l6iq187yc6l627vyivyp8qc5dkr6dnhdnlqddvi"))))
57 (build-system gnu-build-system)
58 (synopsis "Portable NaCl-based crypto library")
59 (description
60 "Sodium is a new easy-to-use high-speed software library for network
61 communication, encryption, decryption, signatures, etc.")
62 (license license:isc)
63 (home-page "http://libsodium.org")))
64
65 (define-public signify
66 (package
67 (name "signify")
68 (version "18")
69 (source (origin
70 (method url-fetch)
71 (uri (string-append "https://github.com/aperezdc/signify/"
72 "archive/v" version ".tar.gz"))
73 (file-name (string-append name "-" version ".tar.gz"))
74 (sha256
75 (base32
76 "00lbjiy0gv1b1fvrd6ni4qah96ah4qf6aig05vd2hji4vs00jgwg"))))
77 (build-system gnu-build-system)
78 ;; TODO Build with libwaive (described in README.md), to implement something
79 ;; like OpenBSD's pledge().
80 (arguments
81 `(#:tests? #f ; no test suite
82 #:make-flags
83 (list "CC=gcc"
84 (string-append "PREFIX=" (assoc-ref %outputs "out")))
85 #:phases
86 (modify-phases %standard-phases
87 (delete 'configure))))
88 (native-inputs
89 `(("pkg-config" ,pkg-config)))
90 (inputs
91 `(("libbsd" ,libbsd)))
92 (synopsis "Create and verify cryptographic signatures")
93 (description "The signify utility creates and verifies cryptographic
94 signatures using the elliptic curve Ed25519. This is a Linux port of the
95 OpenBSD tool of the same name.")
96 (home-page "https://github.com/aperezdc/signify")
97 ;; This package includes third-party code that was originally released under
98 ;; various non-copyleft licenses. See the source files for clarification.
99 (license (list license:bsd-3 license:bsd-4 license:expat license:isc
100 license:public-domain (license:non-copyleft
101 "file://base64.c"
102 "See base64.c in the distribution for
103 the license from IBM.")))))
104
105
106 (define-public opendht
107 (package
108 (name "opendht")
109 (version "0.6.1")
110 (source
111 (origin
112 (method url-fetch)
113 (uri
114 (string-append
115 "https://github.com/savoirfairelinux/" name
116 "/archive/" version ".tar.gz"))
117 (file-name (string-append name "-" version ".tar.gz"))
118 (modules '((guix build utils)))
119 (snippet
120 '(begin
121 (delete-file-recursively "src/argon2")
122 (substitute* "src/Makefile.am"
123 (("./argon2/libargon2.la") "")
124 (("SUBDIRS = argon2") ""))
125 (substitute* "src/crypto.cpp"
126 (("argon2/argon2.h") "argon2.h"))
127 (substitute* "configure.ac"
128 (("src/argon2/Makefile") ""))))
129 (sha256
130 (base32
131 "09yvkmbqbym3b5md4n96qc1s9sf2n8ji404hagih45rmsj49599x"))))
132 (build-system gnu-build-system)
133 (inputs
134 `(("gnutls" ,gnutls)
135 ("nettle" ,nettle)
136 ("msgpack" ,msgpack)
137 ("readline" ,readline)
138 ("argon2" ,argon2)))
139 (native-inputs
140 `(("autoconf" ,autoconf)
141 ("pkg-config" ,pkg-config)
142 ("automake" ,automake)
143 ("libtool" ,libtool)))
144 (arguments
145 `(#:configure-flags '("--disable-tools" "--disable-python")
146 #:phases (modify-phases %standard-phases
147 (add-before 'configure 'autoconf
148 (lambda _
149 (zero? (system* "autoreconf" "-vfi")))))))
150 (home-page "https://github.com/savoirfairelinux/opendht/")
151 (synopsis "Distributed Hash Table (DHT) library")
152 (description "OpenDHT is a Distributed Hash Table (DHT) library. It may
153 be used to manage peer-to-peer network connections as needed for real time
154 communication.")
155 (license license:gpl3)))
156
157 (define rlog
158 (package
159 (name "rlog")
160 (version "1.4")
161 (source
162 (origin
163 (method url-fetch)
164 (uri
165 (string-append "http://rlog.googlecode.com/files/rlog-"
166 version ".tar.gz"))
167 (sha256
168 (base32
169 "0y9zg0pd7vmnskwac1qdyzl282z7kb01nmn57lsg2mjdxgnywf59"))))
170 (build-system gnu-build-system)
171 (arguments
172 `(#:phases (modify-phases %standard-phases
173 (add-before 'configure 'patch-/bin/sh
174 (lambda _
175 (substitute* "docs/Makefile.in"
176 (("/bin/sh") "sh")))))))
177 (home-page "http://www.arg0.net/rlog")
178 (synopsis "Flexible message logging library for EncFS")
179 (description
180 "RLog provides message logging for EncFS. It is no longer maintained.")
181 (license license:lgpl2.1+)))
182
183 (define-public encfs
184 (package
185 (name "encfs")
186 (version "1.8.1")
187 (source
188 (origin
189 (method url-fetch)
190 (uri
191 (string-append "https://github.com/vgough/encfs/releases/download/v"
192 version "/encfs-" version ".tar.gz"))
193 (sha256
194 (base32
195 "1lfmcsk187qr6ahy8c8959p7jrk9d5rd9kcsx572850ca3zmf0la"))))
196 (build-system gnu-build-system)
197 (arguments
198 `(#:configure-flags '("--with-boost-serialization=boost_wserialization"
199 "--with-boost-filesystem=boost_filesystem")
200 #:phases (modify-phases %standard-phases
201 (add-before 'configure 'autoconf
202 (lambda _
203 (zero? (system* "autoreconf" "-vfi")))))))
204 (native-inputs
205 `(("autoconf" ,autoconf)
206 ("automake" ,automake)
207 ("gettext" ,gnu-gettext)
208 ("libtool" ,libtool)
209 ("perl" ,perl)
210 ("pkg-config" ,pkg-config)))
211 (inputs
212 `(("boost" ,boost)
213 ("fuse" ,fuse)
214 ("openssl" ,openssl)
215 ("rlog" ,rlog)))
216 (home-page "https://vgough.github.io/encfs")
217 (synopsis "Encrypted virtual file system")
218 (description
219 "EncFS creates a virtual encrypted file system in user-space. Each file
220 created under an EncFS mount point is stored as a separate encrypted file on
221 the underlying file system. Like most encrypted file systems, EncFS is meant
222 to provide security against off-line attacks, such as a drive falling into
223 the wrong hands.")
224 (license (list license:lgpl3+ ;encfs library
225 license:gpl3+)))) ;command-line tools