I have a regular request, for example:
http://myserver.com/index.php?var1=85842.23&var2=212.235&name=Teddie&valid=1
I would like those $_GET parameters be encrypted to something like (not real, just an example:)):
http://myserver.com/index.php?eParam=ks883d48223v2czozoz227272j2nn2dn2d2du3dh4hn4f4f4f4h3383xh8383s38s3j83sj8s3j92h2s89hs387h2s87hs287h2s87h2ui2c3iuhc287z9m2389f
Of course, I need a built in key on each side, that will be able to decrypt that info. Is there any function that may render that possible ? I am not concerned about the client side, as it will be a running application, not a webpage or anything that would be easily reverse-engineered.
Thanks !
In PHP, Encryption and Decryption of a string is possible using one of the Cryptography Extensions called OpenSSL function for encrypt and decrypt. openssl_encrypt() Function: The openssl_encrypt() function is used to encrypt the data. Parameters: $data: It holds the string or data which need to be encrypted.
A symmetric key is used during both the encryption and decryption processes. To decrypt a particular piece of ciphertext, the key that was used to encrypt the data must be used. The goal of every encryption algorithm is to make it as difficult as possible to decrypt the generated ciphertext without using the key.
The GET request is encrypted when using HTTPS - in fact this is why secured websites need to have a unique IP address - there's no way to get the intended hostname (or virtual directory) from the request until after it's been decrypted.
Just use SSL (i.e. HTTPS instead of plain HTTP). Then everything except the DNS look up for the domain and that a connection is made to the ip address that domain resolves to will be encrypted.
Actually you can do that... You can have an encrypt/decrypt function including a time expiry for the given parameter. I have a script that does that for my network systems. And you have to build that on your own, I can't go public with my security scripts... But here's the idea:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With