Encrypt on frontend (sodium-plus.js) with public-key from backend (PHP sodium)
问题 I would like to achieve an anonymous public-key encryption in a web browser using sodium-plus.js with keys generated in PHP sodium like this: $keyPair = sodium_crypto_box_keypair(); $privateKey = sodium_crypto_box_secretkey($keyPair); $publicKey = sodium_crypto_box_publickey($keyPair); The keys generated with this method work fine in PHP with the sodium_crypto_box_seal and sodium_crypto_box_seal_open methods, but however, I am unable to make it work on the frontend. My approach: <script type=