Replies: 1 comment 2 replies
-
"S2 (Integrity) "S3 (Sender identity verification)" "S4 (Receiver identity verification)" "question is basically" "but neither integrity" |
Beta Was this translation helpful? Give feedback.
-
"S2 (Integrity) "S3 (Sender identity verification)" "S4 (Receiver identity verification)" "question is basically" "but neither integrity" |
Beta Was this translation helpful? Give feedback.
-
Hi there,
I'm a happy age user, encrypting backups and other sensitive files with passphrases. I'd like to start a discussion about the following use case, hoping it would be a fruitful one: Alice sends an asymmetrically encrypted file to Bob.
The use case and its required security
Let's consider a common use case where Alice (
A
) wants to send a file (M
as in Message) to Bob (B
) with the following security guarantees:M
is confidential against third parties (“secret”, i.e., cannot be read).M
is integrity-protected against third parties (“authenticated”, i.e., cannot be modified).B
can verify for himself that the receivedM
was sent byA
(but does not need to prove this to third parties).A
can verify for herself thatM
is being sent indeed toB
(but does not need to prove this to third parties).So,
B
generates an age key pair specifically for the purpose of receiving this one file fromA
, and sends his public keyPK
toA
by some means.A
encryptsM
withPK
, sendsM
toB
, thenB
decryptsM
with his secret keySK
.How age helps achieving the security guarantees above
S1 (Confidentiality)
✔️ This is achieved, as long as
B
is the only one knowing theSK
whosePK
was used for encryptingM
: age cryptographically guarantees that onlyB
can readM
.S2 (Integrity)
✔️ (❌ not by age itself) This is achieved as well, as long as
A
andB
are the only ones knowingPK
that was used for encryptingM
: age cryptographically guarantees, that the file was not modified (replaced), as the input key material used to deriving the file's encryption key includesPK
(see a question about the “why?” on this below).S3 (Sender identity verification)
✔️ (❌ not by age itself) This is where it gets shaky. As age is an encryption tool, not an authentication tool, so this isn't even included in its security target, but this is achieved the same way as S2.
S4 (Receiver identity verification)
✔️ (not by age itself ❌) By itself, age does not help with this (but why should it?). Thus, when acquiring
PK
,A
needs to make sure on its own thatPK
indeed belongs toB
. But sinceA
needs to acquirePK
in a secret, integrity-protected, and identity-verified way fromB
whatsoever, she can make sure during this procedure about the identity ofB
.Wait, isn't keeping
PK
secret basically the same as Bob forwarding a secret key to Alice?So, to summarize,
PK
needs to be kept secret by both parties, and it should be acquired byA
in a secret (i.e., confidential, i.e., encrypted) AND integrity-protected AND identity-verified (i.e.,A
knows that she acquires the key fromB
) way even for achieving S2 (which then infers S3). But this also infers S4, sinceA
acquiresPK
in an identity-verified way.So, my question is basically this: what is the exact public-key use case, in which age gives its users more than requiring them to exchange a secret, integrity-protected, identity-verified value?
In my understanding, age, without keeping
PK
secret (and integrity-protected after acquiring it in an identity-verified way), fundamentally can only provide confidentiality, but neither integrity nor identity verification. For the latter guaranteesA
andB
need some kind of signing (but this introduces the exact same problem (among other problems) of how wouldA
verify that she received thePK
for encryption indeed belongs toB
= how wouldB
verify thePK
thatM
is signed by indeed belongs toA
? – but these can be solved, if the keys can be public). Or they just need to exchangePK
in a secret, tamper-resistant, and identity-verified way, which is basically the same of exchanging a shared secret, i.e., symmetric key / passphrase .The public key needs to be public and private at the same time
PK
needs to be public, so it is publicly verifiableIf
PK
is public and publicly verifiable (e.g., published on a website, facebook, etc.), then S4 can be easily fulfilled. But even if it's not public, it needs to get to the sender (A
in the example above) in an integrity-protected and identity-verified way, so they can check not to send secrets to a random person.PK
needs to be secret, so adversaries shouldn't be able to produce an age file that will decrypt with a given identityIf
PK
is secret, then adversaries cannot produce a forged age file, since the input key material of the HKDF producing the file key includesPK
. A sentence from the already referenced article: “For example, if you upload backups to cloud storage, simply make sure you don't upload the recipient string along with them.”PK
necessarily needs to get outside of one's hands in anA
toB
scenario (i.e.,PK
ofB
gets toA
), so it is not a secret any more (or it must be an integrity-protected encrypted secret for age's properties to hold, which essentially could be just a symmetric key).But if
PK
is an integrity-protected, identity-verified secret, it could just be a shared secret keySharing a secret, symmetric key between the sender and the recipient would immediately check all S1-S4. The precautions for
PK
are exactly the same as they would be for this secret, symmetric key, if the goal is checking all S1-S4. Therefore, I cannot really see what more age actually gives to its users in a public-key setting than the requirement of sharingPK
as a secret value in an integrity-protected and identity-verified way, which easily could be a symmetric key providing equivalent (if not stronger) security guarantees.Any thoughts on this, @FiloSottile? Don't get me wrong, I am a big fan of the project, and I'm really happy that you introduced a solution to the past-century file encryption mess of gpg. But in lack of a comprehensive security target, I cannot answer these questions myself. I honestly hope this will be a fruitful and informative debate!
(Feedback on age-authkey-plugin: I could be happy with the flag + encrypt-side plugin, but I would really like to see a comprehensive security target before taking these next steps.)
Beta Was this translation helpful? Give feedback.
All reactions