Would it be possible to do the following?
Suppose I have address A and address B and i want to encrypt a text message
so it can be read by address B without sending this text in transaction on the blockchain so without
using the blockchain at all.
Which of the functions would I need to use from here:
I have seen there are a functions (encrypt, decrypt, encode, decode)
This encode / decode seems what am looking for or I am wrong?
If i need to use this then I need the sender or receiver public keys.
If this is the case how can I derive a public key from an address?
You can use the Crypto.encrypt and Crypto.decrypt functions.
If you want it to use a shared key between sender/recipient, you are going to need the encode/decode logic (ephemeral key generation, then encryption), have a look at those
The receiver public key is fetched from NIS node when the address is entered in the NANO wallet.
In case the public key for the address can’t be fetched then is not possible to send encrypted message.
No problem! If the time comes i will ask the same question for Symbol!
If you want you can paste a link here to that Symbol ephemeral key pair
anyway so I will take a look how this works.