feat: Initialize Electron application with core backend, frontend chat/login UI, and IPC for crypto and link previews.

This commit is contained in:
bryan
2025-12-31 14:26:27 -06:00
parent b26a1d0b4b
commit f531301863
7 changed files with 324 additions and 167 deletions

View File

@@ -110,6 +110,15 @@ app.whenReady().then(() => {
return crypto.createHash('sha256').update(data).digest('hex');
});
ipcMain.handle('sign-message', (event, privateKeyPem, message) => {
// message should be a string or buffer
return crypto.sign(null, Buffer.from(message), privateKeyPem).toString('hex');
});
ipcMain.handle('verify-signature', (event, publicKeyPem, message, signature) => {
return crypto.verify(null, Buffer.from(message), publicKeyPem, Buffer.from(signature, 'hex'));
});
ipcMain.handle('derive-auth-keys', (event, password, salt) => {
return new Promise((resolve, reject) => {
crypto.scrypt(password, salt, 64, (err, derivedKey) => {