﻿<!--
  本文档编码：UTF-8
  生成工具：DeepSeek V4 Pro
  生成日期：2026年7月6日
  许可协议：MIT License
-->

> 🧠 **本项目代码由 DeepSeek V4 Pro 辅助开发**  
> 📅 生成日期：**2026年7月6日**

---

# 🔐 文件传输 | 檔案傳輸 | File Transfer

> 以下为该项目的说明文档，依次为简体中文、繁體中文、English。  
> 以下為該專案的說明文件，依次為簡體中文、繁體中文、English。  
> The following is the documentation for this project, in Simplified Chinese, Traditional Chinese, and English.

---

## 简体中文（Simplified Chinese）

### 简介

基于 WebRTC P2P 的端到端加密浏览器文件传输工具。信令走服务器，数据直连不经过服务器。

> 🌐 [https://file2file.net](https://file2file.net)

### ✨ 特性

| 特性            | 说明                                                    |
|-----------------|---------------------------------------------------------|
| 🔐 端到端加密   | 文件在浏览器本地加密，密钥不上传服务器                   |
| 🔗 P2P 直连     | WebRTC DataChannel，数据不走服务器中转                   |
| 🔄 密钥轮换     | 每轮传输结束后自动更新密钥，前向安全                      |
| 🧩 分片传输     | 64KB 流式分片，内存友好                                   |
| 📱 零安装       | 纯网页，手机电脑都能用                                   |
| 🌐 多语言       | 简体中文、繁體中文、English                               |
| 🌓 亮暗主题     | 跟随系统或手动切换                                       |
| 📋 一键分享     | 生成房间二维码 + 可复制邀请链接                          |

### 🚀 本地运行

```bash
npm install
npm start
# 浏览器打开 http://localhost:8080
```

### 📖 使用方式

1. 打开网页，输入四位房间号（或留空自动生成）
2. 将二维码或链接发给对方
3. 双方进入同一房间后，选择文件即可互传

### ⚠️ 免责声明

- 本项目仅供**合法、正当**的文件传输用途
- **严禁**用于传输任何违反法律法规的内容
- 使用者须对**自行传输的文件内容**承担全部法律责任
- 本项目开发者及代码生成工具**不承担**因使用者行为导致的任何责任
- 在线服务**不保证**持续可用

---

## 繁體中文（Traditional Chinese）

### 簡介

基於 WebRTC P2P 的端到端加密瀏覽器檔案傳輸工具。信令走伺服器，資料直連不經過伺服器。

> 🌐 [https://file2file.net](https://file2file.net)

### ✨ 特性

| 特性            | 說明                                                    |
|-----------------|---------------------------------------------------------|
| 🔐 端到端加密   | 檔案在瀏覽器本機加密，密鑰不上傳伺服器                   |
| 🔗 P2P 直連     | WebRTC DataChannel，資料不走伺服器中轉                   |
| 🔄 密鑰輪換     | 每輪傳輸結束後自動更新密鑰，前向安全                      |
| 🧩 分片傳輸     | 64KB 串流分片，記憶體友善                                 |
| 📱 零安裝       | 純網頁，手機電腦都能用                                   |
| 🌐 多語言       | 簡體中文、繁體中文、English                               |
| 🌓 亮暗主題     | 跟隨系統或手動切換                                       |
| 📋 一鍵分享     | 產生房間 QR 碼 + 可複製邀請連結                           |

### 🚀 本機執行

```bash
npm install
npm start
# 瀏覽器開啟 http://localhost:8080
```

### 📖 使用方式

1. 開啟網頁，輸入四位房間號（或留空自動產生）
2. 將 QR 碼或連結發給對方
3. 雙方進入同一房間後，選擇檔案即可互傳

### ⚠️ 免責聲明

- 本專案僅供**合法、正當**的檔案傳輸用途
- **嚴禁**用於傳輸任何違反法律法規的內容
- 使用者須對**自行傳輸的檔案內容**承擔全部法律責任
- 本專案開發者及程式碼產生工具**不承擔**因使用者行為導致的任何責任
- 線上服務**不保證**持續可用

---

## English

### About

A WebRTC P2P end-to-end encrypted browser file transfer tool. Signaling goes through the server, data goes direct peer-to-peer.

> 🌐 [https://file2file.net](https://file2file.net)

### ✨ Features

| Feature              | Description                                               |
|----------------------|-----------------------------------------------------------|
| 🔐 End-to-End Crypto | Files encrypted locally in browser, keys never sent       |
| 🔗 P2P Direct        | WebRTC DataChannel, data bypasses server                  |
| 🔄 Key Rotation      | Auto-generates new key after each transfer session         |
| 🧩 Chunked Transfer  | 64KB streaming chunks, memory friendly                     |
| 📱 Zero Install      | Pure web page, works on phone and desktop                  |
| 🌐 Multilingual      | 简体中文, 繁體中文, English                                |
| 🌓 Light/Dark Theme  | Follows system or manual toggle                            |
| 📋 One-Click Share   | Room QR code + copyable invite link                        |

### 🚀 Local Setup

```bash
npm install
npm start
# Open http://localhost:8080 in browser
```

### 📖 How to Use

1. Open the page, enter a 4-digit room code (or leave blank to auto-generate)
2. Share the QR code or link with the other person
3. Once both are in the same room, select a file to transfer

### ⚠️ Disclaimer

- This project is for **legal and legitimate** file transfer purposes only
- **DO NOT** use it to transfer any content that violates laws or regulations
- Users bear **full legal responsibility** for the content they transfer
- The developer and code generation tool assume **no liability**

---

## 源码 | 原始碼 | Source Code

| 文件 | File            | 作用 | Description                              |
|------|-----------------|------|------------------------------------------|
| `server.js`                 | Node.js HTTP server + WebRTC signaling     |
| `index.html`                | Frontend: AES-256-GCM encryption, QR code  |
| `package.json`              | Project metadata & dependencies            |
| `package-lock.json`         | Dependency lock file                       |
| `jsconfig.json`             | VS Code JavaScript project config          |
| `test_connection_limit.js`  | Connection limit protection test script    |
| `Readme.md`                 | This document                              |
| `LICENSE`                   | MIT open source license                    |
| `favicon.ico`               | Website icon                              |
| `.gitignore`                | Git ignore rules (excludes sensitive files)|
| `robots.txt`                | Crawler rules, allows all indexing         |
| `sitemap.xml`               | Sitemap for search engines                 |
| `kyber-browser.mjs`         | Kyber512 post-quantum KEM (bundled @noble/post-quantum) |
| `build-kyber.mjs`           | Build script: bundle Kyber for browser         |
| `verify-kyber.mjs`          | Verify Kyber bundle matches npm package        |

> 📦 [Download Source Code (Source Code.zip)](https://file2file.net/Source_Code.zip)

---

## 📄 许可 | 許可 | License

本项目采用 MIT 协议。 | 本專案採用 MIT 協議。 | Licensed under the MIT License.

[https://file2file.net/LICENSE](https://file2file.net/LICENSE)