Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose wallet2::{en,de}crypt in monero_wallet_full #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jbakosi
Copy link
Contributor

@jbakosi jbakosi commented Aug 19, 2022

This will only work after monero-project/monero#8515 is merged and integrated here, so after review the API might change. I tested this using:

auto w = monero_wallet_full::create_wallet_random( "", "", monero_network_type::TESTNET );
for (const auto& text : std::array<std::string,4>{"Restricted","Restricted0","Restricted01","Restricted012"}) {
    for (auto authenticated : std::array<bool,2>{false,true}) {
      uint64_t pad;
      auto ciphertext_z85 = w->encrypt_message( text, pad, authenticated );
      auto cleartext = w->decrypt_message( ciphertext_z85, pad, authenticated );
      std::cout << "'" << text << "', " << authenticated << ", " << ciphertext_z85 << ", " << pad << ", '" << cleartext << "'\n";
      assert( text == cleartext );
    }
  }

Please let me know how I can help integrate this better.

@woodser
Copy link
Owner

woodser commented Aug 19, 2022

Thanks, it looks good at first sight.

@woodser
Copy link
Owner

woodser commented Apr 5, 2024

Please rebase if you still want to add this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants