1 package org.jastacry;
2
3 import net.sourceforge.cobertura.CoverageIgnore;
4
5 /**
6 * Class for constant values.
7 *
8 * <p>SPDX-License-Identifier: MIT
9 *
10 * @author Kai Kretschmann
11 */
12 public final class GlobalData
13 {
14 /**
15 * Help line reply.
16 */
17 public static final String HELP = "JaStaCry -h | (-v) (-t) [--encode|--decode] --infile input.txt "
18 + "--outfile output.bin --conffile layers.conf";
19
20 /**
21 * Base name for temporary files.
22 */
23 public static final String TMPBASE = "jastacry";
24
25 /**
26 * Extension for temporary files.
27 */
28 public static final String TMPEXT = ".tmp";
29
30 /**
31 * Extension for encrypted files.
32 */
33 public static final String ENCEXT = ".jac";
34
35 /**
36 * Parameter for encoding.
37 */
38 public static final String PARAM_ENCODE = "encode";
39
40 /**
41 * Parameter for decoding.
42 */
43 public static final String PARAM_DECODE = "decode";
44
45 /**
46 * Configuration value for layer "transparent" (lower case).
47 */
48 public static final String LAYER_TRANSPARENT = "transparent";
49
50 /**
51 * Configuration value for layer "xor" (lower case).
52 */
53 public static final String LAYER_XOR = "xor";
54
55 /**
56 * Configuration value for layer "rotate" (lower case).
57 */
58 public static final String LAYER_ROTATE = "rotate";
59
60 /**
61 * Configuration value for layer "reverse" (lower case).
62 */
63 public static final String LAYER_REVERSE = "reverse";
64
65 /**
66 * Configuration value for layer "random" (lower case).
67 */
68 public static final String LAYER_RANDOM = "random";
69
70 /**
71 * Configuration value for layer "filemerge" (lower case).
72 */
73 public static final String LAYER_FILEMERGE = "filemerge";
74
75 /**
76 * Configuration value for layer "md5des" (lower case).
77 */
78 public static final String LAYER_MD5DES = "md5des";
79
80 /**
81 * Configuration value for layer "aescbc" (lower case).
82 */
83 public static final String LAYER_AESCBC = "aescbc";
84
85 /**
86 * Configuration value for layer "aesecb" (lower case).
87 */
88 public static final String LAYER_AESECB = "aesecb";
89
90 /**
91 * Configuration value for layer "aesctr" (lower case).
92 */
93 public static final String LAYER_AESCTR = "aesctr";
94
95 /**
96 * enum range for Actions.
97 *
98 * @author Kai Kretschmann
99 *
100 */
101 public enum Action
102 {
103 /**
104 * Unknown action.
105 */
106 UNKOWN,
107
108 /**
109 * Encode action.
110 */
111 ENCODE,
112
113 /**
114 * Decode action.
115 */
116 DECODE;
117 }
118
119 /**
120 * enum range for return codes.
121 *
122 * @author Kai Kretschmann
123 *
124 */
125 public enum Returncode
126 {
127 /**
128 * Everything is OK.
129 */
130 RC_OK(0),
131
132 /**
133 * We had a warning.
134 */
135 RC_WARNING(1),
136
137 /**
138 * Showing help and quit.
139 */
140 RC_HELP(2),
141
142 /**
143 * Some major error happened.
144 */
145 RC_ERROR(3);
146
147 /**
148 * Private int value storage.
149 */
150 private int numVal;
151
152 /**
153 * Constructor of enum object.
154 *
155 * @param iNumVal gives initial value
156 */
157 Returncode(final int iNumVal)
158 {
159 this.numVal = iNumVal;
160 }
161
162 /**
163 * get numeric value of enum.
164 *
165 * @return integer value
166 */
167 public int getNumVal()
168 {
169 return numVal;
170 }
171 }
172
173 /**
174 * Placeholder for passwords.
175 */
176 public static final String MACRO_PASSWORD = "#PASS" + "WORD#";
177
178 /**
179 * Hidden constructor.
180 */
181 @CoverageIgnore
182 private GlobalData()
183 {
184 // not called
185 }
186 }