:)
Some checks failed
Deploy Encrypted Todo App / build-and-push (push) Has been cancelled

This commit is contained in:
2025-06-16 09:16:22 -06:00
parent 2f08b94c89
commit d71062cf13
13 changed files with 1817 additions and 1160 deletions

View File

@ -33,14 +33,14 @@ export class SignalClient {
this.authKey = authKey;
}
static async create(userId) {
static create(userId) {
const client = new SignalClient(userId);
console.log(`SignalClient initialized for user: ${userId}`);
return client;
}
// Encrypt using AES-GCM with authentication
async encrypt(message) {
encrypt(message) {
try {
// Generate a random IV
const iv = crypto.randomBytes(12);
@ -75,7 +75,7 @@ export class SignalClient {
}
// Decrypt the message
async decrypt(encryptedMessage) {
decrypt(encryptedMessage) {
try {
const payload = JSON.parse(
Buffer.from(encryptedMessage.body, "base64").toString(),