From 6c6c4a05267e93597bb009c7d6c36383b6af7bf7 Mon Sep 17 00:00:00 2001 From: ishaan Date: Tue, 14 Jul 2026 19:26:55 +0530 Subject: ssh --- internal/crypt/headers.go | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'internal/crypt/headers.go') diff --git a/internal/crypt/headers.go b/internal/crypt/headers.go index b5addb2..8f9dac2 100644 --- a/internal/crypt/headers.go +++ b/internal/crypt/headers.go @@ -18,15 +18,24 @@ const ( ) type FileHeaders struct { - Salt [16]byte - Nonce [12]byte - Type DataType - Auth AuthMode - Parts int + Salt [16]byte + Nonce [12]byte + Type DataType + Auth AuthMode // "Pass" or "SSH" + Parts int + Recipients []WrappedKey // TODO: Version (string) for the version of .eno file. } +type WrappedKey struct { + PKType string // "ssh-ed25519" + PubKeyBytes []byte + EphemeralPub []byte // of X25519, for ECDH on decrypt (also can replace salt) + Nonce [12]byte // for decrypting EncNoteKey + EncNoteKey []byte // encrypted note key (ciphertext + 16B tag) +} + func GetFileHeaders(b []byte) (FileHeaders, error) { dec := gob.NewDecoder(bytes.NewReader(b)) var headers FileHeaders -- cgit v1.3