From d3ad38a7fa802d9b45e5d6120f038829be295f6e Mon Sep 17 00:00:00 2001 From: Leonetienne Date: Mon, 6 Dec 2021 10:06:47 +0100 Subject: [PATCH] Keys generated from passwords are now padded right-handedly --- GhettoCrypt/Util.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GhettoCrypt/Util.h b/GhettoCrypt/Util.h index e125596..ec69f10 100644 --- a/GhettoCrypt/Util.h +++ b/GhettoCrypt/Util.h @@ -206,7 +206,9 @@ namespace GhettoCipher // Segment the password in segments of key-size, and xor them together. for (std::size_t i = 0; i < in.size(); i += BLOCK_SIZE / 8) - b ^= StringToBitblock(in.substr(i, BLOCK_SIZE / 8)); + b ^= StringToBitblock( + PadStringToLength(in.substr(i, BLOCK_SIZE / 8), BLOCK_SIZE / 8, 0, false) + ); return b; }