-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New, simpler cryptographic scheme #73
Comments
Here's a toy implementation in Haskell (creation, attenuation, verification for extensible and sealed tokens): https://gist.github.com/divarvel/73d17e92e72e0a00b8666d971e27c060 For the token size, a back-of-the-envelope calculation of (a lower bound) the overhead (the size added to the payload) of this scheme gives For a sealed token, it would be 64 bytes (the final signature) + 96 bytes per block |
additional note: the new format might not integrate the root key in the token, and instead have a key id field, letting the verifier side decide which key to use. |
Here's a proposition for the new wrapper format (eg where block contents are opaque bytestrings). There are a few design differences compared to the current one:
syntax = "proto2";
package biscuit.format.schema;
message Biscuit {
optional uint32 rootKeyId = 1;
required SignedBlock authority = 2;
repeated SignedBlock blocks = 3;
required Proof proof = 4;
}
message SignedBlock {
required bytes block = 1;
required bytes nextKey = 2;
required bytes signature = 3;
}
message Proof {
oneof Content {
bytes nextSecret = 1;
bytes finalSignature = 2;
}
} For the block payloads, the existing format can be used (with the |
@Geal What is this functionality for exactly? See this explanation for why this is a bad idea. SPKI made the same mistake with its 'do not delegate' bit. I highly recommend dropping |
@zarutian sealed tokens were introduced first as a way to exchange an attenuable token for a short term non attenuable one, because the signatures were still costly to verify. So it is not strictly necessary anymore. |
closing this because v2 has shipped |
The current design based on aggregated signatures is working fine, but is too complex to implement, and hard to audit properly in every implementation.
We should move to a new scheme that can still guarantee Biscuit's basic properties:
Proposal
The idea of this scheme is that each block has a corresponding keypair signing it, and the signature covers the public key of the next block. The token ships with the secret key of the next block. Holding that token, it is then possible to sign the next block (and generate the next keypair). We can seal a token (forbid attenuation) by using the last secret key to sign the entire token, and replace the last secret key with that signature.
That scheme can be done with simple building blocks (cryptographic hash and public key crypto, like Ed25519) and will be much easier to implement and audit than aggregated signatures.
TODO: benchmarks, measure token size, audit scheme
cc @divarvel
The text was updated successfully, but these errors were encountered: