public void decryptFile(EncryptedDocument doc){
    
       try {
            BufferedReader br = new BufferedReader(new FileReader(doc.getId()+".txt"));
            StringBuilder sb = new StringBuilder();

            File file = new File(doc.getId()+"-original.txt");

            // if file doesnt exists, then create it
            if (!file.exists()) {
                    file.createNewFile();
            }
            FileWriter fw = new FileWriter(file.getAbsoluteFile());
            BufferedWriter bw = new BufferedWriter(fw);

            String line = br.readLine();

            while (line != null) {
                    sb.append(line);
                    sb.append("\n");
                    line = br.readLine();

            }
            String everything = sb.toString();
            everything = decrypt(everything);
            bw.write(everything);
            bw.close();
            br.close();
            System.out.println("Archivo Desencriptado");
            
            } catch (FileNotFoundException e) {
                    e.printStackTrace();
            } catch (Exception e) {
                    e.printStackTrace();
            }
    }