lion
lion

Reputation: 127

PHP: Best way to shorten (encrypt/decrypt) long query string parameter value but keep data?

I have a query string parameter with various value lengths varying between 56 and 378 characters with the data it may currently hold. I have to limit it to 64 characters but keep the data on two apps. I have no control over app 2. Values should be passed to get parameters in urls to make the two apps communicate on certain events. I believe it should work like this:

  1. encrypt variable on app 1 and send it to app 2 via curl - GET request
  2. receive encrypted data on app 2 and store in database
  3. send stored encrypted data back to app 1 on event
  4. receive encrypted data on app 1 and decrypt to use the data on app 1.

What is the best method to achieve this?

Upvotes: 0

Views: 354

Answers (1)

Gracz
Gracz

Reputation: 22

I know i may not directly address your question but communication between two application using GET is not the best way to approach the problem. far from it. You could be interesting in a tool like message broker, like http://www.rabbitmq.com/tutorials/tutorial-one-php.html

Upvotes: 1

Related Questions