How does javascript-Ajax prevent data theft?

Source: Internet
Author: User
The front-end intends to use ajax to obtain data, but it is afraid that the hard-to-use data will be stolen by others by analyzing the data returned by ajax. Is this behavior prevented by verification? But at present, the website can be used without registration, So how should we prevent it? Xie... the front-end intends to use ajax to obtain data, but it is afraid that the hard-to-enter data will be stolen by others by analyzing the data returned by ajax.

Is this behavior prevented by verification? But at present, the website can be used without registration, So how should we prevent it?

Thank you.

Probably:

Frontend-> get data through ajax-> background-> return data

How to prevent others from forging ajax to obtain data

Reply content:

The front-end intends to use ajax to obtain data, but it is afraid that the hard-to-use data will be stolen by others by analyzing the data returned by ajax.

Is this behavior prevented by verification? But at present, the website can be used without registration, So how should we prevent it?

Thank you.

Probably:

Frontend-> get data through ajax-> background-> return data

How to prevent others from forging ajax to obtain data

To put it this way, your purpose is to provide some data to some people, so it is against your original purpose to prevent these people from capturing your data.
It's like I gave you ten yuan, and I don't want you to take that ten yuan.

I 've struggled with this before. taking various measures, the final effect is just to increase the difficulty of crawling.
This is the same as client encryption. No matter how you encrypt and confuse it, the premise is that it is built on a trusted channel, and it is useless when the channel is untrusted.

If you do not need to log on to your website, all content is provided to everyone for free by default. Is there a difference between directly browsing data and calling APIs to obtain data?
Even if Ajax is not provided, it is the same to crawl directly from the webpage, cool.

"At present, the website can be used without registration, So how should we prevent it ".
"Someone else forged ajax to get data"

First, you must know how to distinguish between the so-called "others ". However, the problem is not described.

Looking at the requirements of the landlord, it should be a content-based website, and the requirement should be fear that others may plagiarize their own content.
There is a cost to do everything. A security principle is to increase the cost of committing crimes by the other party, and pay a lot more than what we get, so that the other party can give up committing crimes.

A common method is to load your content (data) on the backend to generate a watermark image and ajax. At least others cannot use it directly.

If you do not enter your identity authentication, how can you prevent unauthorized access. To stop "others", you must first know "others 」.

The identity token can be a Google-like login instead of a signed login. Even if the zookeeper IP address clears the memory of the zookeeper and cookies, the attacker can recognize the same user.

To achieve this, we can limit the data usage rate. For suspicious users, we should write access certificates, which are basically the water of Twitter and Google.

The data mentioned by the landlord will be displayed on some valid pages after all, so what method can be used to avoid theft. Only the cost of theft

I think there is no good way. If you want to get it, you can certainly get it.

1. When the front-end displays the page, the backend outputs a unique signature;
2. When Ajax initiates a request from the frontend to obtain data from the backend, it must pass the verification parameter, and the backend can then verify the signature.
I don't know if this idea can meet your needs (but the signature of this idea can still be obtained)

Simply add a sessionID to each ajax request. The backend determines whether to return data based on the sessionID. However, there is no way to completely prevent crawlers from capturing data.

Oau22.

Each time you initiate an ajax request, you can verify a token (encrypted string ).

The server determines the referer. If the referer domain name is its own domain name, it will return, otherwise it will not return.

Access-Control-Allow-Origin is enough.

The web page is open, the data is open, and any verification is futile and can be imitated by the robot.

The only difference may be that data is processed. For example, a novel website does not transmit text,
This is an example for reference.

The server generates a token (such as md5 (key + ip + date). This rule is only known to the Administrator) and is sent to the user together with html, and then the user's browser initiates an ajax request, at the same time, append the token generated by the server. The server returns the data to the user after determining that the source website domain name + token is correct.
Previously, I thought of this method to prevent the vote generator.

In a word, as long as you can see it, you can get it, so you don't have to worry about it.

This can be solved at the bottom. We can give you the idea that you should store the file in the internal storage of the author, to the memory storage of the browser, overwrite writable storage can be used. Let the attacker get an unusable file. You can also specify the IP address in the file to obtain the file, give them no confidence in the theft. I used to write a lot of programs in Hong Kong, but they will be stolen. So I have studied this method and hope that you will not let the people who have worked so hard.

I saw a name named "_ xx _". Here I swear and admire him. His mother worked so hard to get him up, but he couldn't even understand a few lines of words, what do you say he understands?

What permissions, licenses, and the difficulty of giving visitors is just a rejection. The front-end is to let everyone see it, and the incompetent people like _ Ying xx _ can see it. This is interesting. Are you right?
No one can check the backend. This is the protection of intellectual property rights. The called src can be generated on a temporary basis, generated multiple times, or removed temporarily. The cache is controlled by me. Do you understand? Send me an email if you don't understand it. I will tell you in detail in private.

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.