10 ms·
Age: Modern file encryption format with multiple pluggable recipients
- deleted 4y ago[deleted]
- raziel2p 4y agoWhy not just link to the actual code repository? https://github.com/FiloSottile/age https://github.com/FiloSottile/age
- loup-vaillant 4y agoAs far as I am concerned, the specs convey more information in less time than the source code would have. Linking directly to them caused me to actually read them, and I'm actually glad I did. I already knew of Age, so if this was a link to the repository root instead I would have jumped straight to the comments section, and missed a couple genuinely interesting design choices about it.
- theK 4y ago> The textual file header wraps the file key for one or more recipients, so that it can be unwrapped by one of the corresponding identities Isn't that what LUKS does as well? What's the novelty in this one?
- Macha 4y agoMy impression is that the novelty is less about the encryption format and more about the tools and ecosystem being understandable to anyone that has used ssh before (and indeed, in the case of the reference implementation, even letting you use straight up ssh keys)
- fbdab103 4y agoIndeed, ease of use is almost more important than security. If the tooling is so hard to use correctly that everyone makes a mistake, users gain little. The interface to age seem so straightforward that as long as the crypto primitives are solid, this would do a lot for making encryption more accessible. Edit: correct an English gaff
- theK 4y agoSorry, I kinda missed that. The "multiple recipient" thing is quite prevalent in the titles (here and on github) so I thought this was supposed to be the key differentiator.
- waynesonfire 4y agoNice call out. I've seen age come up a few times on hackernews. It's trying so hard to dislodge gpg but I just can't see that happening for me. In order to replace gpg, it would have to be 10x better and that's quite a leap for an encryption tool that requires stability, compatibility. Overcoming the gpg learning curve is do-able. It's worth it. You'll thank yourself in 10 or 20 years when you need to decrypt a file. Get a Yubikey as well, or two.
- fbdab103 4y agoI am happy to change with the times and adopt modern tools. Something without all of the sharp edges that make encryption more difficult in practice. If nothing else, by being written in a memory safe language, age is unlikely to ever have a comparable list of CVEs[0] as GPG. A code execution vulnerability was discovered in GPG as recently as this year. Such vulnerabilities could of course still happen in age, but they are always going to be less common. [0]: https://www.cvedetails.com/vendor/4711/Gnupg.html https://www.cvedetails.com/vendor/4711/Gnupg.html
- loup-vaillant 4y agoAs the author of a non-negligible amount of peer reviewed cryptographic code, I happen to know a bit about how much safe languages help you. And the answer is, "less than you'd think". Modern cryptographic primitives benefit very little from safe languages like Rust, compared to using C and running the test suite under Valgrind and Clang sanitisers (all 3 of them). Undefined behaviour related errors are stupidly easy to test: no heap allocations, no input dependent branches or indices, pathologically straight-line code, all that makes it fairly easy to implement an extremely effective test suite that is almost impossible to circumvent… except for logic bugs. In fact, the only significant bug I've ever shipped to production was a logic bug Rust or Go wouldn't have saved me from. The real problems start when you start tackling encodings & textual formats. Those are definitely gnarlier, and I personally wouldn't trust myself with an ASN-1 decoder in C. This can be avoided by using simple binary formats instead, but since Age has decided to be a little more advanced using a safe language is definitely a plus.
- hamandcheese 4y agoI'm not sure there is any specific feature that is novel, nor do I think any claims as such were made. The novelty is packaging it all together with an easy to use, hard to misuse UX.
- FiloSottile 4y ago_o/ hi all, age author here! The OP link is the spec, here's a few other things you might find interesting - the Go reference implementation https://age-encryption.org https://age-encryption.org - the Go library docs https://pkg.go.dev/filippo.io/age https://pkg.go.dev/filippo.io/age - the CLI man page https://filippo.io/age/age.1 https://filippo.io/age/age.1 - the large reusable test suite (which I should write about!) https://c2sp.org/CCTV/age https://c2sp.org/CCTV/age - an interoperable Rust implementation by @str4d https://github.com/str4d/rage https://github.com/str4d/rage - a YubiKey plugin by @str4d https://github.com/str4d/age-plugin-yubikey https://github.com/str4d/age-plugin-yubikey - the draft plugin protocol specification (which we should really merge) https://github.com/C2SP/C2SP/pull/5/files?short_path=07bf8cc#diff-07bf8cc6707dbc77590da5e60a0e91a84362d6c7d5079af1fd7dbc2bb2cd2f14 https://github.com/C2SP/C2SP/pull/5/files?short_path=07bf8cc... - a Windows GUI by @spieglt https://github.com/spieglt/winage https://github.com/spieglt/winage - a discussion of the authentication properties of age https://words.filippo.io/dispatches/age-authentication/ https://words.filippo.io/dispatches/age-authentication/ - a discussion of a potential post-quantum plugin https://words.filippo.io/dispatches/post-quantum-age/ https://words.filippo.io/dispatches/post-quantum-age/ - a password-store fork that uses age instead of gpg https://github.com/FiloSottile/passage https://github.com/FiloSottile/passage (see also: how I use it with a YubiKey https://words.filippo.io/dispatches/passage/ https://words.filippo.io/dispatches/passage/) (Yes I should make a website to collate all this.) Happy to answer any questions!
- loup-vaillant 4y agoHi, something is bothering me here: https://github.com/C2SP/C2SP/blob/main/age.md#file-key https://github.com/C2SP/C2SP/blob/main/age.md#file-key > Each file is encrypted with a 128-bit symmetric file key. Did you meant 256 bits instead? Or is this a deliberate choice? As far as I can tell the body is encrypted with a 256-bit key derived from the file key, and using a 128-bit file key would limit the security of the whole scheme when using it with X25519 (its ~128 bits of collision resistance is better than the 128 bits of preimage resistance of the file key), or with extremely strong passwords. The only rationale for this choice I can think of is saving space, but your choice of a textual format with base64 encoded keys & nonces suggests you didn't care that much about space… I'm confused here, what did I miss?
- waynesonfire 4y agoi've seen this a few times now. to replace my usage of gpg, it would need to be 10x better. it just isn't.
- seized 4y agoSuch a profoundly helpful contribution.... How about detail on why it's not better than gpg?
- masklinn 4y agoUsually the complaint is that it doesn’t do the billion things gpg does. Which is exactly why I use age, the thing’s so simple there’s no way I can fuck it up, and I can plug in an ssh pubkey straight from github.
- seized 4y agoExactly. Gpg is famously straight forward to use (/s).
- loup-vaillant 4y agoIs it even possible to be "10 times better" than GPG? I mean as far as I know GPG works, and for someone who has developed a simple & safe workflow around it, it would be hard for something else to do significantly better than that. And I say that even though I'd rather write my own file encryption tool than spend even a minute learning how to use GPG.
- d-z-m 4y ago> and for someone who has developed a simple & safe workflow around it This is the kicker. Modern versions of GPG have sane defaults, but if I were a new developer who knew nothing about encryption, I would be very scared of GPG, it's aged documentation, and multitude of encryption and signing methods. Following the wrong stackoverflow answer, or an out-of-date blog post could easily get you a GPG configuration that is insecure in the year 2023. The same cannot be said for age, it has no knobs that you can dial to an insecure setting. If you'll forgive the expression, it is "idiot proof". Like you said though, GPG works, as long as you have that safe workflow.
- lazypenguin 4y agoI ran into this recently when using https://github.com/mozilla/sops https://github.com/mozilla/sops. It worked pretty nicely and as a tool was quite easy to get started with.
- speedgoose 4y agoSops is great. I hope they will find new maintainers. https://github.com/mozilla/sops/discussions/927 https://github.com/mozilla/sops/discussions/927
- andrewmcwatters 4y agoWhen I worked at a company called Smarsh, I wrote an encrypted file format for them for use in cloud agnostic storage utilizing envelope encryption. I read dozens of state of the art documents, various RFCs, and researched even proprietary formats for prior art references. We also used Go, which I consider the best possible language to use with respect to working on encryption. Kudos to Filippo Valsorda for his work on Go, and age. Hands down the best work in the space at the moment. It doesn't get better. I've done my homework. But in my opinion, this is still an unsolved problem. age simply makes a dent in an otherwise immature space, with simple questions: 1. What cyphertext, salt, iv structure layout should the encrypted payload follow? There are de facto binary structure layouts that prior art has established a practice for, but it does vary in order, and no papers talk about embedding specific details you need for the decryption process such as required lengths that otherwise need agreed upon static values. 2. What headers should be provided, if any, to provide mechanisms for versioning and reading encryption strategy? Should part of this metadata be in the file extension instead, such as `.aes256-gcm' and `.aes256-gcm.key'? To my surprise, despite the longevity of the industry, there was no simple file format that I could turn to that didn't involve being tightly coupled to email or a concept of a recipient. Unfortunately, age was: 1. Too young to consider for enterprise rollout. 2. Failed to differentiate itself from previous standards that were tightly coupled to email or recipients. 3. It fails to meet encryption standards that are more aligned with compliance than the state of the art. Regarding point 3, I appreciate its desire to stay small and utilize ChaCha20-Poly1305, but that's insufficient for deployments with specific requirements. I think someone needs to come out with an alternative to age that allows you to specify the cipher, and supported ciphers in the standard need to have specific binary layouts that can be agreed upon. I would personally prefer some metadata in the file extension, but I think this is naive, because re-encrypting a file would lose this information, or dumping binaries to pathnames with arbitrary file names would destroy this information, so it must be in a file header. The file header needs a specific magic number that can be read by utilities, and those utilities can further probe the file for metadata. age does some of these things, but it doesn't have answers for others. But gpg isn't a solution, either. Nor are numerous other encrypted payload formats for various reasons.
- FiloSottile 4y ago
- vbezhenar 4y agoThanks for age, this is my go-to tool for any encryption tasks I need. I'm using it to encrypt my secrets in repo, backups, it's incredibly convenient. I used to write openssl invocations with questionable security, but age makes me more confident.