I want to implement a text chat app that users can send and receive messages and the message which stored in the data base in encrypted and when the receiver wants to see it decrypt the message and see it .......and i want to do it only using PHP and java script with out Frame works .....any one who can help me please !!!!
But I think it's quite dangerous to do this unless you really need to encrypt datas.
For example, your server crashes and you need to reinstall the app on another server. If the encryption key changes (key app in the .env file), you will never retrieve your datas.
@vincent15000 sorry I changed the category to Assistance ....and what I confused is here how can i create the public and private key to each user and how can I encrypt and decrypt the message using those keys ?
I never worked with this library, what I would do is to try the different openssl functions to understand how they work. You can try in a PHP sandbox for example.