diff --git a/src/cryptonote_core/account.cpp b/src/cryptonote_core/account.cpp index 7da1c6745..3bedd7404 100644 --- a/src/cryptonote_core/account.cpp +++ b/src/cryptonote_core/account.cpp @@ -12,7 +12,7 @@ #include "crypto/crypto.h" extern "C" { -#include "crypto/blake256.h" +#include "crypto/keccak.h" } #include "cryptonote_core/cryptonote_basic_impl.h" #include "cryptonote_core/cryptonote_format_utils.h" @@ -39,7 +39,7 @@ DISABLE_VS_WARNINGS(4244 4345) // rng for generating second set of keys is hash of first rng. means only one set of electrum-style words needed for recovery crypto::secret_key second; - blake256_hash((uint8_t *)&second, (uint8_t *)&first, sizeof(crypto::secret_key)); + keccak((uint8_t *)&first, sizeof(crypto::secret_key), (uint8_t *)&second, sizeof(crypto::secret_key)); generate_keys(m_keys.m_account_address.m_view_public_key, m_keys.m_view_secret_key, second, two_random ? false : true); m_creation_timestamp = time(NULL); diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 95d163f2e..6af0de9f9 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -3,6 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include +#include #include #include #include @@ -42,7 +43,7 @@ namespace const command_line::arg_descriptor arg_password = {"password", "Wallet password", "", true}; const command_line::arg_descriptor arg_electrum_seed = {"electrum-seed", "Specify electrum seed for wallet recovery/creation", ""}; const command_line::arg_descriptor arg_restore_deterministic_wallet = {"restore-deterministic-wallet", "Recover wallet using electrum-style mnemonic", false}; - const command_line::arg_descriptor arg_non_deterministic = {"non-deterministic", "requires --generate-new-wallet, uses old generation method", false}; + const command_line::arg_descriptor arg_non_deterministic = {"non-deterministic", "creates non-deterministic view and spend keys", false}; const command_line::arg_descriptor arg_daemon_port = {"daemon-port", "Use daemon instance at port instead of 8081", 0}; const command_line::arg_descriptor arg_log_level = {"set_log", "", 0, true}; @@ -397,12 +398,6 @@ bool simple_wallet::new_wallet(const string &wallet_file, const std::string& pas std::string print_electrum = ""; - if (!two_random) - { - print_electrum = "\nYour wallet can be recovered using the following electrum-style word list:\n"; - print_electrum += electrum_words; - print_electrum += "\n"; - } success_msg_writer() << "**********************************************************************\n" << @@ -411,9 +406,16 @@ bool simple_wallet::new_wallet(const string &wallet_file, const std::string& pas "Use \"help\" command to see the list of available commands.\n" << "Always use \"exit\" command when closing simplewallet to save\n" << "current session's state. Otherwise, you will possibly need to synchronize \n" << - "your wallet again. Your wallet key is NOT under risk anyway.\n" << - print_electrum << - "**********************************************************************"; + "your wallet again. Your wallet key is NOT under risk anyway.\n" + ; + + if (!two_random) + { + success_msg_writer(true) << "\nPLEASE NOTE: the following 24 words can be used to recover access to your wallet. Please write them down and store them somewhere safe and secure. Please do not store them in your email or on file storage services outside of your immediate control. You will not be able to view these words again, so it is imperative to make note of them now.\n"; + std::cout << electrum_words << std::endl; + } + success_msg_writer() << "**********************************************************************"; + return true; } //----------------------------------------------------------------------------------------------------