Answer to Question #712 in Java | JSP | JSF for Gayethiri
I need to run this code in bluej java but, it wont allow me to. There are no syntax errors and basically im trying to encrypt a java file called "MyFriends.txt". Please help me out as its quite urgent. Below is my code thanks!
public class FileEncrypt
public static void main(String args) throws Exception
KeyGenerator keygen = KeyGenerator.getInstance("DES");
SecretKey key = keygen.generateKey();
Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
File f = new File("input.txt");
FileInputStream in = new FileInputStream("MyFriends.txt");
plainData = new byte[(int)f.length()];
encryptedData = cipher.doFinal(plainData);
FileOutputStream target = new FileOutputStream(new File("encrypted.txt"));
We can assist you with your assignment, just submit it to our site because we found the best writer for your assignment. And, please, inform about the number of Your question while submitting. Thank You.