Solidity and MetaMask Cryptography – How to Encrypt a Message Without Direct Private Key Usage

cryptographymetamasksolidity

I have a question if anyone can help me!
so I want to encrypt a message with my private key sign it and then send it to a person, the thing i see that it is not advisable to veil the private key of the metamask in the code for the encryption.
I am looking for a solution to do it without using the key directly, anyone have an idea that can help me solve this stain!
Thanks in advance 🙂

Best Answer

You can connect your metamask to https://www.myetherwallet.com/wallet/sign and sign any message you wish through it.

Myetherwallet has generally been the go to afaik

enter image description here

Select browser extension on the access page and connect with your wallet