From a1141703e55148f2c0b2e3d10e492112632194e0 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Sat, 9 Apr 2022 17:53:51 +0200 Subject: [PATCH] made big keys possible --- src/decrypter.c | 4 ++-- src/encrypter.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/decrypter.c b/src/decrypter.c index 68998b5..6bf9218 100644 --- a/src/decrypter.c +++ b/src/decrypter.c @@ -10,9 +10,9 @@ char* decryptText(char *text, char *key) { //CHECK FOR INVALID key - if (strlen(key) != KEY_LENGTH) + if (strlen(key) < KEY_LENGTH) { - fprintf(stderr, "Key must be 50 characters long!\n"); + fprintf(stderr, "Key must be at least 50 characters long!\n"); exit(INVALID_KEY); } diff --git a/src/encrypter.c b/src/encrypter.c index a7ff5f2..a675347 100644 --- a/src/encrypter.c +++ b/src/encrypter.c @@ -71,9 +71,9 @@ encryptText(char *text, char *keyNew) if (keyNew != NULL) { - if (strlen(keyNew) != KEY_LENGTH) + if (strlen(keyNew) < KEY_LENGTH) { - fprintf(stderr, "Key must be 50 characters long!\n"); + fprintf(stderr, "Key must be at least 50 characters long!\n"); exit(INVALID_KEY); }