PHP interface Data encryption, decryption, verification of signature Code instances

Source: Internet
Author: User

PHP interface Data encryption, decryption, authentication signature

The code is very simple, there is no more nonsense, directly on the code

<?php/** * Data encryption, decryption, verification signature * @edit http://www.lai18.com * @date 2015-07-08 **///header (' Content-type:text/xml; charset=u Tf-8 '); Include_once (DirName (dirname (__file__)). Directory_separator. ' Phpsec '. Directory_separator. ' Math '. Directory_separator. ' Biginteger.php '); Include_once (DirName (dirname (__file__)). Directory_separator. ' Phpsec '. Directory_separator. ' Crypt '. Directory_separator. ' Aes.php '); Include_once (DirName (dirname (__file__)). Directory_separator. ' Phpsec '. Directory_separator. ' Crypt '. Directory_separator. ' Rsa.php ');//cipher $crypttext = ' v66ykulhfld2jelhm/j9qik2edr1jhdzic/k/ oesu2gbtx2usxyvf4jgvzvoihrre8fsfkmllmjsmijo5fdrs/fd20byfii4jw3bo3bzshxmz6aes2dwwg4sk9mnojfoc0ismov311x5/ jlguoqxkdy4f5hhpye9d/xgb0g2xe/hngssy2cpqcvqtblbmixwscknhseg92lovloz8ulwkqg5o7x+qb7p/emii/ wafaxbjxdxvzx7lmgcogon6wlhkjlgxorp6bixog6lgc6ux7bat3i9+0lujngxiq/sdsl23hsr3youpv5c5a813nrhx4hjyd/hbt1uviuml+ etmjwwcpsfs2cvxiur0ce57jazvyxjk13shk3iszhlppsm/jcdcrdy0co/d5uigjadzxdsq56xsju+tlvna1j6yq2tdifyk/ x6k911a5wxlkyxztd1nq+btyn3gv/wffrzvtgwqbrh06ihs2cwvna0s9ev/ypmhnajjmrx4trnr9nxq9xazaw4lgrg87u5qdv+nqjj1thk0xhfc69n9g2+ dsagyes9tk6u0zq72hjzqzhbcdh1ukw0plyihjdxpgppowgp8/qvvu2jultekunvgaaec3n+gozfqjscdi1s6t2mtnjwywnofrbhvezfd/ Revgpastozdqa5nqr1b+muf70r6uw6mwlj7ct9tz3jq+ca '; $aeskey = Base64_decode (' qze60qzfxuirub2ey4+7+q== ');//aes decryption, Use ECB mode $aes = new Crypt_aes (CRYPT_MODE_ECB);//Set AES key $aes->setkey ($aeskey);//decrypt AES cipher $plaintext = $aes Decrypt (Base64_decode ($crypttext)); echo $plaintext; Echo ' 
whenever you talk about transactions such as money issues, you need to pay particular attention to security considerations, such as developing a forum or a shopping cart.

Extended Reading

"PHP Practical Problem Solving case" series of technical Articles to organize the collection

1PHP Chinese pinyin conversion and Gregorian lunar calendar conversion

2php Shopping Cart Realization method

3PHP method for formatting file data size display

4php+jquery real-time display of online site numbers

5PHP realizes whether the user is mobile Access

6PHP function to escape special characters in JSON

7php socket-based SMTP method for sending mail

8PHP How to Query Express information

9PHP simple way to get a video preview

10php interface Data encryption, decryption, authentication signature

11php method for calculating file footprint in a specified directory

12php methods for replicating directories and subdirectories recursively

How to delete an entire directory in 13php by Directoryiterator

14PHP Generate Thunder, Express, Cyclone and other software download link code example

15PHP Chinese garbled classification and solving methods Daquan

16php random selection of several non-repeating elements from an array

17PHP File Upload Problem Summary--file size detection and large file upload processing

18 How to modify the PHP memory_limit limit

19php determine whether a request is an AJAX request or a normal request method

20PHP super-good infinite pole classification spanning tree method

21 Long Micro Boshengchen (convert HTML to picture) principle analysis

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

PHP interface Data encryption, decryption, verification of signature Code instances

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.