How to use PHP to encrypt and decrypt URL parameters

Source: Internet
Author: User
Urgent, how to use PHP to encrypt the URL parameters to decrypt
Since the use of base64_encode () generates too long and is too simple, there is no other way


------Solution--------------------
You can try using JS:
such as: JS encoding the text involves 3 functions: Escape,encodeuri,encodeuricomponent, the corresponding 3 decoding function: unescape,decodeuri,decodeuricomponent
------Solution--------------------
Base64 is only 1/4 longer than the original string.
Still feel long, should be considered from the direction of shortening the original string, rather than the conversion algorithm
Because even if the original string length can be maintained, it is difficult to guarantee that the URL is the appropriate character


------Solution--------------------

References:
Base64 is only 1/4 longer than the original string.
Still feel long, should be considered from the direction of shortening the original string, rather than the conversion algorithm
Because even if the original string length can be maintained, it is difficult to guarantee that the URL is the appropriate character


The specification of the original string customer has been written, and also to encrypt, it is impossible to shorten the original string, only as long as possible to maintain the original length. Base64 is just coding, not encryption, and does not match
------Solution--------------------
References:
Base64 is only 1/4 longer than the original string.
Still feel long, should be considered from the direction of shortening the original string, rather than the conversion algorithm
Because even if the original string length can be maintained, it is difficult to guarantee that the URL is the appropriate character



This method is very good, thank you for your valuable advice
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.