https://github.com/copyleftdev/n2hash

https://github.com/copyleftdev/n2hash

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.9%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: copyleftdev
  • License: mit
  • Language: Rust
  • Default Branch: master
  • Size: 0 Bytes
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.md

n2hash

License: MIT

A Rust implementation of NTLM and NetNTLMv2 hashing for password security analysis and authentication testing.

Overview

n2hash provides efficient and secure implementations of NTLM and NetNTLMv2 hashing algorithms used in Windows authentication systems. This library allows security researchers, penetration testers, and system administrators to work with these authentication protocols for legitimate security testing and analysis.

Features

  • NTLM Hash Generation: Fast computation of NTLM hashes (MD4 of UTF-16LE encoded passwords)
  • NetNTLMv2 Hash Generation: Complete implementation of the NTLMv2 challenge-response protocol
  • Pure Rust Implementation: Fully implemented in Rust with minimal dependencies
  • RFC Compliant: Follows MS-NLMP protocol specifications
  • Custom HMAC-MD5: Includes an efficient custom implementation of HMAC-MD5 based on RFC 2104

Installation

Using Makefile

The project includes a Makefile that simplifies installation:

```bash

Build the project

make build

Install to user's local bin (~/.local/bin)

make install

Install system-wide (requires sudo)

make install-system

Uninstall from local bin

make uninstall

Uninstall from system-wide location

make uninstall-system ```

Manual Installation

```bash

Build the project

cargo build --release

The binary will be available at

target/release/n2hash

```

Usage

The tool provides two main functions:

  • NTLM Hash: Generate an NTLM hash from a password
  • NetNTLMv2 Hash: Generate a NetNTLMv2 hash with username, domain, and password

Basic command syntax:

n2hash ntlm <password> n2hash netntlmv2 <username> <domain> <password>

Cryptographic Details

NTLM Hash

The NTLM hash is calculated as the MD4 hash of the UTF-16LE encoded password.

NetNTLMv2 Hash

NetNTLMv2 involves: 1. NTLM hash of password 2. NTLMv2 key generation using HMAC-MD5 3. Blob structure with version, timestamp, and challenge data 4. NTProofStr calculation using HMAC-MD5

The output format is: username::domain:server_challenge:nt_proof_string:blob

Security Considerations

This tool is intended for legitimate security testing, password migration, and educational purposes only. Always ensure you have proper authorization before using in any environment.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Copyleft 2025 copyleftdev

Owner

  • Name: Donald Johnson
  • Login: copyleftdev
  • Kind: user
  • Location: Los Angeles

GitHub Events

Total
  • Release event: 1
  • Watch event: 1
  • Push event: 7
  • Create event: 5
Last Year
  • Release event: 1
  • Watch event: 1
  • Push event: 7
  • Create event: 5

Dependencies

.github/workflows/ci.yml actions
  • actions/cache v4 composite
  • actions/checkout v4 composite
  • actions/download-artifact v4 composite
  • actions/upload-artifact v4 composite
  • dtolnay/rust-toolchain stable composite
  • softprops/action-gh-release v1 composite
Cargo.lock cargo
  • 107 dependencies
Cargo.toml cargo
  • hex-literal 0.3 development
  • proptest 1.0 development
  • chrono 0.4
  • clap 4.5
  • colored 3.0.0
  • digest 0.8.1
  • hex 0.4
  • md4 0.10
  • md5 0.7.0
  • rand 0.8.5
  • rpassword 7.3
  • thiserror 2.0.12