-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from giorgoslivas/Version2
V2.0
- Loading branch information
Showing
38 changed files
with
628 additions
and
527 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
LRX$M5"!2b14hg#d | ||
im3$#5B9!OrHGh"0 |
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-265 Bytes
(93%)
out/production/codeGenerator/com/glivas/passGen/PassGen.class
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+1.38 KB
(200%)
out/production/codeGenerator/com/glivas/passGen/UserInt.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-122 Bytes
(98%)
out/production/codeGenerator/com/intellij/uiDesigner/core/AbstractLayout.class
Binary file not shown.
Binary file modified
BIN
-399 Bytes
(94%)
out/production/codeGenerator/com/intellij/uiDesigner/core/DimensionInfo.class
Binary file not shown.
Binary file modified
BIN
-414 Bytes
(95%)
out/production/codeGenerator/com/intellij/uiDesigner/core/GridConstraints.class
Binary file not shown.
Binary file modified
BIN
-1.1 KB
(94%)
out/production/codeGenerator/com/intellij/uiDesigner/core/GridLayoutManager.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
out/production/codeGenerator/com/intellij/uiDesigner/core/HorizontalInfo.class
Binary file not shown.
Binary file modified
BIN
-69 Bytes
(97%)
out/production/codeGenerator/com/intellij/uiDesigner/core/LayoutState.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
out/production/codeGenerator/com/intellij/uiDesigner/core/Spacer.class
Binary file not shown.
Binary file modified
BIN
-40 Bytes
(98%)
out/production/codeGenerator/com/intellij/uiDesigner/core/SupportCode$TextWithMnemonic.class
Binary file not shown.
Binary file modified
BIN
-64 Bytes
(97%)
out/production/codeGenerator/com/intellij/uiDesigner/core/SupportCode.class
Binary file not shown.
Binary file modified
BIN
-208 Bytes
(94%)
out/production/codeGenerator/com/intellij/uiDesigner/core/Util.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
out/production/codeGenerator/com/intellij/uiDesigner/core/VerticalInfo.class
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
_____ __ _____ | ||
/ ___/__ ___/ /__ / ___/__ ___ | ||
/ /__/ _ \/ _ / -_) (_ / -_) _ \ | ||
\___/\___/\_,_/\__/\___/\__/_//_/ | ||
|
||
M8!5bjC$"QPd#34a | ||
1fUW#S$!Dc8"0q3j | ||
h$kPJF42G#bd3!"8 | ||
Z#1"Vvg!2n$0IsM8 | ||
R$i3K#"Qe16W5!nw | ||
7zDn#QM03G$1!av" | ||
L!48d"#7S6$TezAc | ||
"om#Z95YPg1$!2Fi | ||
$#nqu8Nm6"07A!CB | ||
!91$8"GHo#Lly2Cq | ||
Bk"N$hdI6n4!3H#0 | ||
!9MLe#$iI1Z8q4b" | ||
!"jwH6NXL1$va49# | ||
Zqb256r"L!#3$JOg | ||
!j8D$Bw"Ti3#7tV9 | ||
"maGr$64sL5#9!WQ | ||
M60$8U!N"dgP9#hs | ||
!#V"Tp$Lm12Sb4q9 | ||
"486wOJ$Xv2hi#!L | ||
k$5G#C2cx3D!"4Hd | ||
G8$Q4qnpXg"#2E7! | ||
bf!p#B$SFa2P15"7 | ||
z1J4$Q#2!xeTkP"7 | ||
#3X"UlD5K$o8!2sm | ||
!WO#Q640sAyt$"p5 | ||
mS"x$cJK1y9#T!65 | ||
$6Zg7Xv1"4!JGr#k | ||
4t3n!m#6E"1WT$xQ | ||
!bhe"N#D$72Tt30I | ||
#J81wAl7vk5L$P!" | ||
!k50#$SGt"yi98YK | ||
nS97e!#P$2"5DQdt | ||
M6x"2$zh9JSH7#l! | ||
#12rg$T!4mUe"P5I | ||
|
||
|
||
Created by George Livas |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package com.glivas.passGen; | ||
|
||
import java.io.*; | ||
|
||
public class Holder { | ||
|
||
static String[] keyHolder; | ||
static int index = 0; | ||
|
||
public static void genCodes (int numOfCodes) { | ||
keyHolder = new String[numOfCodes]; | ||
for (int i = 0; i < keyHolder.length; i++) { | ||
keyHolder[i] = PassGen.generateCode(1); | ||
} | ||
} | ||
|
||
public static void printCodes (int codesPerLine){ | ||
|
||
for (int i = 0; i < codesPerLine; i++) { | ||
System.out.print((char)27 | ||
+ "[31;m" | ||
+ "| " | ||
+ (char)27 | ||
+ "[36;m" | ||
+ keyHolder[index] | ||
+ (char)27 | ||
+ "[31;m" | ||
+ " |" | ||
); | ||
index++; | ||
} | ||
} | ||
|
||
public static void createDocument () { | ||
BufferedWriter writer = null; | ||
try { | ||
String fileName = "Generated Codes"; | ||
File codeFile = new File(fileName); | ||
|
||
System.out.print((char)27 + "[32;m" + "The file is located at: "); | ||
System.out.println((char)27 + "[31;m" + codeFile.getCanonicalPath()); | ||
|
||
writer = new BufferedWriter(new FileWriter(codeFile)); | ||
writer.write( | ||
" _____ __ _____ \n" + | ||
" / ___/__ ___/ /__ / ___/__ ___ \n" + | ||
"/ /__/ _ \\/ _ / -_) (_ / -_) _ \\\n" + | ||
"\\___/\\___/\\_,_/\\__/\\___/\\__/_//_/\n" + | ||
" \n"); | ||
|
||
for (int i = 0; i < keyHolder.length; i++) { | ||
writer.write(keyHolder[i]); | ||
writer.write("\n"); | ||
} | ||
writer.write("\n\nCreated by George Livas"); | ||
|
||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} finally { | ||
try { | ||
|
||
writer.close(); | ||
} catch (Exception e) { | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.glivas.passGen; | ||
|
||
import java.util.Scanner; | ||
|
||
public class StartUp { | ||
public static void CodeGen () { | ||
UserInt.clearScreen(); | ||
PrintLogo.codeGen(1); | ||
|
||
System.out.println((char)27 + "[32;m" + "CodeGen is a code generator which can create codes of 16 characters\n" + | ||
"long and the user haves the ability to store them in a text file (.txt). Each password \n" + | ||
"contains 4 capital letters (A,B,C), 4 lowercase letters (a,b,c), 4 numbers (1,2,3)\n" + | ||
"and 4 special characters (!,@,£) in random order.\n" + | ||
"So the outcome is similar to this: " + (char)27 + "[31;m" + " \"$0GyLs!#fjJ\"7P49\"\n"+ (char)27 + "[32;m" + | ||
"The outcome is unpredictable and the possibility of a code been generated twice is 0,3333333%.\n\n" + (char)27 + "[36;m" + | ||
"1) To start press [enter].\n" + | ||
"2) To exit press [^c]" | ||
); | ||
|
||
Scanner sc = new Scanner(System.in); | ||
|
||
if (sc.hasNextLine()) { | ||
UserInt.startCodeGen(); | ||
} | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,123 @@ | ||
package com.glivas.passGen; | ||
|
||
import java.util.Scanner; | ||
|
||
public class UserInt { | ||
|
||
public static void clearScreen() { | ||
System.out.print("\033[H\033[2J"); | ||
System.out.flush(); | ||
for (int i = 0; i < 500; i++) { | ||
System.out.println(); | ||
} | ||
System.out.print("\033[H\033[2J"); | ||
System.out.flush(); | ||
} | ||
|
||
public static void startCodeGen () { | ||
|
||
clearScreen(); | ||
|
||
PrintLogo.codeGen(1); | ||
System.out.println(); | ||
//System.out.format("%5d", "Insert number of passwords:"); | ||
System.out.print((char)27 + "[33;m" + "Insert number of passwords:"); | ||
|
||
Scanner sc = new Scanner(System.in); | ||
int numOfCodes = sc.nextInt(); | ||
clearScreen(); | ||
PrintLogo.codeGen(1); | ||
|
||
|
||
loadTUI(numOfCodes); | ||
} | ||
|
||
public static void terminateCodeGen (int numOfPasswords) { | ||
|
||
System.out.print("\n" | ||
+ (char)27 | ||
+ "[32;m" | ||
+ numOfPasswords | ||
+ " passwords have been generated." | ||
+ (char)27 | ||
+ "[33;m" | ||
+ "\n\nDo you want to export them in a file?(.txt) [y/n]: "); | ||
Scanner sc = new Scanner(System.in); | ||
String des = sc.next(); | ||
|
||
if(des.equals("y")){ | ||
clearScreen(); | ||
Holder.createDocument(); | ||
System.out.println((char)27 + "[36;m" + "\nThanks for dropping by.\nSee you later.\n\n"); | ||
System.out.println((char)27 + "[32;m" ); | ||
} else if (des.equals("n")) { | ||
System.out.println((char)27 + "[36;m" + "\nThanks for dropping by.\nSee you later.\n\n"); | ||
System.out.println((char)27 + "[32;m" ); | ||
|
||
} | ||
|
||
|
||
} | ||
|
||
|
||
public static void loadTUI (int numOfCodes) { | ||
int numOfCols; | ||
int divNumOfPasswords; | ||
|
||
if (numOfCodes < 50) { | ||
numOfCols = 1; | ||
int numOfCols = 1; | ||
int divNumOfPasswords = 1; | ||
|
||
Holder.genCodes(numOfCodes); | ||
|
||
if (numOfCodes < 25 ){ | ||
divNumOfPasswords = numOfCodes; | ||
} else if (numOfCodes >= 50 && numOfCodes < 100) { | ||
} else if (numOfCodes >= 25 && numOfCodes <= 50) { | ||
numOfCols = 2; | ||
divNumOfPasswords =numOfCodes/2; | ||
divNumOfPasswords = numOfCodes/2; | ||
} else if (numOfCodes > 50 && numOfCodes <= 75) { | ||
numOfCols = 3; | ||
divNumOfPasswords = numOfCodes/3; | ||
} else if (numOfCodes > 75 && numOfCodes <= 100 || numOfCodes > 100) { | ||
numOfCols = 4; | ||
divNumOfPasswords = numOfCodes/4; | ||
} | ||
|
||
|
||
if (numOfCols == 1) { | ||
for (int i = 0; i < divNumOfPasswords; i++) { | ||
System.out.println((char)27 + "[31;m" + "|------------------|"); | ||
Holder.printCodes(1); | ||
System.out.println(); | ||
} | ||
terminateCodeGen(numOfCodes); | ||
} | ||
|
||
|
||
PassGen.generateCode(100); | ||
if (numOfCols == 2) { | ||
for (int i = 0; i < divNumOfPasswords; i++) { | ||
System.out.println((char)27 + "[31;m" + "|------------------||------------------|"); | ||
Holder.printCodes(2); | ||
System.out.println(); | ||
} | ||
terminateCodeGen(numOfCodes); | ||
} | ||
|
||
|
||
if (numOfCols == 3) { | ||
for (int i = 0; i < divNumOfPasswords; i++) { | ||
System.out.println((char) 27 + "[31;m" + "|------------------||------------------||------------------|"); | ||
Holder.printCodes(3); | ||
System.out.println(); | ||
} | ||
terminateCodeGen(numOfCodes); | ||
} | ||
|
||
|
||
if (numOfCols == 4) { | ||
for (int i = 0; i < divNumOfPasswords; i++) { | ||
System.out.println((char) 27 + "[31;m" + "|------------------||------------------||------------------||------------------|"); | ||
Holder.printCodes(4); | ||
System.out.println(); | ||
} | ||
terminateCodeGen(numOfCodes); | ||
} | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.