加密从ajax请求收到的html数据?
如何加密从 ajax 请求接收的数据?例如,我从 Google 注意到,当发出 get 请求时,收到的数据都是乱七八糟的,例如:
position:absolute;top:0;width:155px\\x22 onclick\\x3d\\x22google.psy\\x26\\x26google.psy.qs(event)\\x22\\x3e\\x3cdiv id\\x3dms\\x3e\\x3cul\\x3e\\x3cli class\\x3d\\x22mitem msel\\x22\\x3e\\x3cspan class\\x3dmicon style\\x3d\\x22background-position:-20px -85px\\x22\\x3e\\x3c/span\\x3eEverything\\x3cli class\\x3d\\x22mitem\\x22\\x3e\\x3ca href\\x3d\\x22/search?q\\x3dasdfadf\\x26amp;hl\\x3den\\x26amp;prmd\\x3divns\\x26amp;source\\x3dlnms\\x26amp;tbm\\x3disch\\x26amp;ei\\x3dHZy4TeKYG6bw0gG8pbTRDw\\x26amp;sa\\x3dX\\x26amp;oi\\x3dmode_link\\x26amp;ct\\x3dmode\\x26amp;cd\\x3d2\\x26amp;sqi\\x3d2\\x26amp;ved\\x3d0CAgQ_AUoAQ\\x22 class\\x3d\\x22q qs\\x22\\x3e\\x3cspan class\\x3dmicon style\\x3d\\x22background-position:-40px -85px\\x22\\x3e\\x3c/span\\x3eImages\\x3c/a\\x3e\\x3cli class\\x3d\\x22mitem\\x22\\x3e\\x3ca href\\x3d\\x22/search?q\\x3dasdfadf\\x26amp;hl\\x3den\\x26amp;prmd\\x3divns\\x26amp;source\\x3dlnms\\x26amp;tbm\\x3dvid\\x26amp;ei\\x3dHZy4TeKYG6bw0gG8pbTRDw\\x26amp;sa\\x3dX\\x26amp;oi\\x3dmode_link\\x26amp;ct\\x3dmode\\x26amp;cd\\x3d3\\x26amp;sqi\\x3d2\\x26amp;ved\\x3d0CAkQ_AUoAg\\x22 class\\x3d\\x22q qs\\x22\\x3e\\x3cspan class\\x3dmicon style\\x3d\\x22background-position:-80px -85px\\x22\\x3e\\x3c/span\\x3eVideos\\x3c/a\\x3e\\x3cli class\\x3d\\x22mitem\\x22\\x3e\\x3ca href\\x3d\\x22/search?q\\x3dasdfadf\\x26amp;hl\\x3den\\x26amp;prmd\\x3divns\\x26amp;source\\x3dlnms\\x26amp;tbm\\x3dnws\\x26amp;ei\\x3dHZy4TeKYG6bw0gG8pbTRDw\\x26amp;sa\\x3dX\\x26amp;oi\\x3dmode_link\\x26amp;ct\\x3dmode\\x26amp;cd\\x3d4\\x26amp;sqi\\x3d2\\x26amp;ved\\x3d0CAoQ_AUoAw\\x22 class\\x3d\\x22q qs\\x22\\x3e\\x3cspan class\\x3dmicon style\\x3d\\x22background-position:-120px -85px\\x22\\x3e\\x3c/span\\x3eNews\\x3c/a\\x3e\\x3cli class\\x3d\\x22mitem\\x22\\x3e\\x3ca href\\x3d\\x22/search?q\\x3dasdfadf\\x26amp;hl\\x3den\\x26amp;prmd\\x3divns\\x26amp;source\\x3dlnms\\x26amp;tbm\\x3dshop\\x26amp;ei\\x3dHZy4TeKYG6bw0gG8pbTRDw\\x26amp;sa\\x3dX\\x26amp;oi\\x3dmode_link\\x26amp;ct\\x3dmode\\x26amp;cd\\x3d5\\x26amp;sqi\\x3d2\\x26amp;ved\\x3d0CAsQ_AUoBA\\x22 class\\x3d\\x22q qs\\x22\\x3e\\x3cspan class\\x3dmicon style\\x3d\\x22background-position:-120px -105px\\x22\\x3e\\
我怎样才能实现类似的结构?
How can I encrypt the data receieved from an ajax request? For example I noticed from Google when a get request is made the data that is receieved is all scambled like :
position:absolute;top:0;width:155px\\x22 onclick\\x3d\\x22google.psy\\x26\\x26google.psy.qs(event)\\x22\\x3e\\x3cdiv id\\x3dms\\x3e\\x3cul\\x3e\\x3cli class\\x3d\\x22mitem msel\\x22\\x3e\\x3cspan class\\x3dmicon style\\x3d\\x22background-position:-20px -85px\\x22\\x3e\\x3c/span\\x3eEverything\\x3cli class\\x3d\\x22mitem\\x22\\x3e\\x3ca href\\x3d\\x22/search?q\\x3dasdfadf\\x26amp;hl\\x3den\\x26amp;prmd\\x3divns\\x26amp;source\\x3dlnms\\x26amp;tbm\\x3disch\\x26amp;ei\\x3dHZy4TeKYG6bw0gG8pbTRDw\\x26amp;sa\\x3dX\\x26amp;oi\\x3dmode_link\\x26amp;ct\\x3dmode\\x26amp;cd\\x3d2\\x26amp;sqi\\x3d2\\x26amp;ved\\x3d0CAgQ_AUoAQ\\x22 class\\x3d\\x22q qs\\x22\\x3e\\x3cspan class\\x3dmicon style\\x3d\\x22background-position:-40px -85px\\x22\\x3e\\x3c/span\\x3eImages\\x3c/a\\x3e\\x3cli class\\x3d\\x22mitem\\x22\\x3e\\x3ca href\\x3d\\x22/search?q\\x3dasdfadf\\x26amp;hl\\x3den\\x26amp;prmd\\x3divns\\x26amp;source\\x3dlnms\\x26amp;tbm\\x3dvid\\x26amp;ei\\x3dHZy4TeKYG6bw0gG8pbTRDw\\x26amp;sa\\x3dX\\x26amp;oi\\x3dmode_link\\x26amp;ct\\x3dmode\\x26amp;cd\\x3d3\\x26amp;sqi\\x3d2\\x26amp;ved\\x3d0CAkQ_AUoAg\\x22 class\\x3d\\x22q qs\\x22\\x3e\\x3cspan class\\x3dmicon style\\x3d\\x22background-position:-80px -85px\\x22\\x3e\\x3c/span\\x3eVideos\\x3c/a\\x3e\\x3cli class\\x3d\\x22mitem\\x22\\x3e\\x3ca href\\x3d\\x22/search?q\\x3dasdfadf\\x26amp;hl\\x3den\\x26amp;prmd\\x3divns\\x26amp;source\\x3dlnms\\x26amp;tbm\\x3dnws\\x26amp;ei\\x3dHZy4TeKYG6bw0gG8pbTRDw\\x26amp;sa\\x3dX\\x26amp;oi\\x3dmode_link\\x26amp;ct\\x3dmode\\x26amp;cd\\x3d4\\x26amp;sqi\\x3d2\\x26amp;ved\\x3d0CAoQ_AUoAw\\x22 class\\x3d\\x22q qs\\x22\\x3e\\x3cspan class\\x3dmicon style\\x3d\\x22background-position:-120px -85px\\x22\\x3e\\x3c/span\\x3eNews\\x3c/a\\x3e\\x3cli class\\x3d\\x22mitem\\x22\\x3e\\x3ca href\\x3d\\x22/search?q\\x3dasdfadf\\x26amp;hl\\x3den\\x26amp;prmd\\x3divns\\x26amp;source\\x3dlnms\\x26amp;tbm\\x3dshop\\x26amp;ei\\x3dHZy4TeKYG6bw0gG8pbTRDw\\x26amp;sa\\x3dX\\x26amp;oi\\x3dmode_link\\x26amp;ct\\x3dmode\\x26amp;cd\\x3d5\\x26amp;sqi\\x3d2\\x26amp;ved\\x3d0CAsQ_AUoBA\\x22 class\\x3d\\x22q qs\\x22\\x3e\\x3cspan class\\x3dmicon style\\x3d\\x22background-position:-120px -105px\\x22\\x3e\\
How can I achieve a similar structure?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你不能。
在您发布的代码中,它不是加密,而只是编码。
you can't.
in the code you posted it's not encryption but just encoding.
它并不是真正的“加密”,只是经过混淆和编码。
我不确定所使用的编码类型。检查此SO post,它有一个类似的问题,它指出 ASCII 是十六进制编码的。It is not really "encrypted" simply obfuscated and encoded.
I am unsure of the encoding type being used.Check this SO post, which has a similar question and it states ASCII that is encoded hexadecimal.数据示例没有被扰乱,它只是被编码了。任何“奇怪”字符都将替换为 \\x##,其中 ## 是代表该字符的十六进制数字。
The data example isn't scrambled, it's just encoded. Any 'strange' character is replace by \\x## where ## is some hexadecimal number representing that character.