{"id":15370227,"url":"https://github.com/jedisct1/rust-minisign","last_synced_at":"2025-04-08T12:08:58.149Z","repository":{"id":34803418,"uuid":"183760134","full_name":"jedisct1/rust-minisign","owner":"jedisct1","description":"A pure Rust implementation of the Minisign signature tool.","archived":false,"fork":false,"pushed_at":"2025-01-09T14:11:23.000Z","size":386,"stargazers_count":93,"open_issues_count":0,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-01T11:02:21.020Z","etag":null,"topics":["cryptography","ed25519","minisign","rust","signatures"],"latest_commit_sha":null,"homepage":"","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/jedisct1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-04-27T10:42:02.000Z","updated_at":"2025-01-09T14:11:27.000Z","dependencies_parsed_at":"2023-12-17T22:23:12.545Z","dependency_job_id":"817bd4f7-0f6b-4bec-9d90-b47da8c4b0eb","html_url":"https://github.com/jedisct1/rust-minisign","commit_stats":{"total_commits":223,"total_committers":10,"mean_commits":22.3,"dds":"0.22421524663677128","last_synced_commit":"bf2683435f4a516ccbd7e7bbb17d83f50a0122ae"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedisct1%2Frust-minisign","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedisct1%2Frust-minisign/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedisct1%2Frust-minisign/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedisct1%2Frust-minisign/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jedisct1","download_url":"https://codeload.github.com/jedisct1/rust-minisign/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247838444,"owners_count":21004580,"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":["cryptography","ed25519","minisign","rust","signatures"],"created_at":"2024-10-01T13:40:30.620Z","updated_at":"2025-04-08T12:08:58.118Z","avatar_url":"https://github.com/jedisct1.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"![CI status](https://github.com/jedisct1/rust-minisign/workflows/Rust/badge.svg)\n[![Last version](https://img.shields.io/crates/v/minisign.svg)](https://crates.io/crates/minisign)\n[![Documentation](https://docs.rs/minisign/badge.svg)](https://docs.rs/minisign)\n\n# rust-minisign\n\nA pure Rust implementation of the [Minisign](https://jedisct1.github.io/minisign/) signature system.\n\nThis is a crate, designed to be used within by applications.\n\nFor a command-line tool reimplementing the Minisign utility in Rust, and based on this crate, check out [rsign2](https://github.com/jedisct1/rsign2).\n\nFor a minimal crate that to only verify signatures, check out [minisign-verify](https://github.com/jedisct1/rust-minisign-verify).\n\n## API documentation\n\n[API documentation on docs.rs](https://docs.rs/minisign)\n\n## Example\n\n```rust\nfn main() {\n    extern crate minisign;\n    use minisign::{KeyPair, PublicKeyBox, SecretKeyBox, SignatureBox};\n    use std::io::Cursor;\n\n    // Generate and return a new key pair\n    // The key is encrypted using a password.\n    // If `None` is given, the password will be asked for interactively.\n    let KeyPair { pk, sk } =\n        KeyPair::generate_encrypted_keypair(Some(\"key password\".to_string())).unwrap();\n\n    // In order to be stored to disk, keys have to be converted to \"boxes\".\n    // A box is just a container, with some metadata about its content.\n    // Boxes can be converted to/from strings, making them convenient to use for storage.\n    let pk_box_str = pk.to_box().unwrap().to_string();\n    let sk_box_str = sk\n        .to_box(None) // Optional comment about the key\n        .unwrap()\n        .to_string();\n\n    // `pk_box_str` and `sk_box_str` can now be saved to disk.\n    // This is a long-term key pair, that can be used to sign as many files as needed.\n    // For conveniency, the `KeyPair::generate_and_write_encrypted_keypair()` function\n    // is available: it generates a new key pair, and saves it to disk (or any `Writer`)\n    // before returning it.\n\n    // Assuming that `sk_box_str` is something we previously saved and just reloaded,\n    // it can be converted back to a secret key box:\n    let sk_box = SecretKeyBox::from_string(\u0026sk_box_str).unwrap();\n\n    // and the box can be opened using the password to reveal the original secret key:\n    let sk = sk_box\n        .into_secret_key(Some(\"key password\".to_string()))\n        .unwrap();\n\n    // Now, we can use the secret key to sign anything.\n    let data = b\"lorem ipsum\";\n    let data_reader = Cursor::new(data);\n    let signature_box = minisign::sign(None, \u0026sk, data_reader, None, None).unwrap();\n\n    // We have a signature! Let's inspect it a little bit.\n    println!(\n        \"Untrusted comment: [{}]\",\n        signature_box.untrusted_comment().unwrap()\n    );\n    println!(\n        \"Trusted comment: [{}]\",\n        signature_box.trusted_comment().unwrap()\n    );\n\n    // Converting the signature box to a string in order to save it is easy.\n    let signature_box_str = signature_box.into_string();\n\n    // Now, let's verify the signature.\n    // Assuming we just loaded it into `signature_box_str`, get the box back.\n    let signature_box = SignatureBox::from_string(\u0026signature_box_str).unwrap();\n\n    // Load the public key from the string.\n    let pk_box = PublicKeyBox::from_string(\u0026pk_box_str).unwrap();\n    let pk = pk_box.into_public_key().unwrap();\n\n    // And verify the data.\n    let data_reader = Cursor::new(data);\n    let verified = minisign::verify(\u0026pk, \u0026signature_box, data_reader, true, false, false);\n    match verified {\n        Ok(()) =\u003e println!(\"Success!\"),\n        Err(_) =\u003e println!(\"Verification failed\"),\n    };\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedisct1%2Frust-minisign","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjedisct1%2Frust-minisign","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedisct1%2Frust-minisign/lists"}