How to ensure the installation of the calling interface written to Android to prevent attacks

Source: Internet
Author: User
Tags decrypt
How the calling interface written to Android guarantees installation and prevents attacks
Write to the Android call interface how to ensure the installation, to prevent attacks, and some said to use oauth2.0 to check the information about oauth2.0 do not understand how I use to ask you to guide
------to solve the idea----------------------
See if you are your own internal interface or external interface, generally need to have a signature this is at least the sensitive data can be encrypted, if the server network on the protection of the attack can add some such as a minute number of requests IP management account management and other measures to prevent.

At the moment, the attack on the interface is at least I haven't touched, maybe the amount of the attack is too small to attract attention.
------to solve the idea----------------------
Encrypt, decrypt.
Encrypt the passed parameters (token). Then decrypt it on the server side.


Require ' aes.class.php ';
Require ' aesctr.class.php ';
$key = ' abcdef '; Secret key

$param = Array (
' Name ' = ' Fdipzone ',
' Password ' = ' 123456 ',
' Time ' = Time ()
)

$token = Aesctr::encrypt (Json_encode ($param), $key, 256); Encryption

After the server receives
$data = Json_decode (aesctr::d ecrypt ($token, $key, N), true);


' aes.class.php aesctr.class.php Reference: http://blog.csdn.net/fdipzone/article/details/8178982
  • 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.