Naprawiono problem z nie grenerowaniem klucza szyfrującego

This commit is contained in:
yanczi 2025-11-14 19:32:20 +01:00
parent 29b2460910
commit fd42a5812a
8 changed files with 23 additions and 17 deletions

View file

@ -8,6 +8,7 @@ EncryptionManager::EncryptionManager()
}
keyReady = false;
generateKeys();
}
std::vector<char> EncryptionManager::encrypt(const std::vector<char>& raw)
@ -15,7 +16,7 @@ std::vector<char> EncryptionManager::encrypt(const std::vector<char>& raw)
std::vector<char> crypt(raw.size());
// Generowanie kluczy
generateKeys();
// generateKeys();
if (crypto_stream_chacha20_ietf_xor_ic(
reinterpret_cast<unsigned char*>(crypt.data()),
@ -40,7 +41,7 @@ void EncryptionManager::generateKeys()
keyReady = true;
}
void EncryptionManager::saveKey(const std::string& path)
void EncryptionManager::saveKey(const std::string& path, bool hpp)
{
const int sig = SIGNATURE_KEY_FILE;
const short ver = VERSION;
@ -73,7 +74,7 @@ void EncryptionManager::saveKey(const std::string& path)
file.close();
//saveCppHeadFile(path);
if (hpp) {saveCppHeadFile(path);}
}
// Generowanie pliku nag³ówkowego CPP z kluczem i nonce