Skip to content

Commit

Permalink
Removed DES support. Some more fixes for Java 9
Browse files Browse the repository at this point in the history
  • Loading branch information
Samir Vaidya committed Dec 17, 2017
1 parent 4856c46 commit 321eb6f
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ Following option is common for all commands other than 'algorithms':

-A, --cryptalgo <crypto algorithm>
Algorithm to be used for encryption. Defaults to AES128. Possible
values are AES128, AES256 or DES. Please note that AES256 will only
be supported with JRE having unlimited strength jurisdiction policy
values are AES128 or AES256. Please note that AES256 will only be
supported with JRE having unlimited strength jurisdiction policy

'extract' options:

Expand Down
8 changes: 3 additions & 5 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<property name="author.name" value="Samir Vaidya"/>
<property name="author.mail" value="syvaidya@gmail.com"/>
<property name="homepage.url" value="http://www.openstego.com"/>
<property name="package.ver" value="0.7.1"/>
<property name="package.ver" value="0.7.2"/>
<property name="jre.minVer" value="1.7.0"/>
<property name="jdk.docs.href" value="http://docs.oracle.com/javase/7/docs/api/"/>
<property name="jdk.docs.dir" value="E:/jdk-1.7.0/api"/>
Expand Down Expand Up @@ -171,10 +171,8 @@
<echo file="${package}/${package.deb}/changelog.Debian"
append="false">OpenStego (${package.ver}-1) ; urgency=low

* GUI changes to support window resizing
* File permissions fix for Linux
* Added support for changing JPEG compression level (via openstego.ini file)
* Maintain metadata while writing images (e.g. EXIF for JPEG)
* Added support for Java 9
* Removed DES algorithm as it is not secure

-- ${author.name} &lt;${author.mail}&gt; ${time.changelog}
</echo>
Expand Down
4 changes: 2 additions & 2 deletions src/com/openstego/desktop/plugin/lsb/LSBEmbedOptionsUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public LSBEmbedOptionsUI(OpenStegoUI stegoUI) {

gridBagConstraints.gridy = 1;
for (int i = 0; i < 8; i++) {
maxBitsList[i] = new Integer(i + 1);
maxBitsList[i] = Integer.valueOf(i + 1);
}
this.maxBitsComboBox = new JComboBox<Integer>(maxBitsList);
this.maxBitsComboBox.setPreferredSize(new Dimension(40, 20));
Expand Down Expand Up @@ -142,7 +142,7 @@ public boolean validateEmbedAction() throws OpenStegoException {
*/
@Override
public void setGUIFromConfig(OpenStegoConfig config) throws OpenStegoException {
this.maxBitsComboBox.setSelectedItem(new Integer(((LSBConfig) config).getMaxBitsUsedPerChannel()));
this.maxBitsComboBox.setSelectedItem(Integer.valueOf(((LSBConfig) config).getMaxBitsUsedPerChannel()));
}

/**
Expand Down
7 changes: 5 additions & 2 deletions src/com/openstego/desktop/plugin/lsb/LSBPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ public List<String> getWritableFileExtensions() throws OpenStegoException {
if (compTypes.length > 0) {
writeParam.setCompressionType(compTypes[0]);
}
writeFormats.remove(i);
} catch (UnsupportedOperationException uoEx) {
// Compression not supported
break;
Expand All @@ -211,12 +210,16 @@ public List<String> getWritableFileExtensions() throws OpenStegoException {
if (writeParam.isCompressionLossless()) {
break;
}
writeFormats.remove(i);
}
}

// Expicilty removing GIF and WBMP formats, as they use unsupported color models
writeFormats.remove("gif");
writeFormats.remove("wbmp");
// Expicilty removing TIF(F) formats, as they are not working correctly - TODO check why
writeFormats.remove("tif");
writeFormats.remove("tiff");

return writeFormats;
}
Expand Down Expand Up @@ -263,6 +266,6 @@ public Class<? extends OpenStegoConfig> getConfigClass() {
@Override
public String getUsage() throws OpenStegoException {
LSBConfig defaultConfig = new LSBConfig();
return labelUtil.getString("plugin.usage", new Integer(defaultConfig.getMaxBitsUsedPerChannel()));
return labelUtil.getString("plugin.usage", Integer.valueOf(defaultConfig.getMaxBitsUsedPerChannel()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,6 @@ public byte[] extractData(byte[] stegoData, String stegoFileName, byte[] origSig
@Override
public String getUsage() throws OpenStegoException {
LSBConfig defaultConfig = new LSBConfig();
return labelUtil.getString("plugin.usage", new Integer(defaultConfig.getMaxBitsUsedPerChannel()));
return labelUtil.getString("plugin.usage", Integer.valueOf(defaultConfig.getMaxBitsUsedPerChannel()));
}
}
6 changes: 3 additions & 3 deletions src/com/openstego/desktop/resource/OpenStegoLabels.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ err.config.useCompression.invalid = Invalid value for configuration item ''useCo
err.config.useEncryption.invalid = Invalid value for configuration item ''useEncryption''\: {0}
err.config.password.invalid = Invalid password
err.config.invalidKey = Invalid configuration item provided\: {0}
err.config.invalidCryptAlgo = Invalid encryption algorithm provided\: {0}. Possible values are DES, AES128 or AES256
err.config.invalidCryptAlgo = Invalid encryption algorithm provided\: {0}. Possible values are AES128 or AES256
err.userpref.valueNotInteger = Invalid value in openstego.ini file for key\: {0}. Must be a valid integer
err.userpref.valueNotFloat = Invalid value in openstego.ini file for key\: {0}. Must be a valid floating point number
err.userpref.valueNotBoolean = Invalid value in openstego.ini file for key\: {0}. Must be one of\: true, false, t, f, yes, no, y, n, 1, 0
Expand Down Expand Up @@ -205,8 +205,8 @@ Following option is common for all commands other than ''algorithms'':\n\
\n\
\ -A, --cryptalgo <crypto algorithm>\n\
\ Algorithm to be used for encryption. Defaults to AES128. Possible\n\
\ values are AES128, AES256 or DES. Please note that AES256 will only\n\
\ be supported with JRE having unlimited strength jurisdiction policy\n\
\ values are AES128 or AES256. Please note that AES256 will only be\n\
\ supported with JRE having unlimited strength jurisdiction policy\n\
\n\
''extract'' options:\n\
\n\
Expand Down
3 changes: 1 addition & 2 deletions src/com/openstego/desktop/ui/EmbedPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,7 @@ public JButton getStegoFileButton() {
*/
public JComboBox<String> getEncryptionAlgoComboBox() {
if (this.encryptionAlgoComboBox == null) {
this.encryptionAlgoComboBox = new JComboBox<String>(
new String[] { OpenStegoCrypto.ALGO_AES128, OpenStegoCrypto.ALGO_AES256, OpenStegoCrypto.ALGO_DES });
this.encryptionAlgoComboBox = new JComboBox<String>(new String[] { OpenStegoCrypto.ALGO_AES128, OpenStegoCrypto.ALGO_AES256 });
}
return this.encryptionAlgoComboBox;
}
Expand Down
2 changes: 1 addition & 1 deletion src/com/openstego/desktop/util/PluginManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static void loadPlugins() throws OpenStegoException {
}

for (int i = 0; i < pluginList.size(); i++) {
plugin = (OpenStegoPlugin) Class.forName(pluginList.get(i)).newInstance();
plugin = (OpenStegoPlugin) Class.forName(pluginList.get(i)).getDeclaredConstructor().newInstance();
plugins.add(plugin);
pluginsMap.put(plugin.getName().toUpperCase(), plugin);
}
Expand Down
2 changes: 1 addition & 1 deletion src/com/openstego/desktop/util/dwt/DWT.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public DWT(int cols, int rows, int filterID, int level, int method) {

this.filters = new FilterGH[level + 1];
for (int i = 0; i <= level; i++) {
this.filters[i] = filterGHMap.get(new Integer(filterID));
this.filters[i] = filterGHMap.get(Integer.valueOf(filterID));
}

this.level = level;
Expand Down
2 changes: 1 addition & 1 deletion src/com/openstego/desktop/util/dwt/FilterXMLReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private static FilterGH getFilterGH(Element el) {
NodeList nl = null;
Filter filter = null;

filterGH.setId(new Integer(el.getAttribute("id")));
filterGH.setId(Integer.parseInt(el.getAttribute("id")));
filterGH.setName(el.getAttribute("name"));
filterGH.setType(el.getAttribute("type"));

Expand Down

0 comments on commit 321eb6f

Please sign in to comment.