├── README.md
├── pom.xml
└── src
└── main
├── java
└── com
│ └── example
│ └── demo
│ ├── Application.java
│ ├── Controller.java
│ ├── FineReport
│ └── FineReportDecode.java
│ ├── Landray
│ └── LandrayDES.java
│ ├── Seeyou
│ └── SeeyouDecode.java
│ ├── Yonyou
│ ├── DES.java
│ ├── Encode.java
│ └── YonyouDecode.java
│ └── ezOFFICE
│ ├── AESEncryptor.java
│ └── DecryptDataBase.java
└── resources
└── com
└── example
└── demo
└── main-view.fxml
/README.md:
--------------------------------------------------------------------------------
1 | ## DecryptOA
2 |
3 | 
4 |
5 |
6 | ## 支持解密
7 | * 万户
8 | * 蓝凌
9 | * 致远
10 | * 帆软
11 | * 用友
12 |
13 | ## 操作说明
14 |
15 | Java8
16 | ```
17 | java -jar DecryptOA-1.4.3-jar-with-dependencies.jar
18 | ```
19 | 
20 | ## 声明
21 | * 如果解密失败还请查看提示,是否为同样的输入密文!!!
22 | * 如果解密失败还请查看提示,是否为正确的解密参数!!!
23 | * 如果解密失败还请查看提示,是否为正确的解密参数!!!
24 | * 就是简单缝了个工具,工具中的解密方式均采用硬编码,源码已上传,如需自定义密钥请下载源码自行修改!
25 |
26 |
27 | ## THANKS
28 | * https://github.com/wafinfo/ezOFFICE_Decrypt
29 | * https://github.com/zhutougg/LandrayDES
30 | * https://github.com/1amfine2333/ncDecode
31 | * https://github.com/Rvn0xsy/PassDecode-jar
32 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 | org.example
7 | DecryptOA
8 | 1.4.3
9 |
10 |
11 |
12 |
13 | org.apache.maven.plugins
14 | maven-jar-plugin
15 | 2.4
16 |
17 |
18 | org.apache.maven.plugins
19 | maven-assembly-plugin
20 | 3.3.0
21 |
22 |
23 |
24 | com.example.demo.Application
25 |
26 |
27 |
28 | jar-with-dependencies
29 |
30 |
31 |
32 |
33 | make-assembly
34 | package
35 |
36 | single
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | 8
46 | 8
47 |
48 |
49 |
50 |
51 |
52 | org.openjfx
53 | javafx-controls
54 | 17.0.9
55 |
56 |
57 | org.openjfx
58 | javafx-fxml
59 | 17.0.9
60 |
61 |
62 | commons-codec
63 | commons-codec
64 | 1.15
65 |
66 |
67 | org.apache.commons
68 | commons-text
69 | 1.1
70 |
71 |
72 | commons-io
73 | commons-io
74 | 2.4
75 |
76 |
77 | junit
78 | junit
79 | 4.13.1
80 | test
81 |
82 |
83 |
--------------------------------------------------------------------------------
/src/main/java/com/example/demo/Application.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import javafx.fxml.FXMLLoader;
4 | import javafx.scene.Scene;
5 | import javafx.stage.Stage;
6 |
7 | import java.io.IOException;
8 |
9 | //mvn clean compile assembly:single
10 |
11 | public class Application extends javafx.application.Application {
12 | @Override
13 | public void start(Stage stage) throws IOException {
14 | FXMLLoader fxmlLoader = new FXMLLoader(Application.class.getResource("main-view.fxml"));
15 | Scene scene = new Scene(fxmlLoader.load());
16 | stage.setTitle("OA系统综合Decrypt工具 1.4.3 By MasterSir");
17 | stage.setScene(scene);
18 | stage.setResizable(false);
19 | stage.show();
20 | }
21 |
22 | public static void main(String[] args) {
23 | launch();
24 | }
25 | }
--------------------------------------------------------------------------------
/src/main/java/com/example/demo/Controller.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import com.example.demo.FineReport.FineReportDecode;
4 | import com.example.demo.Seeyou.SeeyouDecode;
5 | import com.example.demo.Yonyou.YonyouDecode;
6 | import com.example.demo.ezOFFICE.DecryptDataBase;
7 | import javafx.event.ActionEvent;
8 | import javafx.fxml.FXML;
9 | import javafx.scene.control.Alert;
10 | import javafx.scene.control.Button;
11 | import javafx.scene.control.ChoiceBox;
12 | import javafx.scene.control.TextArea;
13 | import com.example.demo.ezOFFICE.DecryptDataBase.*;
14 | import com.example.demo.Landray.LandrayDES.*;
15 | import com.example.demo.Seeyou.SeeyouDecode.*;
16 | import com.example.demo.Landray.LandrayDES;
17 |
18 | import static com.example.demo.FineReport.FineReportDecode.frDecrypt;
19 | import static com.example.demo.Landray.LandrayDES.llDecryptCon;
20 |
21 | public class Controller {
22 | //万户解密实现
23 | @FXML
24 | private TextArea whDecrypt;
25 |
26 | @FXML
27 | private Button whDecryptButton;
28 |
29 | @FXML
30 | private TextArea whDecryptInput;
31 |
32 | @FXML
33 | void whDecryptButtonAction(ActionEvent event) throws Exception {
34 | String input_text = whDecrypt.getText();
35 | if(input_text.length() < 2){
36 | whDecryptInput.setText(" [-] 输入错误!");
37 | }else {
38 | String whDecryptRes = DecryptDataBase.whDecryptCon(input_text);
39 | whDecryptInput.setText(whDecryptRes);
40 | }
41 | }
42 |
43 | //蓝凌解密实现
44 | @FXML
45 | private TextArea llDecrypt;
46 | @FXML
47 | private TextArea llDecryptInput;
48 | @FXML
49 | private ChoiceBox> llDecryptBox;
50 | @FXML
51 | private Button llDecryptButton;
52 | @FXML
53 | void llDecryptButtonAction(ActionEvent event) throws Exception {
54 | String lanlinginput = llDecrypt.getText();
55 | int selectedIndex = llDecryptBox.getSelectionModel().getSelectedIndex();
56 | if (lanlinginput.length() < 2){
57 | llDecryptInput.setText(" [-] 输入错误!");
58 | }else {
59 | String rest = llDecryptCon(lanlinginput,selectedIndex);
60 | llDecryptInput.setText(rest);
61 | }
62 | }
63 |
64 | //致远解密实现
65 | @FXML
66 | private TextArea zyDecrypt1;
67 | @FXML
68 | private Button zyDecryptButton1;
69 | @FXML
70 | private TextArea zyDecryptInput1;
71 | @FXML
72 | void zyDecryptButtonAction(ActionEvent event) throws Exception {
73 | String input_text = zyDecrypt1.getText();
74 | if (input_text.length() < 2){
75 | zyDecryptInput1.setText(" [-] 输入错误!");
76 | }else {
77 | String zyDecryptRes = SeeyouDecode.zyDecrypt(input_text);
78 | zyDecryptInput1.setText(zyDecryptRes);
79 |
80 | }
81 | }
82 |
83 | //帆软解密实现
84 | @FXML
85 | private TextArea frDecrypt;
86 | @FXML
87 | private Button frDecryptButton;
88 | @FXML
89 | private TextArea frDecryptInput;
90 | @FXML
91 | void frDecryptButtonAction(ActionEvent event) throws Exception {
92 | String input_text = frDecrypt.getText();
93 | if (input_text.length() < 2){
94 | frDecryptInput.setText(" [-] 输入错误!");
95 | }else {
96 | String frRest = FineReportDecode.frDecrypt(input_text);
97 | frDecryptInput.setText(frRest);
98 | }
99 | }
100 |
101 | //用友功能实现
102 | @FXML
103 | private TextArea yyDecrypt;
104 | @FXML
105 | private Button yyDecryptButton;
106 | @FXML
107 | private TextArea yyDecryptInput;
108 | @FXML
109 | void yyDecryptButtonAction(ActionEvent event) throws Exception {
110 | String input_text = yyDecrypt.getText();
111 | if (input_text.length() < 2){
112 | yyDecryptInput.setText(" [-] 输入错误!");
113 | }else {
114 | String yyRest = YonyouDecode.Decode(input_text);
115 | yyDecryptInput.setText(yyRest);
116 | }
117 |
118 | }
119 |
120 |
121 |
122 | //关于功能实现
123 | @FXML
124 | void xmdzAction(ActionEvent event) {
125 | try {
126 | String url = "https://www.baidu.com";
127 | java.awt.Desktop.getDesktop().browse(new java.net.URI(url));
128 | } catch (Exception e) {
129 | e.printStackTrace();
130 | }
131 | }
132 | @FXML
133 | void xmjsAction(ActionEvent event) {
134 | String style = "-fx-font-family: STKaiti; -fx-font-size: 14px;";
135 | Alert alert = new Alert(Alert.AlertType.INFORMATION);
136 | alert.setTitle("简介");
137 | alert.setHeaderText(null);
138 | alert.getDialogPane().lookup(".content.label").setStyle(style);
139 | alert.setContentText("将常见OA系统的解密方式进行缝合,优化部分算法。工具的默认密钥采用硬编码,不要过度依赖工具!");
140 | alert.showAndWait();
141 | }
142 | }
--------------------------------------------------------------------------------
/src/main/java/com/example/demo/FineReport/FineReportDecode.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.FineReport;
2 |
3 | public class FineReportDecode {
4 | public static String frDecrypt(String passwd) throws Exception {
5 | try {
6 | final int[] PassWordArray = {19, 78, 10, 15, 100, 213, 43, 23};
7 | String Key = passwd; // 密文
8 | if (Key != null && Key.startsWith("___")) {
9 | Key = Key.substring(3);
10 | final StringBuilder stringBuilder = new StringBuilder();
11 | byte Step = 0;
12 | for (byte i = 0; i <= Key.length() - 4; i += 4) {
13 | if (Step == PassWordArray.length) {
14 | Step = 0;
15 | }
16 | final String str = Key.substring(i, i + 4);
17 | final int num = Integer.parseInt(str, 16) ^ PassWordArray[Step];
18 | stringBuilder.append((char) num);
19 | Step++;
20 | }
21 | Key = stringBuilder.toString();
22 | }
23 | return Key;
24 | }catch (Exception e){
25 | return " [-] 解密失败!";
26 | }
27 | }
28 |
29 | // public static void main(String[] args) throws Exception {
30 | // String aa = frDecrypt("___0072002a00670066000a");
31 | // System.out.println(aa);
32 | // }
33 | }
--------------------------------------------------------------------------------
/src/main/java/com/example/demo/Landray/LandrayDES.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.Landray;
2 |
3 | import javax.crypto.Cipher;
4 | import javax.crypto.spec.SecretKeySpec;
5 | import java.nio.charset.StandardCharsets;
6 | import java.util.Base64;
7 |
8 | public class LandrayDES {
9 | public static String key = "";
10 | private static final String ALGORITHM_NAME = "DES";
11 | private static final String ALGORITHM_MODE_PADDING = "DES/ECB/PKCS5Padding";
12 |
13 | public static String decrypt(String encryptedText, String key) throws Exception {
14 | byte[] encryptedBytes = Base64.getDecoder().decode(encryptedText);
15 | Cipher cipher = Cipher.getInstance(ALGORITHM_MODE_PADDING);
16 | SecretKeySpec keySpec = new SecretKeySpec(fixKeySize(key), ALGORITHM_NAME);
17 | cipher.init(Cipher.DECRYPT_MODE, keySpec);
18 | byte[] decryptedBytes = cipher.doFinal(encryptedBytes);
19 | return new String(decryptedBytes, StandardCharsets.UTF_8);
20 | }
21 |
22 | private static byte[] fixKeySize(String key) {
23 | byte[] keyBytes = key.getBytes(StandardCharsets.UTF_8);
24 | byte[] fixedKey = new byte[8];
25 | System.arraycopy(keyBytes, 0, fixedKey, 0, Math.min(keyBytes.length, 8));
26 | return fixedKey;
27 | }
28 |
29 | public static String llDecryptCon(String passwd,int selectnum) throws Exception {
30 | if(selectnum == 0){
31 | key = "kmssPropertiesKey";
32 | }else {
33 | key = "kmssAdminKey";
34 | }
35 | try {
36 | String decryptedText = decrypt(passwd, key);
37 | return decryptedText;
38 | } catch (Exception e) {
39 | return " [-] 解密失败!";
40 | }
41 | }
42 |
43 |
44 | }
45 |
46 | // public static void main(String[] args) throws Exception {
47 | // //login.do 前台密码
48 | // LandrayDES des1 = new LandrayDES("kmssPropertiesKey");
49 | // System.out.println(des1.decryptString("edlR+Pow/ew="));
50 | // //admin.do:后台密码
51 | // LandrayDES des2 = new LandrayDES("kmssAdminKey");
52 | // System.out.println(des2.decryptString("JMK83aAgUCrm2fHdvJWIEQ=="));
53 | // }
54 |
--------------------------------------------------------------------------------
/src/main/java/com/example/demo/Seeyou/SeeyouDecode.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.Seeyou;
2 |
3 | import java.util.Base64;
4 | import java.nio.charset.StandardCharsets;
5 |
6 | public class SeeyouDecode {
7 | public static String zyDecrypt(String passwd) throws Exception {
8 | try {
9 | // String input = "/1.0/VWZ0dTIzNC8=";
10 | String input = passwd;
11 | String base64String = input.substring(5); // 去掉前五位
12 | byte[] decodedBytes = Base64.getDecoder().decode(base64String); // 进行base64解码
13 | String decodedString = new String(decodedBytes, StandardCharsets.UTF_8);
14 | char secondChar = input.charAt(1); // 获取解密后的字符串中的第二位字符
15 | int numericValue = Character.getNumericValue(secondChar);
16 | StringBuilder result = new StringBuilder();
17 | for (int i = 0; i < decodedString.length(); i++) {
18 | result.append((char) (decodedString.charAt(i) - numericValue));
19 | }
20 | return result.toString();
21 | }catch (Exception e){
22 | return " [-] 解密失败!";
23 | }
24 | }
25 |
26 | }
--------------------------------------------------------------------------------
/src/main/java/com/example/demo/Yonyou/DES.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.Yonyou;
2 |
3 | public class DES {
4 | private int[] subkey1 = new int[16];
5 | private int[] subkey2 = new int[16];
6 | private static final boolean[] ks = new boolean[]{false, false, true, true, true, true, true, true, false, true, true, true, true, true, true, false};
7 | private static final int[][] kp = new int[][]{{0, 262144, 16777216, 17039360, 1024, 263168, 16778240, 17040384, 2097152, 2359296, 18874368, 19136512, 2098176, 2360320, 18875392, 19137536, 1, 262145, 16777217, 17039361, 1025, 263169, 16778241, 17040385, 2097153, 2359297, 18874369, 19136513, 2098177, 2360321, 18875393, 19137537, 33554432, 33816576, 50331648, 50593792, 33555456, 33817600, 50332672, 50594816, 35651584, 35913728, 52428800, 52690944, 35652608, 35914752, 52429824, 52691968, 33554433, 33816577, 50331649, 50593793, 33555457, 33817601, 50332673, 50594817, 35651585, 35913729, 52428801, 52690945, 35652609, 35914753, 52429825, 52691969}, {0, 2, 2048, 2050, 134217728, 134217730, 134219776, 134219778, 65536, 65538, 67584, 67586, 134283264, 134283266, 134285312, 134285314, 256, 258, 2304, 2306, 134217984, 134217986, 134220032, 134220034, 65792, 65794, 67840, 67842, 134283520, 134283522, 134285568, 134285570, 16, 18, 2064, 2066, 134217744, 134217746, 134219792, 134219794, 65552, 65554, 67600, 67602, 134283280, 134283282, 134285328, 134285330, 272, 274, 2320, 2322, 134218000, 134218002, 134220048, 134220050, 65808, 65810, 67856, 67858, 134283536, 134283538, 134285584, 134285586}, {0, 4, 4096, 4100, 268435456, 268435460, 268439552, 268439556, 32, 36, 4128, 4132, 268435488, 268435492, 268439584, 268439588, 524288, 524292, 528384, 528388, 268959744, 268959748, 268963840, 268963844, 524320, 524324, 528416, 528420, 268959776, 268959780, 268963872, 268963876, 536870912, 536870916, 536875008, 536875012, 805306368, 805306372, 805310464, 805310468, 536870944, 536870948, 536875040, 536875044, 805306400, 805306404, 805310496, 805310500, 537395200, 537395204, 537399296, 537399300, 805830656, 805830660, 805834752, 805834756, 537395232, 537395236, 537399328, 537399332, 805830688, 805830692, 805834784, 805834788}, {0, 1048576, 8, 1048584, 512, 1049088, 520, 1049096, 67108864, 68157440, 67108872, 68157448, 67109376, 68157952, 67109384, 68157960, 8192, 1056768, 8200, 1056776, 8704, 1057280, 8712, 1057288, 67117056, 68165632, 67117064, 68165640, 67117568, 68166144, 67117576, 68166152, 131072, 1179648, 131080, 1179656, 131584, 1180160, 131592, 1180168, 67239936, 68288512, 67239944, 68288520, 67240448, 68289024, 67240456, 68289032, 139264, 1187840, 139272, 1187848, 139776, 1188352, 139784, 1188360, 67248128, 68296704, 67248136, 68296712, 67248640, 68297216, 67248648, 68297224}, {0, 512, 131072, 131584, 1, 513, 131073, 131585, 134217728, 134218240, 134348800, 134349312, 134217729, 134218241, 134348801, 134349313, 2097152, 2097664, 2228224, 2228736, 2097153, 2097665, 2228225, 2228737, 136314880, 136315392, 136445952, 136446464, 136314881, 136315393, 136445953, 136446465, 2, 514, 131074, 131586, 3, 515, 131075, 131587, 134217730, 134218242, 134348802, 134349314, 134217731, 134218243, 134348803, 134349315, 2097154, 2097666, 2228226, 2228738, 2097155, 2097667, 2228227, 2228739, 136314882, 136315394, 136445954, 136446466, 136314883, 136315395, 136445955, 136446467}, {0, 16, 536870912, 536870928, 1048576, 1048592, 537919488, 537919504, 2048, 2064, 536872960, 536872976, 1050624, 1050640, 537921536, 537921552, 67108864, 67108880, 603979776, 603979792, 68157440, 68157456, 605028352, 605028368, 67110912, 67110928, 603981824, 603981840, 68159488, 68159504, 605030400, 605030416, 4, 20, 536870916, 536870932, 1048580, 1048596, 537919492, 537919508, 2052, 2068, 536872964, 536872980, 1050628, 1050644, 537921540, 537921556, 67108868, 67108884, 603979780, 603979796, 68157444, 68157460, 605028356, 605028372, 67110916, 67110932, 603981828, 603981844, 68159492, 68159508, 605030404, 605030420}, {0, 4096, 65536, 69632, 33554432, 33558528, 33619968, 33624064, 32, 4128, 65568, 69664, 33554464, 33558560, 33620000, 33624096, 262144, 266240, 327680, 331776, 33816576, 33820672, 33882112, 33886208, 262176, 266272, 327712, 331808, 33816608, 33820704, 33882144, 33886240, 8192, 12288, 73728, 77824, 33562624, 33566720, 33628160, 33632256, 8224, 12320, 73760, 77856, 33562656, 33566752, 33628192, 33632288, 270336, 274432, 335872, 339968, 33824768, 33828864, 33890304, 33894400, 270368, 274464, 335904, 340000, 33824800, 33828896, 33890336, 33894432}, {0, 1024, 16777216, 16778240, 256, 1280, 16777472, 16778496, 268435456, 268436480, 285212672, 285213696, 268435712, 268436736, 285212928, 285213952, 524288, 525312, 17301504, 17302528, 524544, 525568, 17301760, 17302784, 268959744, 268960768, 285736960, 285737984, 268960000, 268961024, 285737216, 285738240, 8, 1032, 16777224, 16778248, 264, 1288, 16777480, 16778504, 268435464, 268436488, 285212680, 285213704, 268435720, 268436744, 285212936, 285213960, 524296, 525320, 17301512, 17302536, 524552, 525576, 17301768, 17302792, 268959752, 268960776, 285736968, 285737992, 268960008, 268961032, 285737224, 285738248}};
8 | private static final int[][] spbox = new int[][]{{8421888, 0, 32768, 8421890, 8421378, 33282, 2, 32768, 512, 8421888, 8421890, 512, 8389122, 8421378, 8388608, 2, 514, 8389120, 8389120, 33280, 33280, 8421376, 8421376, 8389122, 32770, 8388610, 8388610, 32770, 0, 514, 33282, 8388608, 32768, 8421890, 2, 8421376, 8421888, 8388608, 8388608, 512, 8421378, 32768, 33280, 8388610, 512, 2, 8389122, 33282, 8421890, 32770, 8421376, 8389122, 8388610, 514, 33282, 8421888, 514, 8389120, 8389120, 0, 32770, 33280, 0, 8421378}, {1074282512, 1073758208, 16384, 540688, 524288, 16, 1074266128, 1073758224, 1073741840, 1074282512, 1074282496, 1073741824, 1073758208, 524288, 16, 1074266128, 540672, 524304, 1073758224, 0, 1073741824, 16384, 540688, 1074266112, 524304, 1073741840, 0, 540672, 16400, 1074282496, 1074266112, 16400, 0, 540688, 1074266128, 524288, 1073758224, 1074266112, 1074282496, 16384, 1074266112, 1073758208, 16, 1074282512, 540688, 16, 16384, 1073741824, 16400, 1074282496, 524288, 1073741840, 524304, 1073758224, 1073741840, 524304, 540672, 0, 1073758208, 16400, 1073741824, 1074266128, 1074282512, 540672}, {260, 67174656, 0, 67174404, 67109120, 0, 65796, 67109120, 65540, 67108868, 67108868, 65536, 67174660, 65540, 67174400, 260, 67108864, 4, 67174656, 256, 65792, 67174400, 67174404, 65796, 67109124, 65792, 65536, 67109124, 4, 67174660, 256, 67108864, 67174656, 67108864, 65540, 260, 65536, 67174656, 67109120, 0, 256, 65540, 67174660, 67109120, 67108868, 256, 0, 67174404, 67109124, 65536, 67108864, 67174660, 4, 65796, 65792, 67108868, 67174400, 67109124, 260, 67174400, 65796, 4, 67174404, 65792}, {-2143285248, -2147479488, -2147479488, 64, 4198464, -2143289280, -2143289344, -2147479552, 0, 4198400, 4198400, -2143285184, -2147483584, 0, 4194368, -2143289344, Integer.MIN_VALUE, 4096, 4194304, -2143285248, 64, 4194304, -2147479552, 4160, -2143289280, Integer.MIN_VALUE, 4160, 4194368, 4096, 4198464, -2143285184, -2147483584, 4194368, -2143289344, 4198400, -2143285184, -2147483584, 0, 0, 4198400, 4160, 4194368, -2143289280, Integer.MIN_VALUE, -2143285248, -2147479488, -2147479488, 64, -2143285184, -2147483584, Integer.MIN_VALUE, 4096, -2143289344, -2147479552, 4198464, -2143289280, -2147479552, 4160, 4194304, -2143285248, 64, 4194304, 4096, 4198464}, {128, 17039488, 17039360, 553648256, 262144, 128, 536870912, 17039360, 537133184, 262144, 16777344, 537133184, 553648256, 553910272, 262272, 536870912, 16777216, 537133056, 537133056, 0, 536871040, 553910400, 553910400, 16777344, 553910272, 536871040, 0, 553648128, 17039488, 16777216, 553648128, 262272, 262144, 553648256, 128, 16777216, 536870912, 17039360, 553648256, 537133184, 16777344, 536870912, 553910272, 17039488, 537133184, 128, 16777216, 553910272, 553910400, 262272, 553648128, 553910400, 17039360, 0, 537133056, 553648128, 262272, 16777344, 536871040, 262144, 0, 537133056, 17039488, 536871040}, {268435464, 270532608, 8192, 270540808, 270532608, 8, 270540808, 2097152, 268443648, 2105352, 2097152, 268435464, 2097160, 268443648, 268435456, 8200, 0, 2097160, 268443656, 8192, 2105344, 268443656, 8, 270532616, 270532616, 0, 2105352, 270540800, 8200, 2105344, 270540800, 268435456, 268443648, 8, 270532616, 2105344, 270540808, 2097152, 8200, 268435464, 2097152, 268443648, 268435456, 8200, 268435464, 270540808, 2105344, 270532608, 2105352, 270540800, 0, 270532616, 8, 8192, 270532608, 2105352, 8192, 2097160, 268443656, 0, 270540800, 268435456, 2097160, 268443656}, {1048576, 34603009, 33555457, 0, 1024, 33555457, 1049601, 34604032, 34604033, 1048576, 0, 33554433, 1, 33554432, 34603009, 1025, 33555456, 1049601, 1048577, 33555456, 33554433, 34603008, 34604032, 1048577, 34603008, 1024, 1025, 34604033, 1049600, 1, 33554432, 1049600, 33554432, 1049600, 1048576, 33555457, 33555457, 34603009, 34603009, 1, 1048577, 33554432, 33555456, 1048576, 34604032, 1025, 1049601, 34604032, 1025, 33554433, 34604033, 34603008, 1049600, 0, 1, 34604033, 0, 1049601, 34603008, 1024, 33554433, 33555456, 1024, 1048577}, {134219808, 2048, 131072, 134350880, 134217728, 134219808, 32, 134217728, 131104, 134348800, 134350880, 133120, 134350848, 133152, 2048, 32, 134348800, 134217760, 134219776, 2080, 133120, 131104, 134348832, 134350848, 2080, 0, 0, 134348832, 134217760, 134219776, 133152, 131072, 133152, 131072, 134350848, 2048, 32, 134348832, 2048, 133152, 134219776, 32, 134217760, 134348800, 134348832, 134217728, 131072, 134219808, 0, 134350880, 131104, 134217760, 134348800, 134219776, 134219808, 0, 134350880, 133120, 133120, 2080, 2080, 131104, 134217728, 134350848}};
9 |
10 | public DES(long key) {
11 | this.setKey(key);
12 | }
13 |
14 | public long bytes2long(byte[] rd) {
15 | long dd = 0L;
16 |
17 | for (int i = 0; i <= 7; ++i) {
18 | dd = dd << 8 | (long) rd[i] & 255L;
19 | }
20 |
21 | return dd;
22 | }
23 |
24 | public long decrypt(long d) {
25 | d = this.ip(d);
26 | int l = (int) (d >>> 32);
27 | int r = (int) d;
28 |
29 | for (int i = 15; i >= 0; --i) {
30 | int t = l;
31 | l = r;
32 | r = t;
33 | int t1 = (t >>> 3 | t << 29) ^ this.subkey1[i];
34 | int t2 = (t << 1 | t >>> 31) ^ this.subkey2[i];
35 | l ^= spbox[0][t1 >>> 24 & 63] | spbox[1][t2 >>> 24 & 63] | spbox[2][t1 >>> 16 & 63] | spbox[3][t2 >>> 16 & 63] | spbox[4][t1 >>> 8 & 63] | spbox[5][t2 >>> 8 & 63] | spbox[6][t1 & 63] | spbox[7][t2 & 63];
36 | }
37 |
38 | d = (long) l << 32 | (long) r & 4294967295L;
39 | return this.rip(d);
40 | }
41 |
42 | public long encrypt(long d) {
43 | d = this.ip(d);
44 | int l = (int) (d >>> 32);
45 | int r = (int) d;
46 |
47 | for (int i = 0; i <= 15; ++i) {
48 | int t1 = (r >>> 3 | r << 29) ^ this.subkey1[i];
49 | int t2 = (r << 1 | r >>> 31) ^ this.subkey2[i];
50 | l ^= spbox[0][t1 >>> 24 & 63] | spbox[1][t2 >>> 24 & 63] | spbox[2][t1 >>> 16 & 63] | spbox[3][t2 >>> 16 & 63] | spbox[4][t1 >>> 8 & 63] | spbox[5][t2 >>> 8 & 63] | spbox[6][t1 & 63] | spbox[7][t2 & 63];
51 | int t = l;
52 | l = r;
53 | r = t;
54 | }
55 |
56 | d = (long) l << 32 | (long) r & 4294967295L;
57 | return this.rip(d);
58 | }
59 |
60 | private long ip(long d) {
61 | long t = (d << 36 ^ d) & -1085102596613472256L;
62 | d ^= t >>> 36 | t;
63 | t = (d << 48 ^ d) & -281474976710656L;
64 | d ^= t >>> 48 | t;
65 | t = (d << 30 ^ d) & 3689348813882916864L;
66 | d ^= t >>> 30 | t;
67 | t = (d << 24 ^ d) & 71777214277877760L;
68 | d ^= t >>> 24 | t;
69 | t = (d << 33 ^ d) & -6148914694099828736L;
70 | d ^= t >>> 33 | t;
71 | return d;
72 | }
73 |
74 | public void long2bytes(long sd, byte[] dd) {
75 | for (int i = 7; i >= 0; --i) {
76 | dd[i] = (byte) ((int) sd);
77 | sd >>>= 8;
78 | }
79 |
80 | }
81 |
82 | private long rip(long d) {
83 | long t = (d << 33 ^ d) & -6148914694099828736L;
84 | d ^= t >>> 33 | t;
85 | t = (d << 24 ^ d) & 71777214277877760L;
86 | d ^= t >>> 24 | t;
87 | t = (d << 30 ^ d) & 3689348813882916864L;
88 | d ^= t >>> 30 | t;
89 | t = (d << 48 ^ d) & -281474976710656L;
90 | d ^= t >>> 48 | t;
91 | t = (d << 36 ^ d) & -1085102596613472256L;
92 | d ^= t >>> 36 | t;
93 | return d;
94 | }
95 |
96 | public void setKey(long key) {
97 | long t = (key << 36 ^ key) & -1085102596613472256L;
98 | key ^= t >>> 36 | t;
99 | t = (key << 18 ^ key) & -3689573991287357440L;
100 | key ^= t | t >>> 18;
101 | t = (key << 9 ^ key) & -6196766167432910336L;
102 | key ^= t | t >>> 9;
103 | int d = (int) (key >>> 28 & 268435440L | key >>> 24 & 15L);
104 | int c = (int) (key << 20 & 267386880L | key << 4 & 1044480L | key >>> 12 & 4080L | key >>> 28 & 15L);
105 |
106 | for (int i = 0; i < 16; ++i) {
107 | if (ks[i]) {
108 | c = (c << 2 | c >>> 26) & 268435455;
109 | d = (d << 2 | d >>> 26) & 268435455;
110 | } else {
111 | c = (c << 1 | c >>> 27) & 268435455;
112 | d = (d << 1 | d >>> 27) & 268435455;
113 | }
114 |
115 | int t1 = kp[0][c >>> 22 & 63] | kp[1][c >>> 16 & 48 | c >>> 15 & 15] | kp[2][c >>> 9 & 60 | c >>> 8 & 3] | kp[3][c >>> 3 & 32 | c >>> 1 & 24 | c & 7];
116 | int t2 = kp[4][c >>> 22 & 63] | kp[5][c >>> 15 & 48 | c >>> 14 & 15] | kp[6][c >>> 7 & 63] | kp[7][c >>> 1 & 60 | c & 3];
117 | this.subkey1[i] = t1 & -16777216 | (t1 & '\uff00') << 8 | (t2 & -16777216) >>> 16 | (t2 & '\uff00') >>> 8;
118 | this.subkey2[i] = (t1 & 16711680) << 8 | (t1 & 255) << 16 | (t2 & 16711680) >>> 8 | t2 & 255;
119 | }
120 |
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/src/main/java/com/example/demo/Yonyou/Encode.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.Yonyou;
2 |
3 | public class Encode {
4 | private static long key = 1231234234L;
5 |
6 | public Encode() {
7 | }
8 |
9 | public static void setKey(long k) {
10 | key = k;
11 | }
12 |
13 | public String decode(String s, long k) {
14 | if (s == null) {
15 | return null;
16 | } else {
17 | DES des = new DES(k);
18 | byte[] sBytes = s.getBytes();
19 | int bytesLength = sBytes.length / 16;
20 | byte[] byteList = new byte[bytesLength * 8];
21 |
22 | for (int i = 0; i < bytesLength; ++i) {
23 | byte[] theBytes = new byte[8];
24 |
25 | for (int j = 0; j <= 7; ++j) {
26 | byte byte1 = (byte) (sBytes[16 * i + 2 * j] - 97);
27 | byte byte2 = (byte) (sBytes[16 * i + 2 * j + 1] - 97);
28 | theBytes[j] = (byte) (byte1 * 16 + byte2);
29 | }
30 |
31 | long x = des.bytes2long(theBytes);
32 | byte[] result = new byte[8];
33 | des.long2bytes(des.decrypt(x), result);
34 | System.arraycopy(result, 0, byteList, i * 8, 8);
35 | }
36 |
37 | String rtn = new String(this.subArr(byteList));
38 | return rtn;
39 | }
40 | }
41 |
42 | public String decode(String s) {
43 | return this.decode(s, key);
44 | }
45 |
46 | public String encode(String s, long k) {
47 | if (s == null) {
48 | return null;
49 | } else {
50 | StringBuilder sb = new StringBuilder();
51 | DES des = new DES(k);
52 | byte space = 32;
53 | byte[] sBytes = s.getBytes();
54 | int length = sBytes.length;
55 | int newLength = length + (8 - length % 8) % 8;
56 | byte[] newBytes = new byte[newLength];
57 |
58 | int i;
59 | for (i = 0; i < newLength; ++i) {
60 | if (i <= length - 1) {
61 | newBytes[i] = sBytes[i];
62 | } else {
63 | newBytes[i] = space;
64 | }
65 | }
66 |
67 | for (i = 0; i < newLength / 8; ++i) {
68 | byte[] theBytes = new byte[8];
69 |
70 | for (int j = 0; j <= 7; ++j) {
71 | theBytes[j] = newBytes[8 * i + j];
72 | }
73 |
74 | long x = des.bytes2long(theBytes);
75 | byte[] result = new byte[8];
76 | des.long2bytes(des.encrypt(x), result);
77 | byte[] doubleResult = new byte[16];
78 |
79 | for (int j = 0; j < 8; ++j) {
80 | doubleResult[2 * j] = (byte) ((((char) result[j] & 240) >> 4) + 97);
81 | doubleResult[2 * j + 1] = (byte) (((char) result[j] & 15) + 97);
82 | }
83 |
84 | sb.append(new String(doubleResult));
85 | }
86 |
87 | return sb.toString();
88 | }
89 | }
90 |
91 | public String encode(String s) {
92 | return this.encode(s, key);
93 | }
94 |
95 | private byte[] subArr(byte[] a) {
96 | int al = a.length;
97 | int end = this.checkEnd(a);
98 | if (end == 0) {
99 | return a;
100 | } else {
101 | byte[] rtn = new byte[al - end];
102 | System.arraycopy(a, 0, rtn, 0, al - end);
103 | return rtn;
104 | }
105 | }
106 |
107 | private int checkEnd(byte[] arr) {
108 | int rtn = 0;
109 | for (int i = arr.length - 1; i > 0 && arr[i] == 32; --i) {
110 | ++rtn;
111 | }
112 | return rtn;
113 | }
114 | }
--------------------------------------------------------------------------------
/src/main/java/com/example/demo/Yonyou/YonyouDecode.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.Yonyou;
2 |
3 | public class YonyouDecode {
4 | public static String Decode(String passwd) throws Exception {
5 | try {
6 | String password = passwd;
7 | String customKey = "1231234234";
8 | long key = 1231234234L;
9 | if (customKey != null) {
10 | key = Long.parseLong(customKey);
11 | }
12 | Encode encoder = new Encode();
13 | String plainText = encoder.decode(password, key);
14 | return plainText;
15 | }catch (Exception e){
16 | return " [-] 解密失败!";
17 | }
18 | }
19 |
20 |
21 | // public static void main(String[] args) throws Exception {
22 | // String aa = Decode("jlehfdffcfmohiag");
23 | // System.out.println(aa);
24 | // }
25 | }
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/main/java/com/example/demo/ezOFFICE/AESEncryptor.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.ezOFFICE;
2 |
3 | import java.security.SecureRandom;
4 | import javax.crypto.Cipher;
5 | import javax.crypto.KeyGenerator;
6 | import javax.crypto.SecretKey;
7 | import javax.crypto.spec.SecretKeySpec;
8 |
9 | public class AESEncryptor {
10 | public static final String PREFIX_AES = "{AES}";
11 | public static final String AES_SEED = "whir2014";
12 | private static final String HEX = "0123456789ABCDEF";
13 |
14 | public static String encrypt(String seed, String cleartext) throws Exception {
15 | byte[] rawKey = getRawKey(seed.getBytes());
16 | byte[] result = encrypt(rawKey, cleartext.getBytes());
17 | return toHex(result);
18 | }
19 |
20 | public static String decrypt(String seed, String encrypted) throws Exception {
21 | if (seed == null || "".equals(seed) || encrypted == null ||
22 | "".equals(encrypted)) {
23 | return null;
24 | }
25 | byte[] rawKey = getRawKey(seed.getBytes());
26 | byte[] enc = toByte(encrypted);
27 | byte[] result = decrypt(rawKey, enc);
28 | return new String(result);
29 | }
30 |
31 | private static byte[] getRawKey(byte[] seed) throws Exception {
32 | KeyGenerator kgen = KeyGenerator.getInstance("AES");
33 | SecureRandom sr = SecureRandom.getInstance("SHA1PRNG");
34 | sr.setSeed(seed);
35 | kgen.init(128, sr);
36 | SecretKey skey = kgen.generateKey();
37 | byte[] raw = skey.getEncoded();
38 | return raw;
39 | }
40 |
41 | private static byte[] encrypt(byte[] raw, byte[] clear) throws Exception {
42 | if (raw == null || clear == null) {
43 | return null;
44 | }
45 | SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
46 | Cipher cipher = Cipher.getInstance("AES");
47 | cipher.init(1, skeySpec);
48 | byte[] encrypted = cipher.doFinal(clear);
49 | return encrypted;
50 | }
51 |
52 | private static byte[] decrypt(byte[] raw, byte[] encrypted) throws Exception {
53 | SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
54 | Cipher cipher = Cipher.getInstance("AES");
55 | cipher.init(2, skeySpec);
56 | byte[] decrypted = cipher.doFinal(encrypted);
57 | return decrypted;
58 | }
59 |
60 | public static String toHex(String txt) {
61 | return toHex(txt.getBytes());
62 | }
63 |
64 | public static String fromHex(String hex) {
65 | return new String(toByte(hex));
66 | }
67 |
68 | public static byte[] toByte(String hexString) {
69 | if (hexString == null || "".equals(hexString)) {
70 | return null;
71 | }
72 | int len = hexString.length() / 2;
73 | byte[] result = new byte[len];
74 | for (int i = 0; i < len; i++) {
75 | result[i] = Integer.valueOf(hexString.substring(2 * i, 2 * i + 2),
76 | 16).byteValue();
77 | }
78 | return result;
79 | }
80 |
81 | public static String toHex(byte[] buf) {
82 | if (buf == null)
83 | return "";
84 | StringBuffer result = new StringBuffer(2 * buf.length);
85 | for (int i = 0; i < buf.length; i++) {
86 | appendHex(result, buf[i]);
87 | }
88 | return result.toString();
89 | }
90 |
91 | private static void appendHex(StringBuffer sb, byte b) {
92 | sb.append("0123456789ABCDEF".charAt(b >> 4 & 0xF)).append("0123456789ABCDEF".charAt(b & 0xF));
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/src/main/java/com/example/demo/ezOFFICE/DecryptDataBase.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.ezOFFICE;
2 |
3 | import com.example.demo.ezOFFICE.AESEncryptor;
4 |
5 | public class DecryptDataBase {
6 | public static String whDecryptCon(String passwd) throws Exception {
7 | String str2 = passwd;
8 | try {
9 | String res = AESEncryptor.decrypt("whir2014", str2.substring("{AES}".length()));
10 | return res;
11 | } catch (Exception e) {
12 | return " [-] 解密失败!";
13 | }
14 | }
15 | // public static void main(String[] args) throws Exception {
16 | // String x = whDecrypt("{AES}57AAE56A1A1239836179190485A2F927");
17 | // System.out.println(x);
18 | // }
19 | }
--------------------------------------------------------------------------------
/src/main/resources/com/example/demo/main-view.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------