{"id":27202502,"url":"https://github.com/rozbb/strobe-rs","last_synced_at":"2025-04-09T22:00:14.146Z","repository":{"id":44934055,"uuid":"139078149","full_name":"rozbb/strobe-rs","owner":"rozbb","description":"A Rust implementation of the Strobe protocol framework","archived":false,"fork":false,"pushed_at":"2025-03-17T18:25:52.000Z","size":200,"stargazers_count":27,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T21:59:53.745Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rozbb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-28T23:30:45.000Z","updated_at":"2025-03-19T13:25:29.000Z","dependencies_parsed_at":"2024-06-21T14:23:38.564Z","dependency_job_id":"eeed26b6-bc6a-4874-89a8-fc701f9068f7","html_url":"https://github.com/rozbb/strobe-rs","commit_stats":{"total_commits":89,"total_committers":5,"mean_commits":17.8,"dds":0.4719101123595506,"last_synced_commit":"46905c3fbe6dc50d6546a7060778fa9ffc0834c8"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozbb%2Fstrobe-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozbb%2Fstrobe-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozbb%2Fstrobe-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozbb%2Fstrobe-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rozbb","download_url":"https://codeload.github.com/rozbb/strobe-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119311,"owners_count":21050754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-09T22:00:13.309Z","updated_at":"2025-04-09T22:00:14.098Z","avatar_url":"https://github.com/rozbb.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"strobe-rs\n=========\n\n[![CI](https://github.com/rozbb/strobe-rs/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/rozbb/strobe-rs/actions)\n[![Version](https://img.shields.io/crates/v/strobe-rs.svg)](https://crates.io/crates/strobe-rs)\n[![Docs](https://docs.rs/strobe-rs/badge.svg)](https://docs.rs/strobe-rs)\n\nThis is a pure Rust, `no_std` implementation of the [Strobe protocol framework](https://strobe.sourceforge.io/). The designer's description:\n\u003e Strobe is a new framework for cryptographic protocols. It can also be used for regular encryption. Its goals are to make cryptographic protocols much simpler to develop, deploy and analyze; and to fit into even tiny IoT devices. To that end, it uses only one block function — Keccak-f — to encrypt and authenticate messages.\n\nThis implementation currently only supports Keccak-f\\[1600\\] (the highest security level) as the internal permutation function.\n\nExample\n-------\n\nA simple [example](https://github.com/rozbb/strobe-rs/blob/master/examples/basic.rs) that does authenticated encryption and decryption:\n\n```rust\nuse strobe_rs::{SecParam, Strobe};\n\nuse rand::RngCore;\n\n// NOTE: This is just a simple authenticated encryption scheme. For a robust AEAD construction,\n// see the example at https://strobe.sourceforge.io/examples/aead/\n\nfn main() {\n    let mut rng = rand::thread_rng();\n\n    // Sender and receiver\n    let mut tx = Strobe::new(b\"correctnesstest\", SecParam::B256);\n    let mut rx = Strobe::new(b\"correctnesstest\", SecParam::B256);\n\n    // Key both sides with a predetermined key\n    let k = b\"the-combination-on-my-luggage\";\n    tx.key(k, false);\n    rx.key(k, false);\n\n    // Have the transmitter sample and send a nonce (192 bits) in the clear\n    let mut nonce = [0u8; 24];\n    rng.fill_bytes(\u0026mut nonce);\n    rx.recv_clr(\u0026nonce, false);\n    tx.send_clr(\u0026nonce, false);\n\n    // Have the transmitter send an authenticated ciphertext (with a 256 bit MAC)\n    let orig_msg = b\"groceries: kaymac, ajvar, cream, diced onion, red pepper, grilled meat\";\n    let mut msg_buf = *orig_msg;\n    tx.send_enc(\u0026mut msg_buf, false);\n    let mut mac = [0u8; 32];\n    tx.send_mac(\u0026mut mac, false);\n\n    // Rename for clarity. `msg_buf` has been encrypted in-place.\n    let mut ciphertext = msg_buf;\n\n    // Have the receiver receive the ciphertext and MAC\n    rx.recv_enc(ciphertext.as_mut_slice(), false);\n    let res = rx.recv_mac(\u0026mac);\n\n    // Check that the MAC verifies\n    assert!(res.is_ok());\n    // Check that the decrypted ciphertext equals the original plaintext\n    let round_trip_msg = ciphertext;\n    assert_eq!(\u0026round_trip_msg, orig_msg);\n}\n```\n\nFeatures\n--------\n\nDefault features flags: _none_\n\nFeature flag list:\n\n* `std` — Implements `std::error::Error` for `AuthError`.\n* `asm` — Enables optimized assembly for the Keccak permutation, if available. Assembly currently only exists for ARMv8.\n* `serialize_secret_state` — Implements `serde`'s `Serialize` and `Deserialize` traits for the `Strobe` struct. **SECURITY NOTE**: Serializing Strobe state outputs security sensitive data that MUST be kept private. Treat the data as you would a private encryption/decryption key.\n\nFor info on how to omit or include feature flags, see the [cargo docs on features](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#choosing-features).\n\nMSRV\n----\n\nThe current minimum supported Rust version (MSRV) is 1.60.0 (2022-04-04).\n\nTests\n-----\n\nTo run tests, execute\n```shell\ncargo test --features \"std\"\n```\n\nThis includes known-answer tests, which test against JSON-encoded test vectors in the [kat/](kat/) directory. To verify these test vectors against the reference Python implementation, `cd` into `kat/`, run `python2 verify_test_vector.py` and follow the included instructions.\n\nBenchmarks\n----------\n\nTo benchmark, run\n```shell\ncargo bench\n```\n\nThis will produce a summary with plots in `target/crieteron/report/index.html`. These won't be very interesting, since almost every function in STROBE has the same runtime.\n\nLicense\n-------\n\nLicensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))\n * MIT license ([LICENSE-MIT](LICENSE-MIT))\n\nat your option.\n\nWarning\n-------\n\nThis code has not been audited in any sense of the word. Use at your own discretion.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frozbb%2Fstrobe-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frozbb%2Fstrobe-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frozbb%2Fstrobe-rs/lists"}