Giter Site home page Giter Site logo

dight_hzpt's Introduction

dight_HZPT

数字杭科的API算法

我讲一下具体的解析思路.学校这个使用的是先把字符串拼接之后.然后通过特定的算法加密然后进行请求.

涉及到的算法就是我下面的算法.最后只是API里面的内容不同.数量太多.需要的自行在上面的jar文件当中寻找你需要的api.这点都闲懒的话.联系我378759617.我要是有空可以帮助一下.

import java.security.Key;
import java.security.spec.KeySpec;

import javax.crypto.Cipher;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESedeKeySpec;
import javax.crypto.spec.IvParameterSpec;
//注意不要导错包
public static void main(String[] args) {
	//用户信息
	String str = "method=checkUserLoginIFS&idNumber=" + 2015002545 + "&UserPwd=" + "********" + "&logonIP="
			+ "115.193.237.242";
	//logonIP可以随机.反正是不判断的
	//用户盒子
	String str2 = "method=getMessageInBoxList&pageNo=" + 1 + "&userId=" + 2015002545 + "&idNumber="
			+ 1 + "&pageSize=10";
	String string = a(str2);
	System.out.println("http://i.hzpt.edu.cn/dcp/service?action=" + string);
	//其他的各种API.我就不一一搜索.自行去分析接口吧.
}

public static String a(String paramString) {
	try {
		Object localObject = new DESedeKeySpec("neusofteducationplatform".getBytes());
		localObject = SecretKeyFactory.getInstance("desede").generateSecret((KeySpec) localObject);
		Cipher localCipher = Cipher.getInstance("desede/CBC/PKCS5Padding");
		localCipher.init(1, (Key) localObject, new IvParameterSpec("01234567".getBytes()));
		byte[] bs = localCipher.doFinal(paramString.getBytes("utf-8"));
		System.out.println(bs.length);
		return byteToString(bs);
	} catch (Exception e) {
		e.printStackTrace();
	}
	return null;
}

private static String byteToString(byte[] paramArrayOfByte) {
	String str1 = "";
	for (int i = 0;; i++) {
		if (i >= paramArrayOfByte.length) {
			return str1;
		}
		String str3 = Integer.toHexString(paramArrayOfByte[i] & 0xFF);
		String str2 = str3;
		if (str3.length() == 1) {
			str2 = '0' + str3;
		}
		str1 = str1 + str2.toUpperCase();
	}
}

dight_hzpt's People

Contributors

egdw avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.