Search

Lib.rs

› Science | Data structures | Cryptography › Magic Beans
#key-derivation #attributes #selection #kdf

attrkey

Pure Rust implementation of a Selection-Sensitive Attribute-Based Key Derivation Scheme

Owned by jacobhaap, 0x44-labs.

  • Install
  • API reference
  • GitHub repo (0x44-labs)

1 unstable release

Uses new Rust 2024

new 0.1.0-alpha.1 Apr 30, 2026

#22 in #selection

MIT license

33KB
582 lines

Attrkey (Selection-Sensitive Attribute-Based Keys)

Crates.io Version Crates.io License docs.rs

Pure Rust implementation of a Selection-Sensitive Attribute-Based Key Derivation Scheme.

Documentation

About

This crate provides a novel scheme where cryptographic keys are derived from a collection of attributes, with sensitivity to selection within the collection. A collection of attributes is first hardened using memory-hard key derivation, then organised into a keyspace from which attribute-based keys can be selected. A keyspace consists of:

  • A collection of hardened attribute values derived through parallel Argon2id key derivation with per-attribute salts.
  • A proof-of-work constraint parameter for annihilative pair generation.

Derived keys depend on both selected and remaining attributes of the keyspace equally. Different selections produce cryptographically independent keys, even when there is overlap in selection. An attacker with knowledge of attribute selection cannot optimise by discarding remaining attributes.

Minimum Supported Rust Version

Rust 1.85.1 or higher.

License

Licensed under the MIT License.

Dependencies

~4–5.5MB
~112K SLoC

  • annihilation
  • argon2
  • digest
  • hmac
  • rand_chacha 0.10
  • rand_core 0.10
  • rayon
  • zeroize
  • dev sha2
See also: hkdf, kbkdf, scrypt, bcrypt-pbkdf, ansi-x963-kdf, yescrypt, converge-provider-api, qatsi, toolkit-zero, kdf, secret-tree

A thriving market for magic beans doesn't make the magic beanstalk real. Cryptocurrencies are often involved in pump and dump scams, ponzi schemes, investment fraud, unregulated gambling, and large-scale money laundering. Many applications of cryptocurrencies are questionable. Their real effects are proliferation of ransomware and other criminal activity. PoW-based schemes contribute to e-waste and climate-affecting energy waste.

Lib.rs is an unofficial list of Rust/Cargo crates. This site is not affiliated with nor endorsed by the Rust Project or authors of this crate.