refactor: creating a starting point for E2EE

This commit is contained in:
Ruben Talstra 2025-02-15 23:04:26 +01:00
parent 18d019d8b3
commit 606fea044a
No known key found for this signature in database
GPG key ID: 2A5A7174A60F3BEA
5 changed files with 301 additions and 188 deletions

View file

@ -502,6 +502,7 @@ export type TMessage = z.input<typeof tMessageSchema> & {
siblingIndex?: number;
attachments?: TAttachment[];
clientTimestamp?: string;
messageEncryptionIV?: string;
};
export const coerceNumber = z.union([z.number(), z.string()]).transform((val) => {

View file

@ -112,6 +112,7 @@ export type TUser = {
createdAt: string;
updatedAt: string;
encryptionPublicKey?: string;
decryptedPrivateKey?: string;
encryptedPrivateKey?: string; // Encrypted as a Base64 string
encryptionSalt?: string; // Base64 encoded salt used for PBKDF2
encryptionIV?: string; // Base64 encoded IV for AES-GCM