Add Steganographie Tool

This commit is contained in:
Marcel Schwarz 2019-08-09 06:44:25 +02:00
parent 4ca3dcabe6
commit e7eff3b0cd
14 changed files with 313 additions and 4 deletions

View File

@ -1,4 +1,4 @@
#Fri, 09 Aug 2019 06:39:47 +0200 #Fri, 09 Aug 2019 06:43:38 +0200
D\:\\Git-Repos\\java-fx-8-samples= D\:\\Git-Repos\\java-fx-8-samples=

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="322.0" prefWidth="432.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="steganography.FXMLDocumentController">
<children>
<Button fx:id="btnEinlesenPic" layoutX="250.0" layoutY="47.0" mnemonicParsing="false" onAction="#handleEinlesenPic" prefHeight="25.0" prefWidth="119.0" text="choose jpg-File" />
<Label layoutX="182.0" layoutY="14.0" text="Connect Files" />
<Button fx:id="btnEinlesenDat" layoutX="250.0" layoutY="80.0" mnemonicParsing="false" onAction="#handleEinlesenDat" prefHeight="25.0" prefWidth="119.0" text="choose zip-File" />
<TextField fx:id="txtPicEinlesen" editable="false" layoutX="63.0" layoutY="47.0" prefHeight="25.0" prefWidth="175.0" />
<TextField fx:id="txtDateiEinlesen" editable="false" layoutX="63.0" layoutY="80.0" prefHeight="25.0" prefWidth="175.0" />
<TextField fx:id="txtEndname" layoutX="63.0" layoutY="121.0" prefHeight="25.0" prefWidth="175.0" />
<Label fx:id="lblFehler" alignment="CENTER" layoutX="63.0" layoutY="291.0" prefHeight="17.0" prefWidth="308.0" />
<Button fx:id="btnStart" layoutX="157.0" layoutY="166.0" mnemonicParsing="false" onAction="#handleStart" prefHeight="25.0" prefWidth="119.0" text="Create" />
<TextField fx:id="txtSavedAt" editable="false" layoutX="118.0" layoutY="212.0" prefHeight="25.0" prefWidth="242.0" />
<Label layoutX="60.0" layoutY="216.0" text="Saved at:" />
<Button fx:id="saveAs" layoutX="250.0" layoutY="121.0" mnemonicParsing="false" onAction="#handleSaveAs" prefHeight="25.0" prefWidth="119.0" text="Save at" />
</children>
</Pane>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -4,7 +4,7 @@
function launchApplication(jnlpfile) { function launchApplication(jnlpfile) {
dtjava.launch( { dtjava.launch( {
url : 'java-fx-8-samples.jnlp', url : 'java-fx-8-samples.jnlp',
jnlp_content : 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxqbmxwIHNwZWM9IjEuMCIgeG1sbnM6amZ4PSJodHRwOi8vamF2YWZ4LmNvbSIgaHJlZj0iamF2YS1meC04LXNhbXBsZXMuam5scCI+DQogIDxpbmZvcm1hdGlvbj4NCiAgICA8dGl0bGU+amF2YS1meC04LXNhbXBsZXM8L3RpdGxlPg0KICAgIDx2ZW5kb3I+bXNjaHc8L3ZlbmRvcj4NCiAgICA8ZGVzY3JpcHRpb24+bnVsbDwvZGVzY3JpcHRpb24+DQogICAgPG9mZmxpbmUtYWxsb3dlZC8+DQogIDwvaW5mb3JtYXRpb24+DQogIDxyZXNvdXJjZXM+DQogICAgPGoyc2UgdmVyc2lvbj0iMS42KyIgaHJlZj0iaHR0cDovL2phdmEuc3VuLmNvbS9wcm9kdWN0cy9hdXRvZGwvajJzZSIvPg0KICAgIDxqYXIgaHJlZj0iamF2YS1meC04LXNhbXBsZXMuamFyIiBzaXplPSIyMTQ1OTEiIGRvd25sb2FkPSJlYWdlciIgLz4NCiAgPC9yZXNvdXJjZXM+DQogIDxqZng6amF2YWZ4LWRlc2MgIHdpZHRoPSI4MDAiIGhlaWdodD0iNjAwIiBtYWluLWNsYXNzPSJ1dGlscy5SdW5uZXIiICBuYW1lPSJqYXZhLWZ4LTgtc2FtcGxlcyIgLz4NCiAgPHVwZGF0ZSBjaGVjaz0iYWx3YXlzIi8+DQo8L2pubHA+DQo=' jnlp_content : 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxqbmxwIHNwZWM9IjEuMCIgeG1sbnM6amZ4PSJodHRwOi8vamF2YWZ4LmNvbSIgaHJlZj0iamF2YS1meC04LXNhbXBsZXMuam5scCI+DQogIDxpbmZvcm1hdGlvbj4NCiAgICA8dGl0bGU+amF2YS1meC04LXNhbXBsZXM8L3RpdGxlPg0KICAgIDx2ZW5kb3I+bXNjaHc8L3ZlbmRvcj4NCiAgICA8ZGVzY3JpcHRpb24+bnVsbDwvZGVzY3JpcHRpb24+DQogICAgPG9mZmxpbmUtYWxsb3dlZC8+DQogIDwvaW5mb3JtYXRpb24+DQogIDxyZXNvdXJjZXM+DQogICAgPGoyc2UgdmVyc2lvbj0iMS42KyIgaHJlZj0iaHR0cDovL2phdmEuc3VuLmNvbS9wcm9kdWN0cy9hdXRvZGwvajJzZSIvPg0KICAgIDxqYXIgaHJlZj0iamF2YS1meC04LXNhbXBsZXMuamFyIiBzaXplPSIyMTk2MjYiIGRvd25sb2FkPSJlYWdlciIgLz4NCiAgPC9yZXNvdXJjZXM+DQogIDxqZng6amF2YWZ4LWRlc2MgIHdpZHRoPSI4MDAiIGhlaWdodD0iNjAwIiBtYWluLWNsYXNzPSJ1dGlscy5SdW5uZXIiICBuYW1lPSJqYXZhLWZ4LTgtc2FtcGxlcyIgLz4NCiAgPHVwZGF0ZSBjaGVjaz0iYWx3YXlzIi8+DQo8L2pubHA+DQo='
}, },
{ {
javafx : '8.0+' javafx : '8.0+'
@ -24,7 +24,7 @@
placeholder : 'javafx-app-placeholder', placeholder : 'javafx-app-placeholder',
width : '800', width : '800',
height : '600', height : '600',
jnlp_content : 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxqbmxwIHNwZWM9IjEuMCIgeG1sbnM6amZ4PSJodHRwOi8vam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Rpb24+DQogIDxyZXNvdXJjZXM+DQogICAgPGoyc2UgdmVyc2lvbj0iMS42KyIgaHJlZj0iaHR0cDovL2phdmEuc3VuLmNvbS9wcm9kdWN0cy9hdXRvZGwvajJzZSIvPg0KICAgIDxqYXIgaHJlZj0iamF2YS1meC04LXNhbXBsZXMuamFyIiBzaXplPSIyMTk2MjYiIGRvd25sb2FkPSJlYWdlciIgLz4NCiAgPC9yZXNvdXJjZXM+DQogIDxqZng6amF2YWZ4LWRlc2MgIHdpZHRoPSI4MDAiIGhlaWdodD0iNjAwIiBtYWluLWNsYXNzPSJ1dGlscy5SdW5uZXIiICBuYW1lPSJqYXZhLWZ4LTgtc2FtcGxlcyIgLz4NCiAgPHVwZGF0ZSBjaGVjaz0iYWx3YXlzIi8+DQo8L2pubHA+DQo='
}, },
{ {
javafx : '8.0+' javafx : '8.0+'

Binary file not shown.

View File

@ -8,7 +8,7 @@
</information> </information>
<resources> <resources>
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/> <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
<jar href="java-fx-8-samples.jar" size="214591" download="eager" /> <jar href="java-fx-8-samples.jar" size="219626" download="eager" />
</resources> </resources>
<jfx:javafx-desc width="800" height="600" main-class="utils.Runner" name="java-fx-8-samples" /> <jfx:javafx-desc width="800" height="600" main-class="utils.Runner" name="java-fx-8-samples" />
<update check="always"/> <update check="always"/>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="322.0" prefWidth="432.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="steganography.FXMLDocumentController">
<children>
<Button fx:id="btnEinlesenPic" layoutX="250.0" layoutY="47.0" mnemonicParsing="false" onAction="#handleEinlesenPic" prefHeight="25.0" prefWidth="119.0" text="choose jpg-File" />
<Label layoutX="182.0" layoutY="14.0" text="Connect Files" />
<Button fx:id="btnEinlesenDat" layoutX="250.0" layoutY="80.0" mnemonicParsing="false" onAction="#handleEinlesenDat" prefHeight="25.0" prefWidth="119.0" text="choose zip-File" />
<TextField fx:id="txtPicEinlesen" editable="false" layoutX="63.0" layoutY="47.0" prefHeight="25.0" prefWidth="175.0" />
<TextField fx:id="txtDateiEinlesen" editable="false" layoutX="63.0" layoutY="80.0" prefHeight="25.0" prefWidth="175.0" />
<TextField fx:id="txtEndname" layoutX="63.0" layoutY="121.0" prefHeight="25.0" prefWidth="175.0" />
<Label fx:id="lblFehler" alignment="CENTER" layoutX="63.0" layoutY="291.0" prefHeight="17.0" prefWidth="308.0" />
<Button fx:id="btnStart" layoutX="157.0" layoutY="166.0" mnemonicParsing="false" onAction="#handleStart" prefHeight="25.0" prefWidth="119.0" text="Create" />
<TextField fx:id="txtSavedAt" editable="false" layoutX="118.0" layoutY="212.0" prefHeight="25.0" prefWidth="242.0" />
<Label layoutX="60.0" layoutY="216.0" text="Saved at:" />
<Button fx:id="saveAs" layoutX="250.0" layoutY="121.0" mnemonicParsing="false" onAction="#handleSaveAs" prefHeight="25.0" prefWidth="119.0" text="Save at" />
</children>
</Pane>

View File

@ -0,0 +1,141 @@
package steganography;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import java.util.Scanner;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
/**
*
* @author Marcel
*/
public class FXMLDocumentController implements Initializable {
Stage chooser = new Stage();
FileChooser fileChooser = new FileChooser();
File inputDatei;
File inputBild;
File output;
File bat;
String command = "";
@FXML
private Button btnEinlesenPic;
@FXML
private Button btnEinlesenDat;
@FXML
private TextField txtPicEinlesen;
@FXML
private TextField txtDateiEinlesen;
@FXML
private TextField txtEndname;
@FXML
private Label lblFehler;
@FXML
private Button btnStart;
@FXML
private TextField txtSavedAt;
@FXML
private Button saveAs;
@FXML
private Button btnSaveBat;
@FXML
private CheckBox cbSaveAsBat;
@FXML
private TextField txtBatSave;
public void initialize(URL url, ResourceBundle rb) {
}
@FXML
private void handleEinlesenPic(ActionEvent event) {
fileChooser.setTitle("Open Resource File");
fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("JPG", "*.jpg"));
inputBild = fileChooser.showOpenDialog(chooser);
fileChooser.getExtensionFilters().clear();
if (inputBild != null) {
txtPicEinlesen.setText(inputBild.getAbsolutePath());
lblFehler.setText("Input Picture set");
} else {
lblFehler.setText("No file selected");
}
}
@FXML
private void handleEinlesenDat(ActionEvent event) {
fileChooser.setTitle("Open Resource File");
fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("ZIP", "*.zip"));
inputDatei = fileChooser.showOpenDialog(chooser);
fileChooser.getExtensionFilters().clear();
if (inputDatei != null) {
txtDateiEinlesen.setText(inputDatei.getAbsolutePath());
lblFehler.setText("Input File set.");
} else {
lblFehler.setText("No file selected.");
}
}
@FXML
private void handleStart(ActionEvent event) throws IOException {
if (inputBild != null && inputDatei != null && output != null) {
if (SystemCheck.isWindows()) {
command = "copy /b " + txtPicEinlesen.getText() + " + /b " + txtDateiEinlesen.getText() + " " + txtEndname.getText();
txtSavedAt.setText(output.getAbsolutePath());
doProcessWin();
lblFehler.setText("File created.");
} else {
lblFehler.setText("Unsupported System.");
}
} else {
if (inputBild == null) {
lblFehler.setText("No input image.");
} else if (inputDatei == null) {
lblFehler.setText("No input File.");
} else if (output == null) {
lblFehler.setText("No output File.");
}
}
}
@FXML
private void handleSaveAs(ActionEvent event) {
fileChooser.setTitle("Save File");
fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("JPG", "*.jpg"));
//fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("All Files", "*.*"));
output = fileChooser.showSaveDialog(chooser);
fileChooser.getExtensionFilters().clear();
if (output != null) {
txtEndname.setText(output.getAbsolutePath());
lblFehler.setText("Output File set");
} else {
lblFehler.setText("No file set");
}
}
private void doProcessWin() throws IOException {
ProcessBuilder builder = new ProcessBuilder("cmd", "/c", command);
//builder.directory(output.getAbsoluteFile());
Process p = builder.start();
Scanner s = new Scanner(p.getInputStream()).useDelimiter("\\Z");
}
private void doProcessLin() {
}
}

View File

@ -0,0 +1,40 @@
package steganography;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.application.Application;
import static javafx.fxml.FXMLLoader.load;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
/**
*
* @author Marcel
*/
public class Main extends Application {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) {
Parent root = null;
try {
root = load(getClass().getResource("FXMLDocument.fxml"));
} catch (IOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
}

View File

@ -0,0 +1,78 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package steganography;
import static java.lang.System.getProperty;
/**
*
* @author Marcel
*/
public class SystemCheck {
private static final String OS = getProperty("os.name").toLowerCase();
/*
public static void main(String[] args) {
System.out.println(OS);
if (isWindows()) {
System.out.println("This is Windows");
} else if (isMac()) {
System.out.println("This is Mac");
} else if (isUnix()) {
System.out.println("This is Unix or Linux");
} else if (isSolaris()) {
System.out.println("This is Solaris");
} else {
System.out.println("Your OS is not support!!");
}
}
*/
/**
*
* @return
*/
public static boolean isWindows() {
return (OS.contains("win"));
}
/**
*
* @return
*/
public static boolean isMac() {
return (OS.contains("mac"));
}
/**
*
* @return
*/
public static boolean isUnix() {
return (OS.contains("nix") || OS.contains("nux") || OS.indexOf("aix") > 0);
}
/**
*
* @return
*/
public static boolean isSolaris() {
return (OS.contains("sunos"));
}
private SystemCheck() {
}
}

View File

@ -148,6 +148,10 @@ public class Runner extends Application{
btn25.setOnAction(event -> new simonlightgame.Main().start(new Stage())); btn25.setOnAction(event -> new simonlightgame.Main().start(new Stage()));
gridpane.add(btn25, 0, 10); gridpane.add(btn25, 0, 10);
Button btn26 = new Button("Start Steganographie Tool");
btn26.setOnAction(event -> new steganography.Main().start(new Stage()));
gridpane.add(btn26, 1, 10);
ScrollPane root = new ScrollPane(gridpane); ScrollPane root = new ScrollPane(gridpane);
Scene scene = new Scene(root, 600, 400); Scene scene = new Scene(root, 600, 400);