百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

phantomdrive

> 编程语言
开源

看似正常的 USB 硬盘,但具备隐藏的安全功能

640 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

看似正常的 USB 硬盘,但具备隐藏的安全功能

Phantomdrive is open source encrypted USB drive with a stealth mechanism to hide its second partition. To decrypt it you must create a file containing your password in the format password:addpasswordhere, this is used to derive AES-XTS keys. The drive automatically unmounts itself, remounts the remaining disk and encrypts and decrypts in place. It uses CH569W SoC, which has USB3, SDIO and an AES hardware block. It is programmable over USB using the wch-ch56x-isp library.

bash
|-- ee             # Hardware files
|-- Makefile
|-- readme.md      # This files
|-- test           # Test the cypto components
|-- ref            # Reference docs
|-- src            # Firmware
|-- tests          # Verification scripts
|-- wch-ch56x-bsp  # Board support package
`-- wch-ch56x-isp  # Programming software

Getting Started

bash
git submodule update --init --recursive --checkout --force
cd wch-ch56x-isp
make # Build the ISP tool

Install the toolchain

The HydraUSB3 project requires the patched HydraUSB3 xPack GCC 12.2.0-1, which supports the WCH-Interrupt-fast interrupt attribute:

bash
cd /tmp
curl -sL -o riscv-gcc-xpack.tar.gz \
  "https://github.com/hydrausb3/riscv-none-elf-gcc-xpack/releases/download/12.2.0-1/xpack-riscv-none-elf-gcc-12.2.0-1-linux-x64.tar.gz"
tar xzf riscv-gcc-xpack.tar.gz
sudo cp -r xpack-riscv-none-elf-gcc-12.2.0-1/* /usr/local/

Debugging

make UART=1 # Enable UART

Build and Flashing the project

The AES mode, PBKDF2 iteration count, and locked capacity can be selected independently. Supported KDF values are 100000 and 600000; 100,000 is the default. LOCKED_SECTORS sets the locked (decoy) capacity in 512-byte sectors and defaults to 16,777,216 sectors (8 GiB). It must be smaller than the physical card's sector count; otherwise the unlocked capacity calculation underflows.

bash
# Remove flash drive
# While holding boot button, plug in

# Build and flash AES-XTS firmware with 600,000 PBKDF2 iterations and an
# 8 GiB locked capacity
make AES_MODE=XTS KDF_ROUNDS=600000 LOCKED_SECTORS=16777216 flash

# Or build and flash AES-CTR firmware with 100,000 iterations
make AES_MODE=CTR KDF_ROUNDS=100000 flash

# Build all four AES/KDF combinations
./release.sh

The four builds are written to build/CTR_100K, build/CTR_600K, build/XTS_100K, and build/XTS_600K.

Unlocking Drive

bash
# This will keep your password in bash history, but fine for testing/insecure
sudo echo "password:YourPasswordHere13245" > /mnt/unlock.txt

# Or avoid keeping the password is bash history
sudo dd of=/mnt/unlock.txt
password:YourPasswordHere13245
^D # ctrl+d

On the same note, please ensure your text editor doesn't cash/backup files, if they do disable that or use a different editor.

Releasing the hardware

bash
./scripts/release_hardware.sh

Security Notes

This code has not been professionally audited. Treat Phantomdrive as an experimental open source hardware/firmware project rather than a formally reviewed security product. The current level of validation is described in the test README. I am not responsible for loss of data, security incidents, or other damage resulting from use of this project.

The encrypted area can use AES-256-CTR or AES-256-XTS, with keys derived using PBKDF2-HMAC-SHA256 and either 100,000 or 600,000 iterations. AES mode and KDF iteration count affect the on-disk format, so firmware built with different settings cannot decrypt the same data without migration or reformatting.

Unlock detection is also content-based. While the device is locked, any write data containing the string password: can be interpreted as an unlock attempt; the file does not need to be named unlock.txt.

Shells may save commands in history so be aware when unlocking from the shell. Additionally, some text editors cache file contents in swap, autosave, or recovery files, etc... If you're using a text editor to enter your password disable this feature.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言