List of Topics:
Location Research Breakthrough Possible @S-Logix pro@slogix.in

Office Address

Social List

How to Encrypt and Decrypt Data using BlowFish Algorithm in Java ?

Encrypt and Decrypt data using BlowFish Algorithm in Java

Condition for Encrypt and Decrypt Data using BlowFish Algorithm in Java

  • Description:
    Blowfish is a symmetric key block cipher designed to provide fast encryption while maintaining a high level of security. It operates on blocks of 64 bits and supports variable key lengths ranging from 32 bits to 448 bits. Blowfish is known for its efficiency in both hardware and software implementations, making it suitable for encrypting large volumes of data. The same key is used for both encryption and decryption, which requires secure key management to prevent unauthorized access.

    Blowfish uses a Feistel network structure with 16 rounds of encryption, where each round involves key-dependent permutations and substitutions. The algorithm divides the input data into fixed-size blocks, encrypting each block independently, which allows parallel processing. Blowfish also employs key expansion and data-dependent S-boxes to enhance its security, making it resistant to known cryptographic attacks such as differential and linear cryptanalysis.

    The javax.crypto package provides a straightforward way to implement Blowfish encryption and decryption using the Cipher class. Data is encrypted by initializing the cipher in encryption mode with a secret key, while decryption requires the cipher to be initialized in decryption mode using the same key.
Sample Code
  • Encryption:
    package symmetric;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.FileReader;
    import java.security.Security;
    import java.util.Base64;
    import javax.crypto.Cipher;
    import javax.crypto.SecretKey;
    import javax.crypto.spec.SecretKeySpec;
    import javax.swing.JFileChooser;
    import javax.swing.JOptionPane;
    import org.bouncycastle.jce.provider.BouncyCastleProvider;
    public class BlowFish_Alg_Encryption extends javax.swing.JFrame {
    private int result;
    SecretKey serverSecretKey;
    private String keyPath = "/home/soft20/NetBeansProjects/BlowFish/BlowFish.key";
    public BlowFish_Alg_Encryption() {
    initComponents();
    try {
    Security.addProvider(new BouncyCastleProvider());
    serverSecretKey = loadKeyFromFile(keyPath);
    } catch (Exception e) {
    System.out.println(e.getMessage());
    }
    }
    @SuppressWarnings("unchecked")
    //
    private void initComponents() {
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jTextField1 = new javax.swing.JTextField();
    jButton1 = new javax.swing.JButton();
    jLabel3 = new javax.swing.JLabel();
    jTextField2 = new javax.swing.JTextField();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTextArea1 = new javax.swing.JTextArea();
    jButton4 = new javax.swing.JButton();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    jLabel1.setText("BlowFish_ALGORITHM_ENCRYPTION");
    jLabel2.setText("File Path");
    jTextField1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jTextField1ActionPerformed(evt);
    }
    });
    jButton1.setText("Choose File");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton1ActionPerformed(evt);
    }
    });
    jLabel3.setText("File Path");
    jButton2.setText("Choose File");
    jButton2.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton2ActionPerformed(evt);
    }
    });
    jButton3.setText("ENCRYPT");
    jButton3.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton3ActionPerformed(evt);
    }
    });
    jTextArea1.setColumns(20);
    jTextArea1.setRows(5);
    jScrollPane1.setViewportView(jTextArea1);
    jButton4.setText("Secret key");
    jButton4.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton4ActionPerformed(evt);
    }
    });
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
    .addComponent(jButton1)
    .addGap(206, 206, 206))
    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
    .addComponent(jButton2)
    .addGap(208, 208, 208))))
    .addGroup(layout.createSequentialGroup()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGap(58, 58, 58)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 365, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addGroup(layout.createSequentialGroup()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(jLabel2)
    .addComponent(jLabel3))
    .addGap(26, 26, 26)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(jLabel1)
    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE).give br tag for each line
    .addComponent(jButton3)))))
    .addGroup(layout.createSequentialGroup()
    .addGap(177, 177, 177)
    .addComponent(jButton4)))
    .addContainerGap(33, Short.MAX_VALUE))
    );
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGap(22, 22, 22)
    .addComponent(jLabel1)
    .addGap(42, 42, 42)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jLabel2))
    .addGap(18, 18, 18)
    .addComponent(jButton1)
    .addGap(30, 30, 30)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jLabel3))
    .addGap(18, 18, 18)
    .addComponent(jButton2)
    .addGap(18, 18, 18)
    .addComponent(jButton3)
    .addGap(34, 34, 34)
    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addComponent(jButton4)
    .addContainerGap())
    );
    pack();
    }//

    private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:
    }
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setDialogTitle("Choose a file");
    result = fileChooser.showOpenDialog(this);
    if (result == JFileChooser.APPROVE_OPTION) {
    File selectedFile = fileChooser.getSelectedFile();
    jTextField1.setText(selectedFile.getAbsolutePath());
    } else {
    jTextField1.setText("No File Selected ");
    }
    }
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setDialogTitle("Choose a file");
    result = fileChooser.showOpenDialog(this);
    if (result == JFileChooser.APPROVE_OPTION) {
    File selectedFile = fileChooser.getSelectedFile();
    jTextField2.setText(selectedFile.getAbsolutePath());
    } else {
    jTextField2.setText("No File Selected ");
    }
    }
    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
    String inputFilePath = jTextField1.getText();
    String outputFilePath = jTextField2.getText();
    try {
    encrypt(inputFilePath, outputFilePath, serverSecretKey);
    JOptionPane.showMessageDialog(this, "File encrypted successfully.");
    } catch (Exception e) {
    System.out.println(e.getMessage());
    }
    }
    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
    display();
    }
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(() -> {
    new BlowFish_Alg_Encryption().setVisible(true);
    });
    }
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea jTextArea1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    // End of variables declaration
    private void encrypt(String inputFilePath, String outputFilePath, SecretKey serverSecretKey) {
    try {
    byte[] plainText = readFile(inputFilePath);
    Cipher cipher = Cipher.getInstance("Blowfish", "BC");
    cipher.init(Cipher.ENCRYPT_MODE, serverSecretKey);
    byte[] encryptedData = cipher.doFinal(plainText);
    try (FileOutputStream fos = new FileOutputStream(outputFilePath)) {
    fos.write(encryptedData);
    fos.flush();
    }
    System.out.println("Encryption successful. Encrypted text saved to: " + outputFilePath);
    } catch (Exception e) {
    System.out.println(e.getMessage());
    }
    }
    private void display() {
    try {
    byte[] publicKeyBytes = serverSecretKey.getEncoded();
    String res = Base64.getEncoder().encodeToString(publicKeyBytes);
    jTextArea1.setText(res);
    } catch (Exception e) {
    System.out.println(e.getMessage());
    }
    }
    private SecretKey loadKeyFromFile(String keyPath) {
    try (BufferedReader reader = new BufferedReader(new FileReader(keyPath))) {
    String base64Key = reader.readLine();
    byte[] decodedKey = Base64.getDecoder().decode(base64Key);
    return new SecretKeySpec(decodedKey, 0, decodedKey.length, "Blowfish");
    } catch (Exception e) {
    JOptionPane.showMessageDialog(this, "Error loading secret key: " + e.getMessage());
    return null;
    }
    }
    private byte[] readFile(String inputFilePath) throws Exception {
    File file = new File(inputFilePath);
    byte[] data = new byte[(int) file.length()];
    try (FileInputStream fis = new FileInputStream(file)) {
    fis.read(data);
    }
    return data;
    }
    }
  • Decryption:
    package symmetric;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.security.Security;
    import java.util.Base64;
    import javax.crypto.Cipher;
    import javax.crypto.KeyGenerator;
    import javax.crypto.SecretKey;
    import javax.swing.JFileChooser;
    import javax.swing.JOptionPane;
    import org.bouncycastle.jce.provider.BouncyCastleProvider;
    public class BlowFish_Alg_Decryption extends javax.swing.JFrame {
    private int result;
    SecretKey secretKey;
    private String keyPath = "/home/soft20/NetBeansProjects/BlowFish/BlowFish.key";
    public BlowFish_Alg_Decryption() {
    initComponents();
    try {
    Security.addProvider(new BouncyCastleProvider());
    secretKey = generateSecretKey();
    saveKeyToFile(secretKey, keyPath);
    } catch (Exception e) {
    System.out.println(e.getMessage());
    }
    }
    @SuppressWarnings("unchecked")
    //
    private void initComponents() {
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jTextField1 = new javax.swing.JTextField();
    jButton1 = new javax.swing.JButton();
    jLabel3 = new javax.swing.JLabel();
    jTextField2 = new javax.swing.JTextField();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTextArea1 = new javax.swing.JTextArea();
    jButton4 = new javax.swing.JButton();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    jLabel1.setText("BlowFish_ALGORITHM_DECRYPTION");
    jLabel2.setText("File Path");
    jTextField1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jTextField1ActionPerformed(evt);
    }
    });
    jButton1.setText("Choose File");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton1ActionPerformed(evt);
    }
    });
    jLabel3.setText("File Path");
    jButton2.setText("Choose File");
    jButton2.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton2ActionPerformed(evt);
    }
    });
    jButton3.setText("DECRYPT");
    jButton3.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton3ActionPerformed(evt);
    }
    });
    jTextArea1.setColumns(20);
    jTextArea1.setRows(5);
    jScrollPane1.setViewportView(jTextArea1);
    jButton4.setText("Secret key");
    jButton4.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton4ActionPerformed(evt);
    }
    });
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
    .addComponent(jButton1)
    .addGap(206, 206, 206))
    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
    .addComponent(jButton2)
    .addGap(208, 208, 208))))
    .addGroup(layout.createSequentialGroup()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGap(58, 58, 58)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.
    LEADING)
    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 365, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addGroup(layout.createSequentialGroup()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(jLabel2)
    .addComponent(jLabel3))
    .addGap(26, 26, 26)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(jLabel1)
    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jButton3)))))
    .addGroup(layout.createSequentialGroup()
    .addGap(177, 177, 177)
    .addComponent(jButton4)))
    .addContainerGap(42, Short.MAX_VALUE))
    );
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGap(22, 22, 22)
    .addComponent(jLabel1)
    .addGap(42, 42, 42)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jLabel2))
    .addGap(18, 18, 18)
    .addComponent(jButton1)
    .addGap(30, 30, 30)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jLabel3))
    .addGap(18, 18, 18)
    .addComponent(jButton2)
    .addGap(18, 18, 18)
    .addComponent(jButton3)
    .addGap(34, 34, 34)
    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addComponent(jButton4)
    .addContainerGap())
    );
    pack();
    }//

    private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:
    }
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setDialogTitle("Choose a file");
    result = fileChooser.showOpenDialog(this);
    if (result == JFileChooser.APPROVE_OPTION) {
    File selectedFile = fileChooser.getSelectedFile();
    jTextField1.setText(selectedFile.getAbsolutePath());
    } else {
    jTextField1.setText("No File Selected ");
    }
    }
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setDialogTitle("Choose a file");
    result = fileChooser.showOpenDialog(this);
    if (result == JFileChooser.APPROVE_OPTION) {
    File selectedFile = fileChooser.getSelectedFile();
    jTextField2.setText(selectedFile.getAbsolutePath());
    } else {
    jTextField2.setText("No File Selected ");
    }
    }
    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
    String inputFilePath = jTextField1.getText();
    String outputFilePath = jTextField2.getText();
    try {
    decrypt(inputFilePath, outputFilePath, secretKey);
    JOptionPane.showMessageDialog(this, "File decrypted successfully.");
    } catch (Exception e) {
    System.out.println(e.getMessage());
    }
    }
    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
    display();
    }
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(() -> {
    new BlowFish_Alg_Decryption().setVisible(true);
    });
    }
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea jTextArea1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    // End of variables declaration
    private void display() {
    try {
    byte[] publicKeyBytes = secretKey.getEncoded();
    String res = Base64.getEncoder().encodeToString(publicKeyBytes);
    jTextArea1.setText(res);
    } catch (Exception e) {
    System.out.println(e.getMessage());
    }
    }
    private void decrypt(String inputFilePath, String outputFilePath, SecretKey secretKey) {
    try {
    byte[] encryptedData = readFile(inputFilePath);
    Cipher cipher = Cipher.getInstance("Blowfish", "BC");
    cipher.init(Cipher.DECRYPT_MODE, secretKey);
    byte[] decryptedData = cipher.doFinal(encryptedData);
    try (FileOutputStream fos = new FileOutputStream(outputFilePath)) {
    fos.write(decryptedData);
    }
    System.out.println("Decryption complete. Decrypted data saved to " + outputFilePath);
    } catch (Exception e) {
    System.out.println(e.getMessage());
    }
    }
    private byte[] readFile(String inputFilePath) throws Exception {
    File file = new File(inputFilePath);
    byte[] data = new byte[(int) file.length()];
    try (FileInputStream fis = new FileInputStream(file)) {
    fis.read(data);
    }
    return data;
    }
    private SecretKey generateSecretKey() throws Exception {
    KeyGenerator keyGenerator = KeyGenerator.getInstance("Blowfish", "BC");
    keyGenerator.init(128);
    return keyGenerator.generateKey();
    }
    private void saveKeyToFile(SecretKey secretKey, String keyPath) throws Exception {
    byte[] encodedKey = Base64.getEncoder().encode(secretKey.getEncoded());
    try (FileOutputStream fos = new FileOutputStream(keyPath)) {
    fos.write(encodedKey);
    System.out.println("Secret key saved to: " + keyPath);
    }
    }
    }
Step 1
  • To start the encryption process, select the input file path after setting up the BlowFish encryption GUI.
  • Encrypt and Decrypt data using BlowFish Algorithm1
  • Encrypt and Decrypt data using BlowFish Algorithm2
Step 2
  • The choosen file location is indicated by the selected file path that shows up in the text field.
  • Encrypt and Decrypt data using BlowFish Algorithm3
Step 3
  • Select the path of the 'Encrypt.txt' file to begin the encryption process.
  • Encrypt and Decrypt data using BlowFish Algorithm4
Step 4
  • The path of the 'Encrypt.txt' file has been selected for encryption.
  • Encrypt and Decrypt data using BlowFish Algorithm5
Step 5
  • The files Encrypt.txt and input.txt are chosen. When the Encrypt button is clicked, encryption is successfully finished.
  • Encrypt and Decrypt data using BlowFish Algorithm6
Step 6
  • To start the decryption process, select the input file path after setting up the Blowfish decryption GUI.
  • Encrypt and Decrypt data using BlowFish Algorithm7
  • Encrypt and Decrypt data using BlowFish Algorithm8
Step 7
  • The chosen file location is indicated by the selected file path that shows up in the text field.
  • Encrypt and Decrypt data using BlowFish Algorithm9
Step 8
  • Select the path of the 'Decrypt.txt' file to begin the decryption process.
  • Encrypt and Decrypt data using BlowFish Algorithm10
Step 9
  • The path of the 'Decrypt.txt' file has been selected for decryption.
  • Encrypt and Decrypt data using BlowFish Algorithm11
Step 10
  • The files Encrypt.txt and Decrypt.txt are chosen. When the Decrypt button is clicked, decryption is successfully finished.
  • Encrypt and Decrypt data using BlowFish Algorithm12
Step 11
  • Use the same secret key for both encryption and decryption to maintain consistency and ensure accurate data retrieval.
  • Encrypt and Decrypt data using BlowFish Algorithm13
  • Encrypt and Decrypt data using BlowFish Algorithm14
  • Encrypt and Decrypt data using BlowFish Algorithm13
Step 12
  • Encryption applies to the input text file, with the result saved in the encrypt text file. Decryption restores the original content from the decrypt text file.
  • Encrypt and Decrypt data using BlowFish Algorithm16
  • Encrypt and Decrypt data using BlowFish Algorithm17
  • Encrypt and Decrypt data using BlowFish Algorithm18