For smart-contracts and dApps it is in many cases important to put encrypted data on the blockchain, encrypted with the public key.
I have been searching, but there doesn't seem to be a way to decrypt the data using an extention like metamask through web3.js. If I would want to build a dApp with encrypted data on the blockchain, I could only decrypt it by asking the user to insert his private key every time the app needs to decrypt data. The user needs to copy the private key from the metamask extention, where he needs to insert his password in order to expose it, then proceed to copy it and paste it into the app, so that the app can decrypt the data. This is tiresome for the user and also a huge security flaw.
A much better way (the way it should be done) is where Web3.js has a function to decrypt data, so that the extention can decrypt it there, and return the decrypted data. But this doesn't seem to be possible.
Why haven't they implemented this (yet)? It seems quite important to me in order to build safe dApps and smart-contracts. If there are better ways to do this, I would like to hear it.