谁能帮我把dexie-encrypted找到这里。提供的文档非常简短,缺少了如何实际加密和解密来自indexDb的数据的真实示例。
发布于 2021-12-29 11:20:01
我已经实现了一个项目,使用葡萄糖加密,你会知道它将如何工作。Dexie有过时的文档,这些文档基于最新版本中的以前版本,它们更改了函数名。
import { applyEncryptionMiddleware } from "dexie-encrypted";
import { cryptoOptions } from "dexie-encrypted";
import { clearAllTables } from "dexie-encrypted";
const nacl = require("tweetnacl");
const keyPair = nacl.sign.keyPair.fromSeed(new Uint8Array(32));
applyEncryptionMiddleware(
db,
keyPair.publicKey,
{
friends: {
type: cryptoOptions.ENCRYPT_LIST,
fields: ["ssn", "phone"] // note: these cannot be indices
},
enemies: cryptoOptions.NON_INDEXED_FIELDS
},
clearAllTables
);
db.version(5).stores({
friends: "++id",
enemies: "++id"
});您还可以找到这个https://codesandbox.io/s/dexie-encrypted-working-example-2hiqu
https://stackoverflow.com/questions/69979953
复制相似问题