mirror of
https://github.com/monero-project/monero.git
synced 2025-12-30 14:40:48 -08:00
store secret keys encrypted where possible
The secret spend key is kept encrypted in memory, and decrypted on the fly when needed. Both spend and view secret keys are kept encrypted in a JSON field in the keys file. This avoids leaving the keys in memory due to being manipulated by the JSON I/O API.
This commit is contained in:
@@ -47,7 +47,7 @@ static crypto::chacha_key generate_chacha_key()
|
||||
{
|
||||
crypto::chacha_key chacha_key;
|
||||
uint64_t password = crypto::rand<uint64_t>();
|
||||
crypto::generate_chacha_key(std::string((const char*)&password, sizeof(password)), chacha_key);
|
||||
crypto::generate_chacha_key(std::string((const char*)&password, sizeof(password)), chacha_key, 1);
|
||||
return chacha_key;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user