https://github.com/lubux/key-derivation-tree
https://github.com/lubux/key-derivation-tree
cryptography key-generation prf
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lubux/key-derivation-tree
- Owner: lubux
- License: apache-2.0
- Created: 2020-06-15T13:24:02.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-17T11:23:37.000Z (almost 6 years ago)
- Last Synced: 2025-06-20T03:44:50.915Z (12 months ago)
- Topics: cryptography, key-generation, prf
- Language: Rust
- Size: 25.4 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Key Derivation Tree
[](https://travis-ci.org/lubux/key-derivation-tree)
Rust implementation of the key derivation tree used in TimeCrypt([Link](https://www.usenix.org/conference/nsdi20/presentation/burkhalter)).
## Build
```
cargo build
```
## Usage
Initialize the Key Derivation Tree with the master secret `key` and 32 bit inputs.
```rust
let key = [0u8; 16];
let prf = ConstrainedPrf::init(32, key);
```
Derive the i-th key.
```rust
let key_out = prf.apply(i).unwrap();
```
Give access to the keys in the range `[1,15)`.
```rust
let node_keys = prf.constrain(1, 15).unwrap();
```
Initialize the Key Derivation Tree with the constrained nodes.
```rust
let prf2 = ConstrainedPrf::new(32, node_keys);
// derive key ok
let key_out = prf.apply(2).unwrap();
// derive key error
let key_out = prf.apply(0).unwrap();
```
## Benchmark
```
cargo bench
```
## Disclaimer
This is a research prototype.