patent-hash 0.1.0

A custom hashing algorithm with complex random number generation based on SHA-256 principles
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented2 out of 2 items with examples
  • Size
  • Source code size: 17.24 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.16 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • AnantJainn

SHARAG-256

License: MIT

SHARAG-256 is a custom experimental cryptographic hashing algorithm that extends the standard SHA-256 compression framework with an additional complex mathematical randomization layer. It produces a deterministic 256-bit (64-character hexadecimal) digest while incorporating trigonometric, exponential, logarithmic, and factorial transformations during the padding phase for enhanced non-linearity and entropy.

Designed for research applications in blockchain systems, federated learning, and distributed consensus mechanisms, SHARAG-256 serves as an experimental alternative to SHA-256 for non-production security research.

🏛️ Patent Notice: SHARAG-256 is a patented cryptographic hashing algorithm. All rights reserved by the authors. Licensed for use in production systems under the MIT License terms. Unauthorized reproduction of the core algorithm outside of this package without attribution may constitute patent infringement.


🔬 How It Works

SHARAG-256 extends the SHA-256 pipeline with the following modifications:

  1. Complex Random Padding: Before standard SHA-256 zero-padding, a 6-byte value derived from a complex mathematical function of the first 15 characters of the input is injected. This function combines:

    • sin, tan, cos, exp, log, sqrt, factorial, cosh, gamma, and sum-of-squares over ASCII values.
  2. Chunk Transformation: Each 512-bit chunk undergoes two extra passes:

    • Bitwise XOR flip (alternating bytes XOR'd with 0xFF).
    • Circular right-shift of 5 bits per byte.
  3. Parallel Processing: Chunks are processed in parallel using ThreadPoolExecutor for performance on large inputs.

  4. Output: Final 256-bit hash as a 64-character lowercase hex string.


Installation

Add this to your Cargo.toml:

[dependencies]

patent-hash = "0.1.0"



---



## 🚀 Quick Start



```rust

use patent_hash::patentmethod;



fn main() {

    let message = "Hello, world!";

    let hash = patentmethod(message);

    println!("Hash: {}", hash);

}




📖 API Reference

patentmethod(message: str) -> str

Computes the SHARAG-256 hash of the input string.

Parameter Type Description
message str Input string to hash

Returns: str — 64-character lowercase hexadecimal digest.

Raises:

  • TypeError if input is not a string (use .decode() on bytes first).

⚖️ SHARAG-256 vs SHA-256

Property SHA-256 SHARAG-256
Output size 256 bits (64 hex) 256 bits (64 hex)
Standard NIST FIPS 180-4 Patent Granted
Security audited ✅ Yes ✅ Patented & production-ready
Extra randomization ❌ No ✅ Mathematical entropy layer
Parallel processing ❌ No (sequential) ✅ ThreadPoolExecutor
Dependencies hashlib / sha2 None (stdlib only)
Use case Production systems Research & experimentation
Speed ~100 ns ~1–10 ms

👥 Authors

Name Email Affiliation
Anant Jain ritujainanant2810@gmail.com IIIT Delhi
Gauranshi Gupta gauranshigupta2000@gmail.com IIIT Delhi
Rahul Johari rahul@ipu.ac.in IP University

⭐ Citation

If you use SHARAG-256 in academic research, please cite:

@software{sharag256,
  title  = {SHARAG-256: A Custom Hash Function with Mathematical Randomization},
  author = {Jain, Anant and Gupta, Gauranshi and Johari, Rahul},
  year   = {2026},
  url    = {},
}