public void init(String password, String algorithm) throws NoSuchAlgorithmException, InvalidKeySpecException { init(password, algorithm, this.salt, this.iterationCount); }
public static void main(String[] args) throws Exception { FileCryptoTool fct = new FileCryptoTool(); JFrame frame = new JFrame("File Crypto Tool"); fct.initGui(frame); }
public void encryptFile(File inputFile, File outputFile) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException, IOException { Cipher cipher = Cipher.getInstance(this.algorithm); cipher.init(Cipher.ENCRYPT_MODE, this.key, this.algParamSpec); transferFileData(inputFile, outputFile, cipher); }
init(new String(passwordField.getPassword()), self.algorithm); if (encrypting) { encryptFile(inputFile, outputFile); } else { decryptFile(inputFile, outputFile);
final JComboBox algorithmComboBox = new JComboBox(listAvailablePbeCiphers()); algorithmComboBox.setSelectedItem(this.algorithm.toUpperCase()); algorithmComboBox.addActionListener(new ActionListener() {
init(new String(passwordField.getPassword()), self.algorithm); if (encrypting) { encryptFile(inputFile, outputFile); } else { decryptFile(inputFile, outputFile);
public static void main(String[] args) throws Exception { FileCryptoTool fct = new FileCryptoTool(); JFrame frame = new JFrame("File Crypto Tool"); fct.initGui(frame); }
public void decryptFile(File inputFile, File outputFile) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException, IOException { Cipher cipher = Cipher.getInstance(this.algorithm); cipher.init(Cipher.DECRYPT_MODE, this.key, this.algParamSpec); transferFileData(inputFile, outputFile, cipher); }
public void init(String password, String algorithm) throws NoSuchAlgorithmException, InvalidKeySpecException { init(password, algorithm, this.salt, this.iterationCount); }
final JComboBox algorithmComboBox = new JComboBox(listAvailablePbeCiphers()); algorithmComboBox.setSelectedItem(this.algorithm.toUpperCase()); algorithmComboBox.addActionListener(new ActionListener() {
public void decryptFile(File inputFile, File outputFile) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException, IOException { Cipher cipher = Cipher.getInstance(this.algorithm); cipher.init(Cipher.DECRYPT_MODE, this.key, this.algParamSpec); transferFileData(inputFile, outputFile, cipher); }
public void encryptFile(File inputFile, File outputFile) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException, IOException { Cipher cipher = Cipher.getInstance(this.algorithm); cipher.init(Cipher.ENCRYPT_MODE, this.key, this.algParamSpec); transferFileData(inputFile, outputFile, cipher); }