PHP to the URL of the Chinese character encryption, but with the increase in the number of words, the encryption string has been increasing, want to let the length of the encryption character fixed, what good method?

Source: Internet
Author: User
PHP to the URL of the Chinese character encryption, but with the increase in the number of words, the encryption string has been increasing, want to let the length of the encryption character fixed, what good method?

Reply content:

PHP to the URL of the Chinese character encryption, but with the increase in the number of words, the encryption string has been increasing, want to let the length of the encryption character fixed, what good method?

If you want to put the encrypted content in the URL to pass, then there is no way an algorithm can be the length of the fixed content, encrypted into fixed-length content.

The encrypted content will certainly grow with the length of the data.

Because if this algorithm exists, what compression software is needed?

But if the encrypted content is not passed in the URL, another way, such as the encrypted content (or source content) is saved to the database,
Then pass the record ID or the result after the MD5/SHA1, and then, when used, pass this value in the data to check the record,
And then get the content that you originally wanted to preach.

In this case, its length can be fixed.

Many ways md5 , sha1 ... As long as you don't want to decrypt ~

MD5 is not a fixed length?

  • 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.