feat: Initialize Electron application with core backend, frontend chat/login UI, and IPC for crypto and link previews.
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user