Age encryption

  • Done
  • quality assurance status badge
Details
2 participants
  • Tobias Geerinckx-Rice
  • Nicolas Graves
Owner
unassigned
Submitted by
Nicolas Graves
Severity
normal
N
N
Nicolas Graves wrote on 6 Oct 2022 19:05
(address . guix-patches@gnu.org)
87czb4naqr.fsf@ngraves.fr
Hi guix!

Here's a few patches to package the encryption tool age.
I'm probably going to send some other derived tools (passage notably).

--
Best regards,
Nicolas Graves
N
N
Nicolas Graves wrote on 6 Oct 2022 19:09
[PATCH 1/2] gnu: Add go-filippo-io-edwards25519.
(address . 58340@debbugs.gnu.org)(address . ngraves@ngraves.fr)
20221006170908.24921-1-ngraves@ngraves.fr
* gnu/packages/golang.scm (go-filippo-io-edwards25519): New variable.
---
gnu/packages/golang.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

Toggle diff (36 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 4a4c706509..e8132eb138 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -926,6 +926,29 @@ (define-public go-std-1.17 (make-go-std go-1.17))
(define-public go-std-1.18 (make-go-std go-1.18))
(define-public go-std-1.19 (make-go-std go-1.19))
+(define-public go-filippo-io-edwards25519
+ (package
+ (name "go-filippo-io-edwards25519")
+ (version "1.0.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/FiloSottile/edwards25519")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "01m8hpaj0cwp250f7b0din09cf8j6j5y631grx67qfhvfrmwr1zr"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "filippo.io/edwards25519"))
+ (home-page "https://filippo.io/edwards25519")
+ (synopsis "Group logic for the twisted Edwards curve")
+ (description
+ "This package implements the edwards25519 elliptic curve in Go, exposing
+the necessary APIs to build a wide array of higher-level primitives.")
+ (license license:bsd-3)))
+
(define-public go-0xacab-org-leap-shapeshifter
(let ((commit "0aa6226582efb8e563540ec1d3c5cfcd19200474")
(revision "12"))
--
2.37.3
N
N
Nicolas Graves wrote on 6 Oct 2022 19:09
[PATCH 2/2] gnu: Add age and its modules.
(address . 58340@debbugs.gnu.org)(address . ngraves@ngraves.fr)
20221006170908.24921-2-ngraves@ngraves.fr
* gnu/packages/golang.scm
(age): New variable.
(go-filippo-io-cmd-age): New variable.
(go-filippo-io-cmd-age-keygen): New variable.
---
gnu/packages/golang.scm | 50 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)

Toggle diff (70 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index e8132eb138..7559e3ef9d 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -35,6 +35,7 @@
;;; Copyright © 2021 Lu Hui <luhux76@gmail.com>
;;; Copyright © 2022 Pier-Hugues Pellerin <phpellerin@gmail.com>
;;; Copyright © 2022 muradm <mail@muradm.net>
+;;; Copyright © 2022 Nicolas Graves <ngraves@ngraves.fr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -949,6 +950,55 @@ (define-public go-filippo-io-edwards25519
the necessary APIs to build a wide array of higher-level primitives.")
(license license:bsd-3)))
+(define-public age
+ (package
+ (name "age")
+ (version "1.0.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/FiloSottile/age")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "19fz68n262kvg2ssw4r6nik30zk6g6cy7rdi0fm05czwigqrdz1i"))))
+ (build-system go-build-system)
+ (arguments `(#:import-path "filippo.io/age"))
+ (propagated-inputs
+ (list go-filippo-io-cmd-age
+ go-filippo-io-cmd-age-keygen))
+ (home-page "https://filippo.io/age")
+ (synopsis "Secure file encryption tool, format, and Go library")
+ (description
+ "This package implements file encryption according to the
+@code{age-encryption.org/v1} specification. It features small explicit keys,
+no config options, and UNIX-style composability.")
+ (license license:bsd-3)))
+
+(define-public go-filippo-io-cmd-age
+ (package
+ (inherit age)
+ (name "go-filippo-io-cmd-age")
+ (propagated-inputs
+ (list go-golang-org-x-sys
+ go-golang-org-x-term
+ go-golang-org-x-crypto
+ go-filippo-io-edwards25519))
+ (arguments
+ `(#:import-path "filippo.io/age/cmd/age"
+ #:unpack-path "filippo.io/age"
+ #:install-source? #f))))
+
+(define-public go-filippo-io-cmd-age-keygen
+ (package
+ (inherit go-filippo-io-cmd-age)
+ (name "go-filippo-io-cmd-age-keygen")
+ (arguments
+ `(#:import-path "filippo.io/age/cmd/age-keygen"
+ #:unpack-path "filippo.io/age"
+ #:install-source? #f))))
+
(define-public go-0xacab-org-leap-shapeshifter
(let ((commit "0aa6226582efb8e563540ec1d3c5cfcd19200474")
(revision "12"))
--
2.37.3
N
N
Nicolas Graves wrote on 13 Oct 2022 23:09
[PATCH v2 1/2] gnu: Add go-filippo-io-edwards25519.
(address . 58340@debbugs.gnu.org)(address . ngraves@ngraves.fr)
20221013210945.22345-1-ngraves@ngraves.fr
* gnu/packages/golang.scm (go-filippo-io-edwards25519): New variable.
---
gnu/packages/golang.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

Toggle diff (36 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 53d1e38c28..f404adc646 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -927,6 +927,29 @@ (define-public go-std-1.17 (make-go-std go-1.17))
(define-public go-std-1.18 (make-go-std go-1.18))
(define-public go-std-1.19 (make-go-std go-1.19))
+(define-public go-filippo-io-edwards25519
+ (package
+ (name "go-filippo-io-edwards25519")
+ (version "1.0.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/FiloSottile/edwards25519")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "01m8hpaj0cwp250f7b0din09cf8j6j5y631grx67qfhvfrmwr1zr"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "filippo.io/edwards25519"))
+ (home-page "https://filippo.io/edwards25519")
+ (synopsis "Group logic for the twisted Edwards curve")
+ (description
+ "This package implements the edwards25519 elliptic curve in Go, exposing
+the necessary APIs to build a wide array of higher-level primitives.")
+ (license license:bsd-3)))
+
(define-public go-0xacab-org-leap-shapeshifter
(let ((commit "0aa6226582efb8e563540ec1d3c5cfcd19200474")
(revision "12"))
--
2.38.0
N
N
Nicolas Graves wrote on 13 Oct 2022 23:10
[PATCH v2] gnu: Add age and its modules.
(address . 58340@debbugs.gnu.org)(address . ngraves@ngraves.fr)
20221013211031.22485-1-ngraves@ngraves.fr
* gnu/packages/golang.scm
(age): New variable.
(go-filippo-io-cmd-age): New variable.
(go-filippo-io-cmd-age-keygen): New variable.
---
gnu/packages/golang.scm | 51 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)

Toggle diff (71 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index f404adc646..b9ac942702 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -36,6 +36,7 @@
;;; Copyright © 2022 Pier-Hugues Pellerin <phpellerin@gmail.com>
;;; Copyright © 2022 muradm <mail@muradm.net>
;;; Copyright © 2022 Dhruvin Gandhi <contact@dhruvin.dev>
+;;; Copyright © 2022 Nicolas Graves <ngraves@ngraves.fr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -950,6 +951,56 @@ (define-public go-filippo-io-edwards25519
the necessary APIs to build a wide array of higher-level primitives.")
(license license:bsd-3)))
+(define-public age
+ (package
+ (name "age")
+ (version "1.0.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/FiloSottile/age")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "19fz68n262kvg2ssw4r6nik30zk6g6cy7rdi0fm05czwigqrdz1i"))))
+ (build-system go-build-system)
+ (arguments `(#:import-path "filippo.io/age"))
+ (inputs
+ (list go-golang-org-x-sys
+ go-golang-org-x-term
+ go-golang-org-x-crypto
+ go-filippo-io-edwards25519))
+ (propagated-inputs
+ (list go-filippo-io-cmd-age
+ go-filippo-io-cmd-age-keygen))
+ (home-page "https://filippo.io/age")
+ (synopsis "Secure file encryption tool, format, and Go library")
+ (description
+ "This package implements file encryption according to the
+@code{age-encryption.org/v1} specification. It features small explicit keys,
+no config options, and UNIX-style composability.")
+ (license license:bsd-3)))
+
+(define-public go-filippo-io-cmd-age
+ (package
+ (inherit age)
+ (name "go-filippo-io-cmd-age")
+ (propagated-inputs '())
+ (arguments
+ `(#:import-path "filippo.io/age/cmd/age"
+ #:unpack-path "filippo.io/age"
+ #:install-source? #f))))
+
+(define-public go-filippo-io-cmd-age-keygen
+ (package
+ (inherit go-filippo-io-cmd-age)
+ (name "go-filippo-io-cmd-age-keygen")
+ (arguments
+ `(#:import-path "filippo.io/age/cmd/age-keygen"
+ #:unpack-path "filippo.io/age"
+ #:install-source? #f))))
+
(define-public go-0xacab-org-leap-shapeshifter
(let ((commit "0aa6226582efb8e563540ec1d3c5cfcd19200474")
(revision "12"))
--
2.38.0
T
T
Tobias Geerinckx-Rice wrote on 19 Oct 2022 19:17
Re: [PATCH v2] gnu: Add passage.
(name . Nicolas Graves)(address . ngraves@ngraves.fr)
87h6zzbo14.fsf@nckx
Hi Nicolas,

Nicolas Graves ???
Toggle quote (2 lines)
> Just as a reminder, this patch cannot be merged before 58340.

Thanks, I realised that after I sent it. I'll treat (and close)
them as one bug for this reply.

I've pushed all 3 patches as
ac553ba68e535810085dd838e48e4fa6ac553e67 et al with the following
mods:

Toggle quote (2 lines)
> * gnu/packages/password-utils.scm (passage): New variable.

I fixed up the commit message to match the name, and addressed the
following ‘guix lint’ warnings:

pass-age@1.7.4a0: no article allowed at the beginning of the
synopsis
age@1.0.0: sentences in description should be followed by two
spaces

Whilst there, I turned @code{age-encryption.org/v1} into a full
@url{}, and fixed up upstream's ‘config’ & ‘UNIX’ slang.

Toggle quote (4 lines)
> * gnu/packages/golang.scm
> (age): New variable.
> (go-filippo-io-cmd-age): New variable.
> (go-filippo-io-cmd-age-keygen): New variable.
^^
Our changelogs are never indented, you'd write:

Toggle quote (3 lines)
> * gnu/packages/golang.scm (age, go-filippo-io-cmd-age)
> (go-filippo-io-cmd-age-keygen): New variables.

…but in this case, I was bold and removed the two
go-filippo-io-cmd-age* packages completely. I moved ‘age’ to (gnu
packages password-utils).

The partial recursion in the go-* variants made me nervous (and
would probably prevent the move, although I didn't try).

If these variants are needed for something, it's not pass-age, and
we can review them separately if/when needed. Is that acceptable?

Toggle quote (2 lines)
> I would think that choices need to be made

Princip(al)ly: the choice to reuse an existing package name was
FiloSottile's, for the sake of a pun. Much as I like bad puns, I
think that's rather rude. It's not hard to search for free
package names, e.g., [0].

Toggle quote (2 lines)
> that this one would not annoy a lot.

Technically: it would silently replace users' games with some
encryption tool. That's problematic even if those users are few.

Similarly: had the game been added after this ‘passage’, I would
have grumpily agreed to ‘passage-game’ :-) But it wasn't.

But: I think your ’pass-age’ solution is perfect. Thanks!
FiloSottile should consider it.

Kind regards,

T G-R

-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCY1BSmA0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15nmwBANI3HDA0LNGiEzTFUO4nCPwBs+IW2XvsiDGlibAJ
G+0kAQDI2WXajUt59q3kymG7iEs+7UOHMym3NbnZitv/1cR1DA==
=G6Wa
-----END PGP SIGNATURE-----

Closed
T
T
Tobias Geerinckx-Rice wrote on 19 Oct 2022 21:49
Re: bug#58386: [PATCH v2] gnu: Add passage.
87czanbneo.fsf@nckx
Tobias Geerinckx-Rice via Guix-patches via ???
Toggle quote (3 lines)
> …but in this case, I was bold and removed the two
> go-filippo-io-cmd-age* packages completely.

Grr. And of course, whilst migrating pass-age's propagated-inputs
to regular ones (propagation is evil and should be avoided
whenever possible), I see I've been looking at the wrong ‘age’.

Y'know. The one that does have a ‘/bin/age’ in it.

Yep, I'm back,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCY1BVvw0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15SdABAK/9DT1xg38KheRGXhDYYt6TwwFSmSP5WxWSZB2h
H1dnAP4lsXJDgGqiGU16aYPnrfMH5uQu18RAae1eZZcuUfw7Dg==
=n+xB
-----END PGP SIGNATURE-----

Closed
N
N
Nicolas Graves wrote on 22 Oct 2022 09:51
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
87wn8s70ux.fsf@ngraves.fr
Hey Tobias,

Toggle quote (2 lines)
> Y'know. The one that does have a ‘/bin/age’ in it.

In the current version, it seems that the age-keygen binary is not in
the bin output. Both commands "age" and "age-keygen" are necessary,
hence the way I tried to package that with propagated inputs.

Thanks for your reviews, let me know if I can help.

--
Best regards,
Nicolas Graves
?
Your comment

This issue is archived.

To comment on this conversation send an email to 58340@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 58340
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch