Reputation: 6422
I'm trying to implement a single-sign-on link from application written in JAVA, to another web app written in PHP.
I'd like a way to encrypt the username in .JSP and then decrypt in PHP.
I need to find functions matching functions that will allow this.
Upvotes: 2
Views: 1435
Reputation: 45023
You can use AES encryption.
or some other crypt solution, which have library for both.
Upvotes: 0
Reputation: 7686
Well pick any publicly available encryption method. An encryption is just an algorithm, in most cases should be possible to implement it in any language.
There's not really an encryption that works in PHP and not JSP, or vice versa.
Upvotes: 1
Reputation: 590
The encryption algorithm, block mode, and padding just need to be defined the same. PHP its own set of mcrypt libraries that supports many common symmetrical encryption algorithms. Although if possible i'd suggest using a different token like system for sharing authentication.
Have a unique token that is only valid for that session not for that user, then store it in the server side database which both your php and jsp pages have access to. This way no decryption need take place.
Upvotes: 1