Keys generated from passwords are now padded right-handedly

This commit is contained in:
Leonetienne 2021-12-06 10:06:47 +01:00
parent 4dc402e2e6
commit d3ad38a7fa

View File

@ -206,7 +206,9 @@ namespace GhettoCipher
// Segment the password in segments of key-size, and xor them together. // 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) 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; return b;
} }