diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..da7b65c
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2023 Smoger
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..8187647
--- /dev/null
+++ b/README.md
@@ -0,0 +1,18 @@
+![](https://i.imgur.com/9ZmMmaq.png)
+
+# Password Generator
+This is a simple password generator application implemented in JavaFX. The application allows users to generate a strong password, a PIN, or a random string of characters. Users can choose the length of the password or PIN, whether to include numbers or symbols, and the number of numbers and symbols to include. The strength of the password is displayed using a color-coded message.
+
+# Features
+Generate a strong password, PIN or a random string of characters
+Set the length of the password or PIN
+Include or exclude numbers and symbols
+Specify the number of numbers and symbols to include
+Display the strength of the password using a color-coded message
+Copy the generated password or PIN to the clipboard
+
+# Usage
+To use the password generator application, simply run the application class. The application will display a GUI window where you can set the length of the password or PIN, whether to include numbers or symbols, and the number of numbers and symbols to include. Click on the "Generate Password" or "Generate PIN" button to generate a password or PIN respectively. The generated password or PIN will be displayed in the "Password" text field. You can also click on the "Copy" button to copy the generated password or PIN to the clipboard.
+
+# License
+This password generator application is licensed under the MIT license. Please see the LICENSE file for more information.
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..63d771e
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,180 @@
+
+
+ 4.0.0
+
+ ee.coar
+ PasswordGen
+ 1.0.0.0
+ PasswordGen
+
+
+ UTF-8
+ 5.9.1
+
+
+
+
+ org.openjfx
+ javafx-controls
+ 11
+
+
+ org.openjfx
+ javafx-fxml
+ 11
+
+
+ org.controlsfx
+ controlsfx
+ 11.1.2
+
+
+ net.synedra
+ validatorfx
+ 0.4.0
+
+
+ org.openjfx
+ *
+
+
+
+
+ org.kordamp.bootstrapfx
+ bootstrapfx-core
+ 0.4.0
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+ ${junit.version}
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ ${junit.version}
+ test
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+ 3.5.0
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 3.3.0
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.10.1
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+ 3.5.0
+
+
+
+
+
+
+ maven-assembly-plugin
+ 3.5.0
+
+
+
+ true
+ ee.coar.passwordgen.PasswordGen
+
+
+
+ jar-with-dependencies
+
+
+
+
+ make-my-jar-with-dependencies
+ package
+
+ single
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+ 3.5.0
+
+
+ copy-dependencies
+ prepare-package
+
+ copy-dependencies
+
+
+ ${project.build.directory}/lib
+ false
+ false
+ true
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 3.3.0
+
+
+
+ true
+ libs/
+
+ ee.coar.passwordgen.PasswordGen
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.10.1
+
+
+ 11
+
+
+
+ org.openjfx
+ javafx-maven-plugin
+ 0.0.8
+
+
+
+ default-cli
+
+ ee.coar.passwordgen.PasswordGen
+ app
+ app
+ app
+ true
+ true
+ true
+ PasswordGen
+
+ ${project.basedir}/src/main/resources/icons/PasswordGen.ico
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/ee/coar/passwordgen/PasswordGen.java b/src/main/java/ee/coar/passwordgen/PasswordGen.java
new file mode 100644
index 0000000..e45618b
--- /dev/null
+++ b/src/main/java/ee/coar/passwordgen/PasswordGen.java
@@ -0,0 +1,29 @@
+package ee.coar.passwordgen;
+
+import javafx.application.Application;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Scene;
+import javafx.scene.image.Image;
+import javafx.stage.Stage;
+
+import java.io.IOException;
+import java.util.Objects;
+
+public class PasswordGen extends Application {
+
+ public static void main(String[] args) {
+ launch(args);
+ }
+
+ @Override
+ public void start(Stage stage) throws IOException {
+ FXMLLoader fxmlLoader = new FXMLLoader(PasswordGen.class.getResource("pwg-layout.fxml"));
+ Scene scene = new Scene(fxmlLoader.load());
+ stage.getIcons().add(new Image(Objects.requireNonNull(this.getClass().getResourceAsStream("/icons/PasswordGen.png"))));
+ stage.setTitle("PWGEN");
+ stage.setResizable(false);
+ stage.setScene(scene);
+ stage.show();
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/ee/coar/passwordgen/application.java b/src/main/java/ee/coar/passwordgen/application.java
new file mode 100644
index 0000000..343fef1
--- /dev/null
+++ b/src/main/java/ee/coar/passwordgen/application.java
@@ -0,0 +1,217 @@
+package ee.coar.passwordgen;
+
+import javafx.fxml.FXML;
+import javafx.scene.control.*;
+import javafx.scene.input.Clipboard;
+import javafx.scene.input.ClipboardContent;
+import javafx.scene.paint.Color;
+
+import java.util.Random;
+
+
+public class application {
+ @FXML
+ public Spinner numbersLengthSpinner;
+ @FXML
+ public Spinner symbolsLengthSpinner;
+ @FXML
+ private TextField passwordField;
+ @FXML
+ private Spinner passwordLengthSpinner;
+ @FXML
+ private CheckBox includeNumbersCheckBox;
+ @FXML
+ private CheckBox includeSymbolsCheckBox;
+ @FXML
+ private Label strengthMessage;
+
+ @FXML
+ private void generatePassword() {
+ if (passwordLengthSpinner == null) {
+ return;
+ }
+ boolean includeNumbers = includeNumbersCheckBox.isSelected();
+ boolean includeSymbols = includeSymbolsCheckBox.isSelected();
+ int numNumbers = includeNumbers ? numbersLengthSpinner.getValue() : 0;
+ int numSymbols = includeSymbols ? symbolsLengthSpinner.getValue() : 0;
+
+ String password = generateRandomPassword(passwordLengthSpinner.getValue(), numNumbers, numSymbols);
+ int strength = getPasswordStrength(password);
+
+ String strengthMessageText = "";
+ Color color;
+ if (strength < 2) {
+ strengthMessageText += "Very weak";
+ color = Color.RED;
+ } else if (strength < 4) {
+ strengthMessageText += "Weak";
+ color = Color.ORANGE;
+ } else if (strength < 6) {
+ strengthMessageText += "Fair";
+ color = Color.YELLOWGREEN;
+ } else if (strength < 8) {
+ strengthMessageText += "Good";
+ color = Color.GREEN;
+ } else if (strength < 10) {
+ strengthMessageText += "Strong";
+ color = Color.BLUE;
+ } else {
+ strengthMessageText += "Very strong";
+ color = Color.PURPLE;
+ }
+
+ if (includeNumbers && numNumbers > 0) {
+ strengthMessageText += " ⟩» № " + numNumbers;
+ }
+
+ if (includeSymbols && numSymbols > 0) {
+ strengthMessageText += " «‽» " + numSymbols;
+ }
+
+
+ strengthMessage.setText(strengthMessageText);
+ strengthMessage.setTextFill(color);
+ passwordField.setText(password);
+ }
+
+ @FXML
+ private void generatePin() {
+ if (passwordLengthSpinner == null) {
+ return;
+ }
+ int length = passwordLengthSpinner.getValue();
+ StringBuilder pin = new StringBuilder();
+ Random random = new Random();
+ while (pin.length() < length) {
+ int digit = random.nextInt(10);
+ pin.append(digit);
+ }
+ for (int i = pin.length() - 1; i > 0; i--) {
+ int j = random.nextInt(i + 1);
+ char temp = pin.charAt(i);
+ pin.setCharAt(i, pin.charAt(j));
+ pin.setCharAt(j, temp);
+ }
+ passwordField.setText(pin.toString());
+ }
+
+ public int getPasswordStrength(String password) {
+ int score = 0;
+ if (password.length() < 12) {
+ score -= 1;
+ } else {
+ score += 1;
+ }
+ int numUppercase = 0;
+ int numLowercase = 0;
+ int numDigits = 0;
+ int numSpecialChars = 0;
+ for (int i = 0; i < password.length(); i++) {
+ char c = password.charAt(i);
+ if (Character.isUpperCase(c)) {
+ numUppercase++;
+ } else if (Character.isLowerCase(c)) {
+ numLowercase++;
+ } else if (Character.isDigit(c)) {
+ numDigits++;
+ } else {
+ numSpecialChars++;
+ }
+ }
+ if (numUppercase >= password.length() * 0.15) {
+ score += 1;
+ }
+ if (numLowercase >= password.length() * 0.15) {
+ score += 1;
+ }
+ if (numDigits >= password.length() * 0.15) {
+ score += 1;
+ }
+ if (numSpecialChars >= password.length() * 0.10) {
+ score += 2;
+ }
+ if (password.matches("(?=.*[0-9]).*")) {
+ score += 2;
+ }
+ if (password.matches("(?=.*[~!@#$%^&*()_+\\-={}\\[\\]|;:'\"<>,./?]).*")) {
+ score += 2;
+ }
+ if (password.matches(".*[\\p{Punct}&&[^~!@#$%^&*()_+\\-={}\\[\\]|;:'\"<>,./?]].*")) {
+ score += 2;
+ }
+ // Check for rare combinations of letters and numbers
+ String[] rareCombinations = {"qaz", "wsx", "edc", "rfv", "tgb", "yhn", "ujm", "ikl", "123", "456", "789", "0", "plo", "kmn", "qwe", "asd", "zxc", "plm", "okn", "ijb", "uhv", "ygt", "rfc", "edv", "swx", "aqz", "lkj", "hgf", "dsq", "wry", "bgt", "fgh", "vbn", "xcv", "nmk", "poi", "987", "654", "321", "098", "765", "432", "246", "135", "579", "048", "1234", "5678", "9012", "abcd", "efgh", "ijkl", "mnop", "qrst", "uvwx", "yz01", "2345", "6789", "0abc", "defg", "hijk", "lmno", "pqrs", "tuvw", "xyz1", "!@#", "$%^", "&*(", "()-", "_+=", "{}|", ":;'", "<,.", ">/?", "[\\]", "~`"};
+ for (String combination : rareCombinations) {
+ if (password.contains(combination)) {
+ score -= 1;
+ }
+ }
+
+ return score;
+ }
+
+ private String generateRandomPassword(int length, int numNumbers, int numSymbols) {
+ StringBuilder password = new StringBuilder();
+
+ // Create character sets with all required characters
+ String letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+ String numbers = "0123456789";
+ String symbols = "!@#$%^&*()_+-=";
+
+ // Calculate maximum number of numbers and symbols that can be generated
+ int maxNumbers = Math.min(numNumbers, length);
+ int maxSymbols = Math.min(numSymbols, length - maxNumbers);
+
+ // Calculate the remaining number of letters
+ int remainingLetters = length - maxNumbers - maxSymbols;
+
+ // Add remaining letters, numbers, and symbols
+ Random random = new Random();
+ for (int i = 0; i < remainingLetters; i++) {
+ int index = random.nextInt(letters.length());
+ char c = letters.charAt(index);
+ password.append(c);
+ }
+ for (int i = 0; i < maxNumbers; i++) {
+ int index = random.nextInt(password.length() + 1);
+ char c = numbers.charAt(random.nextInt(numbers.length()));
+ password.insert(index, c);
+ }
+ for (int i = 0; i < maxSymbols; i++) {
+ int index = random.nextInt(password.length() + 1);
+ char c = symbols.charAt(random.nextInt(symbols.length()));
+ password.insert(index, c);
+ }
+
+ // Shuffle the password characters
+ for (int i = password.length() - 1; i > 0; i--) {
+ int j = random.nextInt(i + 1);
+ char temp = password.charAt(i);
+ password.setCharAt(i, password.charAt(j));
+ password.setCharAt(j, temp);
+ }
+
+ return password.toString();
+ }
+
+ @FXML
+ private void initialize() {
+ passwordLengthSpinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(1, 25, 4));
+ numbersLengthSpinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(0, 10));
+ symbolsLengthSpinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(0, 10));
+
+
+ }
+
+ @FXML
+ private void copyButton() {
+ String password = passwordField.getText();
+ if (password != null && !password.isEmpty()) {
+ Clipboard clipboard = Clipboard.getSystemClipboard();
+ ClipboardContent content = new ClipboardContent();
+ content.putString(password);
+ clipboard.setContent(content);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java
new file mode 100644
index 0000000..5db127a
--- /dev/null
+++ b/src/main/java/module-info.java
@@ -0,0 +1,8 @@
+module ee.coar.passwordgen {
+ requires javafx.controls;
+ requires javafx.fxml;
+
+
+ opens ee.coar.passwordgen to javafx.fxml;
+ exports ee.coar.passwordgen;
+}
\ No newline at end of file
diff --git a/src/main/resources/META-INF/MANIFEST.MF b/src/main/resources/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..ca471f2
--- /dev/null
+++ b/src/main/resources/META-INF/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Main-Class: ee.coar.passwordgen.PasswordGen
+
diff --git a/src/main/resources/ee/coar/passwordgen/pwg-layout.fxml b/src/main/resources/ee/coar/passwordgen/pwg-layout.fxml
new file mode 100644
index 0000000..b2def9a
--- /dev/null
+++ b/src/main/resources/ee/coar/passwordgen/pwg-layout.fxml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/ee/coar/passwordgen/style.css b/src/main/resources/ee/coar/passwordgen/style.css
new file mode 100644
index 0000000..9f4a48f
--- /dev/null
+++ b/src/main/resources/ee/coar/passwordgen/style.css
@@ -0,0 +1,20 @@
+.password-strength-message {
+ -fx-font-size: 12px;
+ -fx-font-weight: bold;
+ -fx-text-fill: #000000;
+ -fx-padding: 2px 4px;
+ -fx-background-color: #e0e0e0;
+ -fx-background-radius: 4px;
+}
+
+.password-strength-message.weak {
+ -fx-background-color: #ffcccc;
+}
+
+.password-strength-message.medium {
+ -fx-background-color: #ffebcc;
+}
+
+.password-strength-message.strong {
+ -fx-background-color: #ccffcc;
+}
diff --git a/src/main/resources/icons/PasswordGen.icns b/src/main/resources/icons/PasswordGen.icns
new file mode 100644
index 0000000..30282b5
Binary files /dev/null and b/src/main/resources/icons/PasswordGen.icns differ
diff --git a/src/main/resources/icons/PasswordGen.ico b/src/main/resources/icons/PasswordGen.ico
new file mode 100644
index 0000000..cc42859
Binary files /dev/null and b/src/main/resources/icons/PasswordGen.ico differ
diff --git a/src/main/resources/icons/PasswordGen.png b/src/main/resources/icons/PasswordGen.png
new file mode 100644
index 0000000..2b3d87b
Binary files /dev/null and b/src/main/resources/icons/PasswordGen.png differ