{"id":20903318,"url":"https://github.com/AtropineTears/Lamport-rs","last_synced_at":"2025-05-13T04:33:13.528Z","repository":{"id":62441977,"uuid":"215433174","full_name":"AtropineTears/Lamport-rs","owner":"AtropineTears","description":"A Post-Quantum Cryptographic Library For Lamport Signatures","archived":false,"fork":false,"pushed_at":"2021-12-29T16:26:37.000Z","size":48,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-02-22T09:20:46.146Z","etag":null,"topics":["crate","crates","cryptography","cryptography-library","digital-signature","lamport","lamport-algorithm","lamport-signature","lamport-signature-scheme","leslie-lamport","post-quantum","post-quantum-cryptography","rust","rust-lang"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/leslie_lamport","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-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-16T01:52:49.000Z","updated_at":"2023-08-16T08:09:42.000Z","dependencies_parsed_at":"2022-11-01T21:53:54.952Z","dependency_job_id":null,"html_url":"https://github.com/AtropineTears/Lamport-rs","commit_stats":null,"previous_names":["0xatropine/leslie-lamport"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtropineTears%2FLamport-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtropineTears%2FLamport-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtropineTears%2FLamport-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtropineTears%2FLamport-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AtropineTears","download_url":"https://codeload.github.com/AtropineTears/Lamport-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225182544,"owners_count":17434114,"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":["crate","crates","cryptography","cryptography-library","digital-signature","lamport","lamport-algorithm","lamport-signature","lamport-signature-scheme","leslie-lamport","post-quantum","post-quantum-cryptography","rust","rust-lang"],"created_at":"2024-11-18T13:12:30.486Z","updated_at":"2024-11-18T13:12:33.804Z","avatar_url":"https://github.com/AtropineTears.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lamport-rs\n\n[![Crates.io](https://img.shields.io/crates/v/leslie_lamport?style=flat-square)](https://crates.io/crates/leslie_lamport)\n[![Build Status](https://travis-ci.org/0xAtropine/Leslie-Lamport.svg?branch=master)](https://travis-ci.org/0xAtropine/Leslie-Lamport)\n![Crates.io](https://img.shields.io/crates/l/leslie_lamport?style=flat-square)\n\nA Library For The Post-Quantum Digital Signature Scheme **Lamport Signatures** created by Leslie Lamport in 1979.\n\n## Read About Lamport Signatures\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 Generate Keys\n\nDefault Generation creates **1024 keypairs** that can sign up to **64 bytes** and has a **secret key size of 32 bytes**. These are the default parameters that simple generation has:\n\n* `n` = 64\n\n* `d` = 32 | `d` ∈ 32,48,64,128\n\nThe `hash` is chosen by the user.\n\n```rust\nuse leslie_lamport::{LamportKeyPair,LamportSignature,Algorithms};\n\nfn main(){\n    // Generate Keypair using Operating System SHA256\n    let keypair = LamportKeyPair::generate(Algorithms::OS_SHA256);\n    \n    // Generate Keypair using Operating System SHA512\n    let keypair_sha512 = LamportKeyPair::generate(Algorithms::OS_SHA512);\n    \n    // Generate Keypair using Rust Library For Blake2b\n    let keypair_blake2b = LamportKeyPair::generate(Algorithms::BLAKE2B);\n\n    // Generates Keypaur using Rust Library For Blake2b (64 bytes)\n    let keypair_blake2b_64 = LamportKeyPair::generate(Algorithms::BLAKE2B_64);\n}\n```\n\n## How To Sign\n\n```rust\nuse leslie_lamport::{LamportKeyPair,LamportSignature,Algorithms};\n\nfn main(){\n    // Generate Keypair\n    let keypair = LamportKeyPair::generate(Algorithms::OS_SHA256);\n    \n    // Generate Signature For 512 bit input\n    let sig = keypair.sign(\"b7dba1bc67c531bffb14fbd7f6948540dba10981765a0538575bed2b6bf553d43f35c287635ef7c4cb2c379f71218edaf70d5d73844910684103b99916e428c2\");\n\n    // Check If It Is Verified\n    let is_verified: bool = sig.verify();\n\n    // Print Verification\n    println!(\"Is Verified: {}\",is_verified)\n}\n```\n\n## Parameters\n\n### `hash`\n\n`hash` is the **hash function** you would like to use. There are four options:\n\n* OS_SHA256\n    * 32 bytes (256 bits)\n    * Uses Operating System through `crypto-hash` crate\n\n* OS_SHA512\n    * 64 bytes (512 bits)\n    * Uses Operating System through `crypto-hash` crate\n\n* BLAKE2B\n    * 32 bytes (256 bits)\n    * Uses Rust Library\n\n* BLAKE2B_64\n    * 64 bytes (512 bits)\n    * Uses Rust Library\n\n### `d`\n\n\u003e `d` ∈ 32,48,64,128 | The default is 32 bytes\n\n`d` is the **size of the secret key** in bytes. The secret key is generated using the `getrandom` crate which uses the operating system to generate randomness.\n\n### `n`\n\n\u003e Number of Keypairs: `(8*n)*2` | The default is 64 bytes\n\n`n` **represents the number of keypairs generated and the number of bytes you will be able to sign**.\n\n1024 keypairs will sign 512 bits.\n\n\n## `crypto-hash` crate\n\nThe [crypto-hash](https://github.com/malept/crypto-hash) crate uses the operating system to generate hashes. It does this through:\n\n* CryptoAPI (Windows)\n\n* CommonCrypto (OS X)\n\n* OpenSSL (Linux,BSD)\n\nIt depends on:\n\n* winapi\n\n* commoncrypto\n\n* openssl\n\n* hex\n\n## `getrandom` crate\n\nThe `getrandom` crate generates randomness using the operating system.\n\n## License\n\nLicensed under:\n\n* Apache License, Version 2.0\n\n* MIT License\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%2FLamport-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAtropineTears%2FLamport-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAtropineTears%2FLamport-rs/lists"}