proof-of-work-solver/README.md

106 lines
2.6 KiB
Markdown
Raw Permalink Normal View History

2024-10-15 18:12:17 +00:00
# Proof of Work Script
2024-10-18 00:43:50 +00:00
This repository contains scripts for implementing a Proof of Work (PoW) algorithm using the Argon2 hashing function. It is designed to solve a mining challenge based on given parameters, making it suitable for educational purposes or testing PoW implementations.
2024-10-15 18:12:17 +00:00
## Table of Contents
2024-10-18 15:04:00 +00:00
- [Features](#Features)
2024-10-18 00:47:50 +00:00
- [Requirements](#Requirements)
- [Installation](#Installation)
- [Usage](#Usage)
- [Examples](#Examples)
2024-10-15 18:12:17 +00:00
## Features
- Checks for required utilities (`argon2`, `xxd`, `bc`).
- Accepts a challenge code as input, either via command line or prompt.
- Iteratively generates and hashes candidate passwords until a valid solution is found.
- Displays the solution once it meets the required difficulty.
2024-10-18 00:43:50 +00:00
- **Python Salt Generator**: A Python script to generate random salt values and PoW challenge codes, with configurable parameters.
2024-10-15 18:12:17 +00:00
## Requirements
Ensure the following utilities are installed on your system:
- `argon2`: A secure hashing algorithm for password hashing.
- `xxd`: A tool for creating a hex dump from a binary file and vice versa.
- `bc`: An arbitrary precision calculator language.
2024-10-18 00:43:50 +00:00
## Installation
You can install the required utilities on Debian/Ubuntu-based systems using the following command:
2024-10-15 18:12:17 +00:00
```bash
sudo apt-get install argon2 xxd bc
2024-10-18 00:45:31 +00:00
```
2024-10-18 00:43:50 +00:00
If you're using a different Linux distribution, please consult your package manager's documentation.
## Usage
1. Clone the repository to your local machine:
2024-10-15 18:12:17 +00:00
```bash
2024-10-15 18:16:27 +00:00
git clone https://github.com/TiredFromTelehack/proof-of-work-solver.git
cd proof-of-work-solver
2024-10-18 00:45:31 +00:00
```
2024-10-18 00:43:50 +00:00
2. Make the script executable:
2024-10-15 18:12:17 +00:00
```bash
chmod +x proof_of_work.sh
2024-10-18 00:45:31 +00:00
```
2024-10-18 00:43:50 +00:00
3. Run the script with a challenge code:
2024-10-15 18:12:17 +00:00
```bash
./proof_of_work.sh "262144:1:SALTe7e590c2f902:1500"
2024-10-18 00:45:31 +00:00
```
2024-10-18 00:43:50 +00:00
1. Make sure you have Python installed (Python 3 is recommended).
2. Run the generator script to create a random Proof of Work challenge code:
```bash
python3 pow_generator.py
2024-10-18 00:45:31 +00:00
```
2024-10-18 00:43:50 +00:00
## Examples
Run the Bash script with a specific challenge code:
```bash
./proof_of_work.sh "262144:1:SALTe7e590c2f902:1500"
2024-10-18 00:45:31 +00:00
```
2024-10-18 00:43:50 +00:00
Output Example:
Estimated iterations: 1500
Time Cost: 1
2024-10-18 15:04:00 +00:00
Elapsed Time: 700 seconds.
2024-10-18 00:43:50 +00:00
SOLUTION FOUND
Your unblock code is: UNBLOCK-X7J2L9D5
This is the code you enter into the site to pass the challenge.
2024-10-18 15:04:00 +00:00
- **Python Salt Generator Example**:
2024-10-18 00:43:50 +00:00
Run the Python salt generator to create a random challenge code:
```bash
python3 pow_generator.py
2024-10-18 00:45:31 +00:00
```
2024-10-18 00:43:50 +00:00
Output Example:
2024-10-18 15:04:00 +00:00
Generated Proof of Work Code: 262144:1:SALTe7e590c2f902:1500
2024-10-18 00:43:50 +00:00
The generated code includes:
2024-10-18 15:04:00 +00:00
Memory Cost: Always Set To 262,144 bytes.
2024-10-18 00:43:50 +00:00
Time Cost: Always set to 1.
2024-10-18 15:04:00 +00:00
Salt: Randomized, prefixed with "SALT".
Difficulty: Always Set To 1500.
2024-10-18 00:43:50 +00:00