网易云音乐新API浅析

新API采用了略微修改过的AES和RSA加密,主要用在登陆接口上,对新API进行简单的分析。

Url

估计会抓包的人都知道,Url中的api便成了weapi。比如手机登录: 原来是:http://music.163.com/api/login/cellphone/ 现在是:http://music.163.com/weapi/login/cellphone/

加密算法

核心过程如下:

 aesRsaEncrypt = function (text, pubKey, modulus, nonce) {
  const secKey = createSecretKey(16);  // 随机生成16位加密密钥
  return {
	params:  aesEncrypt(aesEncrypt(text, nonce), secKey),
	encSecKey: rsaEncrypt(secKey, pubKey, modulus)
  }
}

...Read More
Shadowsocks免费账号网址集
G+圈子很多这样的网站,大部分是由ss-panel这个开源项目建成。不知道他们是乐于分享还是另有目的。下面是列表: Shadow X(ss-panel作者...Read More
ASP.NET MVC 4笔记(二)
ASP.NET 02
有Timestamp修饰的表在修改已有的记录是一定要将该字段复制,也就是说一定要在Edit网页里面添加一行: @Html.HiddenFor(model => model.RowVersion) WebSecurity.C...Read More
local_offer #C#  #asp.net mvc4 
ASP.NET MVC4笔记(一) 扩展Simplemembership
using System.Web.Mvc;

namespace MvcClassManageSystem.ActionFilters
{
    public class LogStateFilterAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            base.OnActionExecuting(filterContext);
            //string controller = filterContext.RouteData.Values["controller"].ToString();
            //string action = filterContext.RouteData.Values["action"].ToString();
            //System.Diagnostics.Debug.WriteLine("OnAction:" + controller + "/" + action);

            if (WebMatrix.WebData.WebSecurity.IsAuthenticated == true)
            {
                filterContext.Result = new RedirectToRouteResult(new System.Web.Routing.RouteValueDictionary(new { Controller = "Home", action = "Index" }));
            }
        }
    }
}

...Read More
ZOJ month contest D.Determinant and Matrix
ACM

Time Limit: 2 Seconds      Memory Limit: 65536 KB


##Description Recently, LBH is learning the curse linear algebra. Thus he is very interested in matrix and determinant now. In order to practice his ability of solving the problem of linear algebra, he just invent some problems by himself. Once the problems was create, he would solve it immediately. However, he meet a problem that was so hard that he couldn’t work out even though racked his brains. The problem was described as follow:

...Read More
FFT求快速卷积的思考
11
离散型卷积的定义是:$$y(n)=\sum_{m=0}^{n} x(m)h(n-m)$$ 注意,h函数是反转的。 在Chipher Messages一题中,b串需要反转再...Read More
baylor 6622 Absurdistan Roads( NWERC Contest)
ACM

原题pdf:click here

Description

The people of Absurdistan discovered how to build roads only last year. After the discovery, every city decided to build their own road connecting their city with another city. Each newly built road can be used in both directions.

Absurdistan is full of surprising coincidences. It took all N cities precisely one year to build their roads. And even more surprisingly, in the end it was possible to travel from every city to every other city using the newly built roads.

...Read More
Timus 1996 Cipher Message 3 KMP+FFT求卷积
ACM

题目链接:click here ##description Emperor Palpatine has been ruling the Empire for 25 years and Darth Vader has been the head of the Empire Armed Forces. However, the Rebel movement is strong like it never used to be. One of the rebel leaders, Princess Leia from Alderaan, managed to get hold of secret blueprints of the Death Star, the imperial war station.

The Princess was going to deliver the station plan to the secret base for further analysis and searching for vulnerable spots. But her ship was attacked by the space destroyer “Devastator” headed by Darth Vader. At the last moment Princess Leia managed to send her findings to one of the closest planet called Tatooine with her droid R2-D2. Quite conveniently, an old friend of her father Obi-Wan Kenobi lives on that planet.

...Read More
ACM International Collegiate Programming Contest Asia Regional Contest, Tokyo Problem D Space Golf
ACM 10

原题pdf:click here


日本的亚洲区域赛真心简单啊。两个小时就刷了5题有余了。排名第一的队伍才做出7道。

题目真心长的可以了,看了半个小时才明白。。

题意其实也就是太空中向前方抛小球,问小球能够穿过N个障碍物后到达制定地点的最小初始速度是多少。非常暴力的模拟题。离散化后直接枚举弹跳的次数再取最小值即可。注意45°方向能成功的话,那还是45°最优。

...Read More