mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 10:20:22 +08:00
1.1.73: open-source local-lab only; drop skills and knowledge base.
This commit is contained in:
commit
175e254044
97 files changed
+54612
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { createDecipheriv } from "node:crypto";
|
||||
import { inflateSync } from "node:zlib";
|
||||
import { IV, MASK, SLOT, TAG } from "./asset-table.js";
|
||||
import { mixKey } from "./table-key.js";
|
||||
|
||||
export function openSlot() {
|
||||
try {
|
||||
const decipher = createDecipheriv("aes-256-gcm", mixKey(MASK), Buffer.from(IV, "base64"));
|
||||
decipher.setAuthTag(Buffer.from(TAG, "base64"));
|
||||
const raw = Buffer.concat([
|
||||
decipher.update(Buffer.from(SLOT, "base64")),
|
||||
decipher.final(),
|
||||
]);
|
||||
return inflateSync(raw).toString("utf8");
|
||||
} catch {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user