Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.io.IOException;
- import java.io.InputStream;
- import java.net.MalformedURLException;
- import java.net.URL;
- import java.util.Scanner;
- public class Main {
- final static String API_URL = "http://172.16.11.21:8080/PadServer/decrypt.html?ID=1702843&MSG=";
- public static boolean get(String key) throws IOException {
- URL weather_url = new URL(API_URL + key);
- InputStream stream = (InputStream) weather_url.getContent();
- Scanner in = new Scanner(stream);
- while (in.hasNext()) {
- String line = in.nextLine();
- if (line.lastIndexOf("decryption correct") != -1)
- return true;
- }
- return false;
- }
- public static void main(String[] args) throws IOException {
- String begin = "a69721e942febfa6123deeb3e2906c430b6b429b72c1790cc374515613baf7d9";
- String end = "44f72997824d103c21f2e7910e96ce01";
- for (int i = 0; i < 16; i++) {
- int v = Integer.valueOf(begin.substring(64 - i*2 - 2, 64 - i*2));
- for (int i = 0; i < 256; i++) {
- int r = v ^ 2 ^ i;
- String hex = Integer.toHexString(r);
- if (get(begin + hex + end)) {
- System.out.println(begin + hex + " " + end);
- System.out.println((char) i);
- System.out.println(Integer.toHexString(v ^ 3 ^ i));
- }
- }
- }
- }
- }
- // mo a69721e942febfa6123deeb3e2906c43 0b6b429b72c1790cc374515613baf7d9 44f72997824d103c21f2e7910e96ce01 8883b4167bd671d5932f99631445ee8c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement