PasswordGate
PasswordGate 为 Minecraft 服务器增加了额外的密码认证步骤。认证在登录握手期间运行,此时玩家尚未进入世界、接收区块、出现在玩家列表中或获取正常游戏数据。
该模组必须同时安装在客户端和服务端上。
没有安装 PasswordGate 或协议版本不兼容的客户端将在登录阶段被拒绝,而不是先允许其进入世界然后再踢出。
功能特性
- 在创建
ServerPlayer 和进入世界之前进行认证
- 安全的首次加入密码注册
- SRP-6a 挑战-响应认证
- 使用 SHA-256 的 3072-bit RFC 5054 SRP 组
- 每次连接都生成新的加密挑战
- 不传输明文密码或可重用的密码哈希
- 可配置的认证超时时间
- 基于 UUID 和 IP 的暴力破解保护
- 临时锁定和控制失败延迟
- 防止格式错误、重复、乱序和重放的数据包
- 原子性、带版本控制的服务器凭据存储
- 支持专用服务器和集成服务器
客户端密码界面
当本地没有可用的凭据时,PasswordGate 会在正常的标题屏幕之前显示一个单独的密码界面。
生成的密码使用 SecureRandom,包含大小写字母、数字和安全特殊字符,默认设置下至少提供 128 位的熵。
密码存储
在 Windows 系统上,PasswordGate 会生成一个随机的 AES-256 密钥,使用 Windows DPAPI 对其进行保护,并使用 AES-256-GCM 对密码进行加密,每次写入时使用新的非ces(nonce)。文件替换是原子性的。
不存在明文、仅 Base64、XOR、静态哈希或硬编码密钥的回退机制。如果无法使用安全的操作系统支持存储,PasswordGate 会要求重新输入密码,而不是静默地不安全存储。
服务端从不存储原始密码。它只存储玩家的 UUID、唯一盐值、SRP 验证器、格式版本和认证时间戳。
首次登录与离线模式
当 allowFirstJoinRegistration=true 时,没有现有记录的玩家可以在登录握手期间注册密码,并且必须在加入前立即完成完整的 SRP 证明。
注册也可以在离线模式下工作,但离线模式的 UUID 可以被冒充。PasswordGate 会记录警告日志,因为该模组无法使 Minecraft 离线身份具备密码学上的真实性。请尽可能使用在线模式。
管理员命令
/passwordgate status <player>
/passwordgate reset <player>
/passwordgate revoke <player>
/passwordgate authorize <player>
/passwordgate reload
这些命令永远不会显示密码、盐值、验证器或认证证明。
配置
服务器配置文件包括认证超时时间、首次加入注册、最小密码长度、生成密码长度、失败尝试限制、失败窗口期以及临时锁定持续时间。
安全说明
PasswordGate 保护登录过程免受明文密码泄露、被动重放、可重用证明重放、格式错误数据包和基本在线暴力破解的攻击。但它无法保护被入侵的客户端计算机、被盗且未锁定的操作系统账户,也无法通过 Minecraft 离线模式提供的身份进行认证。
PasswordGate 旨在作为额外的认证层,并不能替代正常的 Minecraft 账户安全、服务器访问控制、备份或操作系统安全性。
PasswordGate
PasswordGate adds an extra password-authentication step to Minecraft servers. Authentication runs during the login handshake, before the player enters the world, receives chunks, appears in the player list, or gets normal gameplay data.
The mod must be installed on both the client and the server
A client without PasswordGate, or with an incompatible protocol version, is rejected during login rather than being allowed into the world and kicked afterward.
Features
- Authentication before
ServerPlayer creation and world entry
- Secure first-join password registration
- SRP-6a challenge-response authentication
- 3072-bit RFC 5054 SRP group with SHA-256
- Fresh cryptographic challenge for every connection
- No plaintext password or reusable password hash is transmitted
- Configurable authentication timeout
- UUID and IP-aware brute-force protection
- Temporary lockouts and controlled failure delays
- Protection against malformed, duplicated, out-of-order, and replayed packets
- Atomic, versioned server credential storage
- Dedicated-server and integrated-server support
Client password screen
PasswordGate displays a separate password screen before the normal title screen when no usable local credential is available.
Generated passwords use SecureRandom, contain upper- and lowercase letters, digits, and safe special characters, and provide at least 128 bits of entropy with the default settings.
Password storage
On Windows, PasswordGate generates a random AES-256 key, protects it with Windows DPAPI, and encrypts the password with AES-256-GCM using a new nonce for every write. Files are replaced atomically.
There is no plaintext, Base64-only, XOR, static-hash, or hard-coded-key fallback. If secure OS-backed storage is unavailable, PasswordGate asks for the password again instead of silently storing it insecurely.
The server never stores the original password. It stores only the player's UUID, a unique salt, an SRP verifier, format versions, and authentication timestamps.
First login and offline mode
When allowFirstJoinRegistration=true, a player without an existing record can register a password during the login handshake and must immediately complete a full SRP proof before joining.
Registration also works in offline mode, but offline-mode UUIDs can be impersonated. PasswordGate logs a warning because the mod cannot make Minecraft offline identities cryptographically authentic. Use online mode whenever possible.
Administrator commands
/passwordgate status <player>
/passwordgate reset <player>
/passwordgate revoke <player>
/passwordgate authorize <player>
/passwordgate reload
Commands never display passwords, salts, verifiers, or authentication proofs.
Configuration
The server configuration includes authentication timeout, first-join registration, minimum password length, generated-password length, failed-attempt limits, failure windows, and temporary lockout duration.
Security notes
PasswordGate protects the login process from plaintext-password exposure, passive replay, reusable proof replay, malformed packets, and basic online brute-force attempts. It cannot protect a compromised client computer, a stolen unlocked operating-system account, or authenticate identities supplied by Minecraft offline mode.
PasswordGate is intended as an additional authentication layer and does not replace normal Minecraft account security, server access control, backups, or operating-system security.
评论 0
登录后参与评分
还没有评论,来抢沙发吧