@@ -66,6 +66,7 @@ Jagged supports streaming encryption and decryption using standard recipient typ
66
66
- [ X25519] ( https://github.com/C2SP/C2SP/blob/main/age.md#the-x25519-recipient-type ) recipients and identities
67
67
- [ scrypt] ( https://github.com/C2SP/C2SP/blob/main/age.md#the-scrypt-recipient-type ) recipients and identities
68
68
- [ ssh-rsa] ( https://github.com/FiloSottile/age/blob/main/README.md#ssh-keys ) recipients and identities
69
+ - [ ssh-ed25519] ( https://github.com/FiloSottile/age/blob/main/README.md#ssh-keys ) recipients and identities
69
70
70
71
# Specifications
71
72
@@ -120,6 +121,21 @@ a File Key.
120
121
121
122
The scrypt type encrypts a File Key with ChaCha20-Poly1305.
122
123
124
+ The ssh-ed25519 and ssh-rsa types support reading private key pairs formatted using OpenSSH Private Key Version 1.
125
+
126
+ - [ OpenSSH PROTOCOL.key] ( https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key )
127
+
128
+ The ssh-ed25519 type uses Curve25519 for Elliptic Curve Diffie-Hellman shared secret key exchanges based on computing
129
+ equivalent values from keys described in the Edwards-curve Digital Signature Algorithm edwards25519.
130
+
131
+ - [ RFC 8032] ( https://www.rfc-editor.org/rfc/rfc8032 ) Edwards-Curve Digital Signature Algorithm
132
+
133
+ The ssh-ed25519 type reads SSH public keys encoded according to the SSH protocol.
134
+
135
+ - [ RFC 8709] ( https://www.rfc-editor.org/rfc/rfc8709 ) Ed25519 and Ed448 Public Key Algorithms for the Secure Shell (SSH) Protocol
136
+
137
+ The ssh-ed25519 type encrypts a File Key with ChaCha20-Poly1305.
138
+
123
139
The ssh-rsa type encrypts a File Key with RSA-OAEP.
124
140
125
141
- [ RFC 8017] ( https://www.rfc-editor.org/rfc/rfc8017 ) PKCS #1 : RSA Cryptography Specifications Version 2.2
@@ -239,11 +255,25 @@ The `jagged-ssh` module supports encryption and decryption using public and priv
239
255
implementation is compatible with the [ agessh] ( https://pkg.go.dev/filippo.io/age/agessh ) package, which defines
240
256
recipient stanzas with an algorithm and an encoded fingerprint of the public key.
241
257
258
+ The ` SshEd25519RecipientStanzaReaderFactory ` creates instances of ` RecipientStanzaReader ` using an
259
+ [ OpenSSH Version 1 Private Key] ( https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key ) .
260
+
261
+ The ` SshEd25519RecipientStanzaWriterFactory ` creates instances of ` RecipientStanzaWriter ` using an SSH Ed25519 public
262
+ key encoded according to [ RFC 8709 Section 4] ( https://www.rfc-editor.org/rfc/rfc8709#name-public-key-format ) .
263
+
242
264
The ` SshRsaRecipientStanzaReaderFactory ` creates instances of ` RecipientStanzaReader ` using an RSA private key or an
243
265
[ OpenSSH Version 1 Private Key] ( https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key ) .
244
266
245
267
The ` SshRsaRecipientStanzaWriterFactory ` creates instances of ` RecipientStanzaWriter ` using an RSA public key.
246
268
269
+ The SSH Ed25519 implementation uses Elliptic Curve Diffie-Hellman with Curve25519 as defined in
270
+ [ RFC 7748 Section 6.1] ( https://www.rfc-editor.org/rfc/rfc7748.html#section-6.1 ) . As integrated in the age reference
271
+ implementation, the SSH Ed25519 implementation converts the public key coordinate from the twisted Edwards curve to the
272
+ corresponding coordinate on the Montgomery curve according to the birational maps described in
273
+ [ RFC 7748 Section 4.1] ( https://www.rfc-editor.org/rfc/rfc7748#section-4.1 ) . The implementation converts the Ed25519
274
+ private key seed to the corresponding X25519 private key using the first 32 bytes of an ` SHA-512 ` hash of the seed.
275
+ The SSH Ed25519 implementation uses ChaCha20-Poly1305 for encrypting and decrypting File Keys.
276
+
247
277
The SSH RSA implementation uses Optimal Asymmetric Encryption Padding as defined in
248
278
[ RFC 8017 Section 7.1] ( https://www.rfc-editor.org/rfc/rfc8017#section-7.1 ) . Following the age implementation, RSA OAEP
249
279
cipher operations use ` SHA-256 ` as the hash algorithm with the mask generation function.
0 commit comments