{"id":19513546,"url":"https://github.com/atropinetears/winternitz-ots","last_synced_at":"2026-03-27T02:46:15.025Z","repository":{"id":51214420,"uuid":"217642700","full_name":"AtropineTears/Winternitz-OTS","owner":"AtropineTears","description":"A Rust Library For The Post-Quantum Digital Signature Scheme Winternitz One-Time Signature using the hash function Blake2b.","archived":false,"fork":false,"pushed_at":"2021-11-30T17:11:30.000Z","size":51,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T10:07:30.726Z","etag":null,"topics":["blake2b","crypto","cryptography","digital-signature","hash","hashing","one-time-signatures","ots","post-quantum","post-quantum-cryptography","rust","rust-crate","rust-lang","rust-library","security","signatures","winternitz","winternitz-ots","wots"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AtropineTears.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}},"created_at":"2019-10-26T02:04:01.000Z","updated_at":"2025-03-15T10:26:27.000Z","dependencies_parsed_at":"2022-08-31T02:00:42.233Z","dependency_job_id":null,"html_url":"https://github.com/AtropineTears/Winternitz-OTS","commit_stats":null,"previous_names":["0xatropine/winternitz-ots"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtropineTears%2FWinternitz-OTS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtropineTears%2FWinternitz-OTS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtropineTears%2FWinternitz-OTS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtropineTears%2FWinternitz-OTS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AtropineTears","download_url":"https://codeload.github.com/AtropineTears/Winternitz-OTS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250937222,"owners_count":21510923,"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":["blake2b","crypto","cryptography","digital-signature","hash","hashing","one-time-signatures","ots","post-quantum","post-quantum-cryptography","rust","rust-crate","rust-lang","rust-library","security","signatures","winternitz","winternitz-ots","wots"],"created_at":"2024-11-10T23:30:47.531Z","updated_at":"2026-03-27T02:46:14.990Z","avatar_url":"https://github.com/AtropineTears.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Winternitz-OTS\n\n[![Crates.io](https://img.shields.io/crates/v/winternitz-ots)](https://crates.io/crates/winternitz-ots)\n[![Build Status](https://travis-ci.org/0xAtropine/Winternitz-OTS.svg?branch=master)](https://travis-ci.org/0xAtropine/Winternitz-OTS)\n![Crates.io](https://img.shields.io/crates/l/winternitz-ots)\n\nA Rust Library/Crate For Dealing With The Post-Quantum Digital Signature Scheme **Winternitz One-Time Signature (W-OTS)** using the hash function **Blake2b**.\n\n## Read About W-OTS\n\n* [Hash-Based Signatures Part I: One-Time Signatures (OTS)](https://cryptoservices.github.io/quantum/2015/12/04/one-time-signatures.html)\n\n* [Stackoverflow - Can someone explain very simplified how the Winternitz OTS/Lamport OTS works?](https://iota.stackexchange.com/questions/645/can-someone-explain-very-simplified-how-the-winternitz-ots-lamport-ots-works)\n\n## How To Use\n\n### Basic Usage\n\nThis will show you the basic usage of the library and how to generate a W-OTS Keypair and use it to sign a message digest, then verify the signature.\n\n```rust\nuse winternitz_ots::wots;\n\n// Generates a W-OTS Keypair using parameters using Winternitz Parameter of 16 and Blake2B\nlet keypair = wots::generate_wots();\n\n// Have A Hexadecimal String You Would Like To Sign\nlet hex_digest = String::from(\"F7EE6090BA42BDDAB5899E8E25525922C3279D8563EEF37A597F13BCADA73DF7\");\n\n// Sign up to a 256bit (32 byte) hexadecimal digest using your W-OTS Keypair and a String\nlet signature = keypair.sign(hex_digest);\n\n// Return a Boolean To Check Whether The Signature Is Valid\nlet verification: bool = signature.verify();\n\n```\n\n### Access Keypair Attributes\n\n```rust\nuse winternitz_ots::wots;\n\n// Generates a W-OTS Keypair using parameters using Winternitz Parameter of 16 and Blake2B\nlet keypair = wots::generate_wots();\n\n// Sign Message\nlet sig = keypair.sign(message);\n\n// Get From Keypair\nlet public_key: Vec\u003cString\u003e = keypair.pk;\nlet private_key: Vec\u003cString\u003e = keypair.sk;\n\n// Get From Signature\nlet public_key = sig.pk;\nlet signatures = sig.signature;\nlet input: String = sig.input;\n```\n\n### More In-Depth Usage\n\n```rust\nextern crate winternitz_ots;\nuse winternitz_ots::wots;\n\nfn main() {\n    // Have A Hexadecimal String You Would Like To Sign\n    let hex_string: String = String::from(\"ECC4C3134F80E54C08BAAE1A3F3BDC07BB3AD3906FF62D0D3DFC1EE87AE83194\");\n\n    // Generate W-OTS Keypair | Get The Hash Of The Public Key (For An Address For Example) using a digest from 1-64\n    let keypair = wots::generate_wots();\n    let public_key_hash = keypair.hash_public_key(8);\n\n    // Export Public Key or Private Key; You may also wish to export metadata\n    let pk = keypair.export_pk();\n    let sk = keypair.export_sk();\n    let (w, n) = keypair.export_metadata();\n\n    // Use The Generate W-OTS Keypair\n    let signature = keypair.sign(hex_string);\n\n    // Check Whether The Signature Is Valid\n    let is_signature_valid: bool = signature.verify();\n\n    // Signature Attributes\n        // A Vector of The Input Into Its Corresponding Value From 0-15 (for w=16)\n    let input = \u0026signature.input;\n    let is_pk_hash_real = signature.verify_public_key_hash(public_key_hash.clone());\n\n    println!();\n    println!(\"PK[0]: {}\",pk[0]);\n    println!(\"PK[63]: {}\",pk[63]);\n    println!(\"SK[0]: {}\",sk[0]);\n    println!(\"SK[63]: {}\",sk[63]);\n    println!();\n    println!(\"Public Key Address: 0x{}\",public_key_hash);\n    println!(\"Hash: Blake2b\");\n    println!(\"w: {}\",w);\n    println!(\"n: {}\",n);\n    println!();\n    println!(\"Input: {}\",input);\n    println!();\n    println!(\"Is Signature Valid: {}\",is_signature_valid);\n    println!(\"Is Public Key Address Valid For Given Public Key: {}\",is_pk_hash_real);\n    println!();\n}\n```\n\n## To-Do\n\n1. Add more tests / examples\n2. Refactor Code A Lot and Reduce Memory Footprint\n3. Attempt To Make Code Secure Against Side-Channel Attacks and Test For Security Vulnerabilties\n4. Complete Benchmarks\n\n---\n\nA Winternitz-OTS+ (WOTS+) version in Rust is also currently in the works.\n\n## License\n\nLicensed under either of\n\n* Apache License, Version 2.0\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatropinetears%2Fwinternitz-ots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatropinetears%2Fwinternitz-ots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatropinetears%2Fwinternitz-ots/lists"}