From e5b8ef71f8cea652d3df425128f2c21d112671e1 Mon Sep 17 00:00:00 2001 From: AfonsoCMSousa Date: Thu, 27 Feb 2025 12:23:19 +0000 Subject: [PATCH] Implemented method to create passwordFile. --- src/server.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/server.c b/src/server.c index 26bea05..20e4232 100644 --- a/src/server.c +++ b/src/server.c @@ -108,6 +108,18 @@ int main(void) send(connfd, &aux, sizeof(aux), 0); } } + else if (req.type == 1) + { + char *filepath = create(char); + filepath = size(filepath, 256); + + strcpy(filepath, PASSWORDS); + + sprintf(filepath, "%s%d.bin", filepath, req.level); + + encryptText(req.key, req.key); + writel(filepath, req.key, 256); + } } // Close the socket