mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 06:58:46 +00:00
DEK를 AES-256-KW를 이용해 암호화하는 것으로 변경
This commit is contained in:
@@ -4,8 +4,8 @@ import { user } from "./user";
|
||||
|
||||
const ciphertext = (name: string) =>
|
||||
text(name, { mode: "json" }).$type<{
|
||||
ciphertext: string;
|
||||
iv: string;
|
||||
ciphertext: string; // Base64
|
||||
iv: string; // Base64
|
||||
}>();
|
||||
|
||||
export const directory = sqliteTable(
|
||||
@@ -18,7 +18,7 @@ export const directory = sqliteTable(
|
||||
.notNull()
|
||||
.references(() => user.id),
|
||||
mekVersion: integer("master_encryption_key_version").notNull(),
|
||||
encDek: ciphertext("encrypted_data_encryption_key").notNull().unique(),
|
||||
encDek: text("encrypted_data_encryption_key").notNull().unique(), // Base64
|
||||
encryptedAt: integer("encrypted_at", { mode: "timestamp_ms" }).notNull(),
|
||||
encName: ciphertext("encrypted_name").notNull(),
|
||||
},
|
||||
@@ -45,7 +45,7 @@ export const file = sqliteTable(
|
||||
.notNull()
|
||||
.references(() => user.id),
|
||||
mekVersion: integer("master_encryption_key_version").notNull(),
|
||||
encDek: ciphertext("encrypted_data_encryption_key").notNull().unique(),
|
||||
encDek: text("encrypted_data_encryption_key").notNull().unique(), // Base64
|
||||
encryptedAt: integer("encrypted_at", { mode: "timestamp_ms" }).notNull(),
|
||||
encName: ciphertext("encrypted_name").notNull(),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user