Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

这是一个非常典型的 “机器码-授权码”(License/Activation)系统 场景。这类项目既要有技术深度,又要非常注重安全免责声明(避免被误用为恶意锁机软件)。

我为你撰写了一份结构完整、风格专业的双语友好型英文为主、带中文注释逻辑的 README,涵盖了后端 C++ 核心、前端 Vue 客服平台以及整体工作流。

# DevGuard-License

A lightweight, open-source **Software License / Machine Code Generator** system.

It uses the **Blowfish** cipher to bind license validity to a specific machine and date, helping indie developers protect their desktop software from unauthorized distribution.

💡 *A complete full-stack solution: C++ Core SDK + Vue.js Admin Panel.*

---

## 📌 What is this?

Many indie developers struggle with software piracy. **DevGuard-License** provides a minimalist offline activation flow:

1. **User Side (C++ SDK)**: Your software collects the user's hardware fingerprint (Machine Code) and current date, then encrypts them via Blowfish and sends the cipher text to you.

2. **Admin Side (Vue.js)**: Your support team pastes the cipher text into a web panel, decrypts it (using the developer's master password), reviews the machine info, and generates a **Software License Key**.

3. **Activation**: The user inputs the License Key into your app, which verifies it locally to unlock full features.

No complex online DRM, no internet connection required after activation.

---

## ✨ Core Features

- 🔐 **Blowfish Encryption**: Lightweight and fast symmetric encryption to protect machine code transmission.

- 🖥️ **Hardware Binding**: Extracts disk serial / CPU ID / BIOS UUID to generate a unique Machine Code.

- 📅 **Time-Limited / Permanent**: Developers can issue trial licenses (bound to dates) or permanent licenses.

- 🔑 **Developer-Only Key**: The Blowfish password/key is held strictly by the developer; the client cannot forge a license.

- 🎛️ **Vue.js Admin Panel**: A clean dashboard for customer service to decrypt requests and generate codes with one click.

- 📦 **Easy Integration**: Drop the License class into your C++ project to instantly add an activation mechanism.

---

## 🏗️ Architecture Overview

text

┌─────────────────────┐ Cipher Text ┌────────────────────────┐

│ Client Software │ ────────────────────> │ Customer Service │

│ (C++ / Qt / MFC) │ │ Platform (Vue 3) │

│ - Collect HW Info │ <──────────────────── │ - Decrypt Machine ID │

│ - Blowfish Encrypt │ License Key │ - Generate Soft-Code │

└─────────────────────┘ └────────────────────────┘

│ │

▼ ▼

Local SQLite / File Node.js / Python Backend

(Optional: store activation log) (Or pure frontend crypto JS)

---

## 🛠️ Tech Stack

| Module | Technology |

| :--- | :--- |

| Client Core | C++17, OpenSSL / Crypto++, Blowfish-CBC |

| Client Collector | Cross-platform system APIs (WMI/Linux sysfs) |

| Admin Frontend | Vue 3, Vite, Element Plus, Web Crypto API |

| Communication | HTTP / Email / Manual copy-paste (Air-gapped friendly) |

| Database | SQLite (optional, for logging issued licenses) |

---

## 🚀 Quick Integration Guide

### 1. Client Side (C++)

Generate and encrypt a machine code:

cpp

include "devguard/License.h"

DevGuard::License guard;

// 1. Get hardware fingerprint

std::string machineId = guard.getMachineFingerprint();

// 2. Add date info

std::string plainText = machineId + "|" + guard.getCurrentDate();

// 3. Encrypt with developer's secret password

std::string devPassword = "YourSuperSecretKey123";

std::string cipherText = guard.blowfishEncrypt(plainText, devPassword);

// Send cipherText to customer service...

std::cout << "Please send this to support: " << cipherText << std::endl;

### 2. Server / Admin Side (Vue.js)

客服人员在后台的操作流程:

1. 打开 http://localhost:5173 (Vue 面板)。

2. 输入开发者主密码(Blowfish Key)。

3. 粘贴用户发来的加密字符串,点击 **Decrypt**。

4. 系统显示:Machine: xxxx-xxxx | Date: 2026-07-25

5. 设置有效期(如 2026-12-31),点击 **Generate License**。

6. 生成类似 VGhpcyBpcyBhIHZhbGlkIGxpY2Vuc2U=(Base64编码的授权凭证)返回给用户。

### 3. Verify Locally

cpp

bool isActivated = guard.verifyLicense("user_license_file.lic", devPassword);

if(isActivated) {

runPremiumFeatures();

} else {

showBuyNowScreen();

}

---

## 🗃️ Data Format Example

Encrypted payload sent by user (Base64):

BLOWFISH$VTJGc2RHVmtYMThPVko5d... (truncated)

Decrypted content structure:

json

{

"mid": "DISK-AB12CD-CPU-XYZ",

"req_date": "2026-07-25",

"checksum": "a1b2c3d4"

}

Generated License structure:

text

[LICENSE]

ALGO=BLOWFISH

EXP=2026-12-31

SIGN=xxxxxxxxxxxxxxxx

---

## 📂 Project Structure

text

DevGuard-License/

├── core-cpp/ # C++ static lib to collect HW & handle crypto

│ ├── include/

│ ├── src/

│ └── examples/

├── admin-panel-vue/ # Vue 3 project for customer service

│ ├── src/views/

│ └── package.json

├── docs/

│ └── protocol.md # Communication protocol between client & server

├── LICENSE

└── README.md

---

## 🔒 Security & Ethical Notice

1. **Client-Side Trust**: Like all software protection, machine code collection can be bypassed by advanced users (reverse engineering). This tool is meant as a **friction raiser**, not an unbreakable DRM.

2. **Password Responsibility**: The Blowfish key is the root of trust. If leaked, others can generate licenses at will. Use a strong password and consider rotating it for major versions.

3. **Privacy**: Only collect minimal hardware identifiers. Do not collect user files or browsing data.

4. **Open Source Compliance**: When integrating this into commercial software, ensure you comply with the licenses of the underlying crypto libraries (e.g., OpenSSL).

⚠️ **Disclaimer**: This project is provided for legitimate software copyright protection only. Do not use it to create ransomware, illegal lock-screen malware, or malicious trojans. The author bears no responsibility for misuse.

---

## 🛣️ Roadmap

- [ ] Add RSA + Blowfish hybrid encryption (prevent key extraction via reverse engineering)

- [ ] Blacklist/Whitelist management in Vue Admin

- [ ] Auto-expiration reminder in C++ client

- [ ] Provide pre-built binaries for Windows/macOS/Linux

---

## 🤝 Contributing

Pull Requests and Issues are welcome! If you have suggestions for improving the encryption protocol or UI/UX, feel free to start a discussion.

## 📄 License

Licensed under the **MIT License**.

---

*Made with ❤️ for indie developers who deserve to get paid for their hard work.*

💡 针对你这个特定场景的进阶建议

这个 README 已经把业务逻辑讲清楚了,但作为开发者,你可能还需要考虑以下几个技术细节,我可以继续帮你细化:

1. 防破解加固建议:

• 单纯用 Blowfish 且密钥写在 C++ 代码里,容易被逆向提取。通常做法是:C++端只做加密传输,不做解密校验;或者采用非对称加密(RSA/ECC)签发授权,Blowfish仅作传输混淆。

• 可以在 Vue 端加入时间偏移校验,防止用户通过修改系统日期绕过试用期。

2. Vue 端的实现方式:

• 如果不想写后端,可以直接用 JavaScript 的 crypto-js 库在前端做 Blowfish 解密,这样客服只需打开网页即可工作,数据不经过服务器(完全 Air-gapped,更安全)。

要不要我接着帮你:

1. 写出 C++ 端获取机器码(Windows/Linux 硬盘序列号) 的核心代码片段?

2. 或者帮你写一个 Vue 3 + CryptoJS 的简易 Blowfish 解密/生成器页面 的代码骨架?

About

DevGuard-License - A lightweight, open-source \*\*Software License / Machine Code Generator\*\* system.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages