【发布时间】:2021-12-26 23:42:48
【问题描述】:
有人可以帮助我找到dexie-encrypted here 。所提供的文档非常简短,并且缺少有关如何实际加密和解密来自indexDb 的数据的真实示例。
【问题讨论】:
-
请编辑问题以将其限制为具有足够详细信息的特定问题,以确定适当的答案。
标签: encryption dexie
有人可以帮助我找到dexie-encrypted here 。所提供的文档非常简短,并且缺少有关如何实际加密和解密来自indexDb 的数据的真实示例。
【问题讨论】:
标签: encryption dexie
我已经使用 dexie-encrypted 实现了一个项目,您将了解它是如何工作的。 Dexie encrypted 具有基于先前版本的过时文档 在最新版本中,他们更改了函数名称
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
【讨论】: