// 帝天 · 坐标 / 明文加解密
class CoordCipher {
constructor() {
this.algo = 'AES-256-GCM';
this.rounds = 3; // 多层混淆
}
async encryptCoord(x, y, z) {
const raw = packXYZ(x, y, z);
const masked = this._scramble(raw);
return this._aesSeal(masked);
}
async decryptCoord(token) {
const plain = await this._aesOpen(token);
return this._unscramble(plain); // 坐标还原
}
async decryptPlain(blob) {
// 明文解密:会话密钥 + 动态 IV
return decodeUTF8(await this._aesOpen(blob));
}
}