首页 新闻 赞助 找找看

ASHX返回数据或JOSIN数据如何加密

0
悬赏园豆:20 [待解决问题]

 参考演示ASHX 现在是如何能进行返回数据进行加密或是URL加密
 //这块输入内容可参考
http://www.hanfoto.cn/Handler/ImageList.ashx?format=json&tags=rose&UserId=168%20and%208281=8281&tag=zuopin&per_page=35&api_key=5d93c2e473e39e9307e86d4a01381266&page=0

ImageList.ashx---返回数据

JS

 1 KISSY.use("waterfall,ajax,template,node,button", function(S, Waterfall, io, Template, Node, Button) {
 2     var $ = Node.all;
 3     var tpl = Template($('#tpl').html()),
 4         nextpage = 0,
 5         find,       
 6         UserId,
 7         typeId, //图片类型
 8         tag,
 9         photo,//图片显示的形式
10         matchId,
11         tempName = encodeURI(window.location.search);
12         tempName = decodeURI(window.location.search);
13         temp=encodeURI(location.href);
14         temp=decodeURI(location.href);
15         if(tempName.indexOf('find')>0){
16             find=tempName.substring(6);
17         }
18         if(temp.indexOf('UserIndex-')>0){
19            if(temp.indexOf('-S')<0){
20             UserId=temp.substring(temp.indexOf('UserIndex-')+10,temp.indexOf('.html'));
21             }else{
22             UserId=temp.substring(temp.indexOf('UserIndex-')+10,temp.indexOf('-S'));
23             }
24         }
25         if(temp.indexOf('-S')>0){//个人主页 作品 喜欢 投票
26             tag=temp.substring(temp.indexOf('-S')+2,temp.indexOf('.html'));
27         }
28         if(tempName.indexOf('&typeId=')>0 && tempName.indexOf('photo=')>0){//截取图片类型Id //图片页面,按不同的形式显示(投票、推荐、最新)
29             typeId = tempName.substring(tempName.indexOf('typeId=')+7);
30             photo = tempName.substring(tempName.indexOf('photo=')+6,tempName.indexOf("&"));
31         }else if(tempName.indexOf('photo=')>0)//图片页面,按不同的形式显示(投票、推荐、最新)
32         {
33              photo = tempName.substring(tempName.indexOf('photo=')+6);
34         }
35         
36         if(tempName.indexOf('matchId')>0)//某个比赛所有作品页面
37         {
38             matchId = tempName.substring(tempName.indexOf('matchId=')+8);
39         }
40         waterfall = new Waterfall.Loader({
41         container:"#ColumnContainer",
42         load:function(success, end) {
43             $('#loadingPins').show();
44            // var width = screen.width;
45              var width = 990;
46                         var heght = screen.height;
47                         var hang = parseInt(width/187);
48                         var lie = parseInt(heght/130);
49                         var per_page = parseInt(hang * lie);
50             S.ajax({
51                 data:{
52                     'find':find,
53                     'UserId':UserId,
54                     'typeId':typeId,
55                     'matchId':matchId,
56                     'photo':photo,
57                     'tag':tag,            
58                     'api_key': '5d93c2e473e39e9307e86d4a01381266',
59                     'tags': 'rose',
60                     'page': nextpage,
61                     'per_page': per_page,
62                     'format': 'json'
63                 }, 
64                 type: "post",
65                 cache: false,
66                 //这块是调用ASHX页面,然后返回值(这块如何能进行URL或是里面返回数据进行加密???)
67                 url: 'Handler/ImageList.ashx',
68                 //这块输入内容可参考
69                //http://www.hanfoto.cn/Handler/ImageList.ashx?format=json&tags=rose&UserId=168%20and%208281=8281&tag=zuopin&per_page=35&api_key=5d93c2e473e39e9307e86d4a01381266&page=0  
70                 dataType: "json",
71                 success: function(d) {                    
72                     if (d.stat !== 'ok'){
73                         alert('!');
74                         end();
75                         return;
76                     }
77                     nextpage = parseInt(d.images.page)+1;
78                     if (nextpage > d.images.pages) {
79                         end();
80                         return;
81                     }               
82                     var items = [];
83                     S.each(d.images.image, function(item) {
84                         items.push(new S.Node(tpl.render(item)));
85                     });
86                     success(items);
87                 },
88                 complete: function() {
89                     $('#loadingPins').hide();
90                 }
91             });
92         },
93         minColCount:2,
94         colWidth:247
95     });  
96 });     
Q玲珑的主页 Q玲珑 | 初学一级 | 园豆:162
提问于:2013-12-14 14:48
< >
分享
所有回答(1)
0

加密的目的是什么?

如果 ImageList.ashx 不是公共接口,那么在其中加入身份验证就可以啦。

JS是下载到客户端本地的,可以使用混淆器处理JS代码,提高破解难度,但实质上做任何加密解密貌似都没什么意义。

飞扬的尘埃 | 园豆:1318 (小虾三级) | 2013-12-15 10:18

安全联盟网站安全验证时所提示的网站SQL注入

支持(0) 反对(0) Q玲珑 | 园豆:162 (初学一级) | 2013-12-15 22:59
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册