From b90c9d3b951066aaaea7b5086d96050b5bc4a35d Mon Sep 17 00:00:00 2001 From: MatMasIt <34745996+MatMasIt@users.noreply.github.com> Date: Sat, 6 Feb 2021 18:04:37 +0100 Subject: [PATCH] Added Files --- SafeBoxDecryptor/bin/BoxFileZipUtils.class | Bin 0 -> 2127 bytes SafeBoxDecryptor/bin/BoxFilter.class | Bin 0 -> 701 bytes SafeBoxDecryptor/bin/Main.class | Bin 0 -> 6816 bytes SafeBoxDecryptor/src/BoxFileZipUtils.java | 47 +++++ SafeBoxDecryptor/src/BoxFilter.java | 19 ++ SafeBoxDecryptor/src/Main.java | 194 +++++++++++++++++++++ 6 files changed, 260 insertions(+) create mode 100644 SafeBoxDecryptor/bin/BoxFileZipUtils.class create mode 100644 SafeBoxDecryptor/bin/BoxFilter.class create mode 100644 SafeBoxDecryptor/bin/Main.class create mode 100644 SafeBoxDecryptor/src/BoxFileZipUtils.java create mode 100644 SafeBoxDecryptor/src/BoxFilter.java create mode 100644 SafeBoxDecryptor/src/Main.java diff --git a/SafeBoxDecryptor/bin/BoxFileZipUtils.class b/SafeBoxDecryptor/bin/BoxFileZipUtils.class new file mode 100644 index 0000000000000000000000000000000000000000..03331d0bc0b44c97a72fe0094fedac5b5f0ed875 GIT binary patch literal 2127 zcmah~+fv(B6kW%bk#WSu=1wmpfdm^2rfo`EJC|}x>eQGvB(y+UDjOL@jO5C4Lh>hh z=yP83kj}Jbreylsnf^BdZcN%9kkI9LK_L?Ov}jE_6vsdKrfUHfmqHi>g6@vG3B?vskpn6P&9Xn zKdFe4K<7ykq_AVSi-xOHBFYd?p4kLPT&ApGiV7(sVA*?Giu4~BcD`d& zYh@CMoyAF3c41FOJqIOQtz*^Ii;tJ}ir1AYR$A}Iap6>ab>dPsnug+0AxD?jbMzdR zO(uyXKbY8o?&MRq;rm|G2sQ z`QY`VhVNvtFPPOu)8Ra^oo6b(XSaFg{-{`~xy{~=U<*C+QPi*vVhcTW*knu@-<;28 z6D(jJI~sOjvQu~)wrRqnL{>U2uwJwsY^hf(8VVmQ*(~Vr30|%F3VC0rd0P>4oZ{VJ`M@)vu*j*E4S<&F@S2`6Gxb)=S)b$s*!5x%a!L@1WYAK~Wu)FE!C z74FRsDX$qM=z$vcSPd}oAVvsch5*upaEkyWz-x_!KENo?mvD#hMmQqx;&Vcrp>G!V z7%xp_zCexym+9Gsz~7iskyjC)Q}HF8?ql@~ryL!n#GMn8&?NZ~;)7S*X{gplKQNsH zbFpFBRI3x;FtI%E#5zF-xaL(kokJ*uq|z!o`8z_vS4^_;LN5G_W7KDBJ$VQ{twa^P z38zCZ(J`b9g@S!;brhzCLUokZXWM>!`{$5S$DShLHT0W6gzL*xag>b52<-~Lt|Gx< zmE?1l?|Dp8tE5NaK6{5iniR5ljIu`|>r)uyoW4tqgN!qdeOLsaAaxrR)*{J#KfqzW o+s&0!`x2D4@LLv5RUuSts^H%?rQcFfqd1%=0?HvoM@8VPK!9mkU4RyiFz)bbw#ra6vBQ=V& zpfiX=6&)*UvU71+O(!N1EDdfD`t(*|sAs8QwL8dI0u$%G`@Itnt5|c<5%}dVKGv~8 z8hYzf>mogS)lqO5m&3*$&}#9?YVX}^KHg4%vE9?d=6$3qtn z1ns;_N#{-9>X{4Fva=p?jemYR6l zz%%w7s_vXLNZAn1#8v_Y;jD zEGqCAv(LQ55~E+#K9+f+HC7n2$469GnAe_Pqx}uF>J^L4&Yf%AyW+KzTY0&}Lz8Bi v-R9y6Z8JMQ#x5Sw@G)z$HCaBvR?*=Fb4KEHo_=R4!?jCrPT?l#=BnO5rgnz* literal 0 HcmV?d00001 diff --git a/SafeBoxDecryptor/bin/Main.class b/SafeBoxDecryptor/bin/Main.class new file mode 100644 index 0000000000000000000000000000000000000000..ee56e280af641639057ddece0fc57ae9b5023ce8 GIT binary patch literal 6816 zcmbtY3wT_`b^edE(yrE5en=J|FlK>Z^sptsfQe-rWZAN1>tQ2VLNZ`qt*)diul9<& zS1yut6RUBTo=&G3{g+AwkKIIc84OrpE2$K<%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zn?+Z5VZjW#)3}*a+^9nHKFG;~`Dyg3b{1B5$w2<{)ibcuNceOkn$G3C8_>BKx@B{8 zJdvmO9aEbrUTI8p1>bJg_gLmTl*S#LAFE2^?kYu?#*waLT4(q2_g1a{3Tmj5mZ_o^ ztFaDiv5~(!ct7sI6*zz^;ovIVf%Q1TTJAAi!~4Ot_zX6%qP`B_B=z_BuJB`Q!YORV zTi7Dty`>2CxQ}}nv;(z|`|)1AFY(T|Ox`2(t^&?^vp7m6KGa-2i--B~2WdP~O)WfH z&0{~ddDY_xhmPYT)oDE0N^O0-d)*A4p2jnj=b1D-&wY z?^D4y4f-o(*f*77{q{F(-p~er4yRN*g_Rpa<#dJrsVX^BDw2O(@{iF5)p9_3St{p4 z`N9*l3(&xb-9}&7&X`>==C-M#oUZp8Cw z=LM+)C$SGdKqq~n3%})KP6XYu5{%NcUWbBd<*l~vuPvU)~ht3n6q9%;EaEti$bn!@8!(OSJOEo-}usdOQVYJ8@6=bxdgRO1zC^_kUv=wrT!nbHPI<39KyAK&m83h$ zboIl`myWC*C@wpL81faANMi;`Lal_8($gpkvx==b!+ 0) { + fos.write(buffer, 0, len); + } + fos.close(); + return true; + } + +} diff --git a/SafeBoxDecryptor/src/BoxFilter.java b/SafeBoxDecryptor/src/BoxFilter.java new file mode 100644 index 0000000..93b0092 --- /dev/null +++ b/SafeBoxDecryptor/src/BoxFilter.java @@ -0,0 +1,19 @@ +import java.io.File; + +import javax.swing.filechooser.FileFilter; + +public class BoxFilter extends FileFilter{ + + @Override + public boolean accept(File f) { + // TODO Auto-generated method stub + if(f.isDirectory()) return true; + return f.getName().endsWith(".sfbx"); + } + + @Override + public String getDescription() { + return "SafeBox Archives"; + } + +} diff --git a/SafeBoxDecryptor/src/Main.java b/SafeBoxDecryptor/src/Main.java new file mode 100644 index 0000000..36d2e77 --- /dev/null +++ b/SafeBoxDecryptor/src/Main.java @@ -0,0 +1,194 @@ +import java.awt.Font; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; +import java.io.IOException; +import java.time.Instant; +import java.util.ArrayList; + +import javax.swing.JButton; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.SwingConstants; + +import org.json.JSONObject; + +import net.lingala.zip4j.ZipFile; +import net.lingala.zip4j.exception.ZipException; + +public class Main extends JFrame implements ActionListener{ + private JLabel chooseFiletitle,chooseFileSubTitle,fileInfoTitle,fileInfoAuthor,fileInfoCreatedDate,fileInfoNKeys,outOf,keyLabel; + private JTextArea fileInfoMessage; + private JScrollPane fileInfoMessageScrollPane; + private int nkeys; + private JTextField key; + private JButton chooseFileButton,fileInfoOpen,fileInfoBack,next,redo,finish; + private JPanel chooseFile,fileInfo,keys; + private BoxFileZipUtils bfzu; + + public void initComponents() { + //title= new JLabel("SafeBox v 1.0"); + this.setTitle("SafeBox v 1.0"); + keyLabel = new JLabel("Key: "); + outOf= new JLabel("x out of y"); + key= new JTextField(20); + next= new JButton("Next"); + redo= new JButton("Redo"); + finish= new JButton("Finish"); + + chooseFile = new JPanel(); + chooseFile.setLayout(new GridLayout(3,2)); + chooseFiletitle= new JLabel("SafeBox v 1.0"); + chooseFiletitle.setHorizontalAlignment(SwingConstants.CENTER); + chooseFiletitle.setFont(new Font("Serif", Font.PLAIN,30)); + chooseFileSubTitle= new JLabel("Decryption utility"); + chooseFileSubTitle.setHorizontalAlignment(SwingConstants.CENTER); + chooseFileSubTitle.setFont(new Font("Serif", Font.PLAIN,15)); + chooseFileButton= new JButton("Open Safe"); + + chooseFile.add(chooseFiletitle); + chooseFile.add(chooseFileSubTitle); + chooseFile.add(chooseFileButton); + chooseFile.setVisible(true); + chooseFileButton.addActionListener(this); + this.add(chooseFile); + + } + private void fileChoose() { + JFileChooser jfc = new JFileChooser(); + jfc.setFileFilter(new BoxFilter()); + jfc.setAcceptAllFileFilterUsed(false); + int rv= jfc.showOpenDialog(this); + if(rv != JFileChooser.APPROVE_OPTION) System.exit(1); + File file = jfc.getSelectedFile(); + try { + bfzu= new BoxFileZipUtils(file); + JSONObject j= bfzu.getDetails(); + this.fileInfoCreatedDate= new JLabel(Instant.ofEpochSecond(j.getLong("unixcreated")).toString()); + this.fileInfoTitle= new JLabel(j.getString("title")); + this.fileInfoAuthor= new JLabel(j.getString("author")); + this.fileInfoMessage= new JTextArea(j.getString("message")); + this.nkeys=j.getInt("nkeys"); + this.fileInfoNKeys=new JLabel(String.valueOf(this.nkeys)); + this.fileInfoMessageScrollPane= new JScrollPane(this.fileInfoMessage); + this.fileInfoOpen= new JButton("Open Safe"); + this.fileInfoBack= new JButton("Back"); + this.fileInfo = new JPanel(); + this.fileInfo.setLayout(new GridLayout(6,1)); + this.fileInfo.add(fileInfoTitle); + this.fileInfo.add(fileInfoAuthor); + this.fileInfo.add(this.fileInfoCreatedDate); + this.fileInfo.add(fileInfoMessageScrollPane); + this.fileInfo.add(this.fileInfoOpen); + this.fileInfo.add(this.fileInfoBack); + this.chooseFile.hide(); + this.add(this.fileInfo); + this.fileInfo.show(); + this.fileInfoOpen.addActionListener(this); + this.fileInfoBack.addActionListener(this); + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog(this, + "The selected file is corrupted", + "Error", + JOptionPane.ERROR_MESSAGE); + } + + } + private ArrayList getKeys(){ + ArrayList s = new ArrayList(); + for(int i=0;i