Kenmegne
6 days ago 4575de680f208fe13833116470664c7252e84bc8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.megatim.module.encryption;
 
import com.megatim.module.encryption.impl.AESImpl;
import com.megatim.module.encryption.ifaces.EncryptionFace;
 
/**
 *
 * @author STEPHANIE
 */
public class App {
    static String password = "megatim1";
    
    static String inputPath = "C:\\Users\\STEPHANIE\\Documents\\NetBeansProjects\\share_sources\\Encryption\\files\\symetric\\toEncrypt\\dynamicreports.pdf";
    static String outputPath = "C:\\Users\\STEPHANIE\\Documents\\NetBeansProjects\\share_sources\\Encryption\\files\\symetric\\toDecrypt\\dynamicreports.pdf";
    static String decrypt = "C:\\Users\\STEPHANIE\\Documents\\NetBeansProjects\\share_sources\\Encryption\\files\\symetric\\toDecrypt\\dynamicreports";
 
//    static String inputPath = "C:\\Users\\STEPHANIE\\Documents\\NetBeansProjects\\share_sources\\Encryption\\files\\symetric\\toEncrypt\\spring-copie.txt";
//    static String outputPath = "C:\\Users\\STEPHANIE\\Documents\\NetBeansProjects\\share_sources\\Encryption\\files\\symetric\\toDecrypt\\spring-copie.crypt";
//    static String decrypt = "C:\\Users\\STEPHANIE\\Documents\\NetBeansProjects\\share_sources\\Encryption\\files\\symetric\\toDecrypt\\spring-copie";
 
    public static void main(String[] args) throws Exception{ 
 
        EncryptionFace aes = new AESImpl();
        aes.encryptFile(password, 128, inputPath, outputPath);
        String encrypted = aes.encryptString(password, 256, "mela");
        String decrypted = aes.decryptString(password, 256, encrypted);
        System.out.println("encrypted = "+encrypted);
        System.out.println("decrypted = "+decrypted);
//        aes.encryptFile(password,192,inputPath, outputPath);
//        aes.decryptFile(password,192,outputPath, decrypt);
 
    }
}