Docs
Encryption

Encryption

Unfortunately, existing wallets have not standardized on a way to use an Ethereum keypair to encrypt or decrypt messages. (Though efforts have been made.)

So before sending shipping information, it's recommended that you generate an alternative private key and use it to encrypt the shipping information. However, if only your application can access the private key, it may prevent your application from being usable with the rest of the ecosystem.

As a temporary solution, you can use Keystore. Keystore is a free, centralized key-value store that can be accessed from any application. To use Keystore, you'll request a "challenge" and have your user sign it with their wallet. Then, use the wallet address as a "username" and the signature as the "password" for basic auth.

Read docs on keystore