Javascript encrypt and decrypt in PHP

Hello, I need to javascript encrypt information before sending over http and I’d like to know how I can encrypt and decrypt can then easily from php. Anyone know how I do it?. Thank you.

Why you want to do this? There are encryption implementations for both JavaScript and PHP. But note that a JavaScript <> PHP encryption/decryption can’t be secure since the algorithm and encryption key must be public in the javascript. You can only strengthen it by obfuscating the javascript code (making it unreadable, hiding the secure key).

Why is a secure connection (https) no option in this case?

I agree. It just makes sense to use https.