import javax.crypto.*;import javax.crypto.spec.*;import java.io.*; import java.applet.*; import java.awt.*; import java.awt.event.*; public class krypteerimine extends Applet implements ActionListener{ Button nupp1=new Button("Crypt"); Button nupp2=new Button("DeCrypt"); Panel p1 = new Panel(); Panel p2 = new Panel(); TextField failinimi1 = new TextField("andmefail"); TextField failinimi2 = new TextField("krüptofail"); String fail1=""; String fail2=""; public krypteerimine(){ nupp1.addActionListener(this); nupp2.addActionListener(this); p1.add(failinimi1); p1.add(nupp1); p2.add(failinimi2); p2.add(nupp2); add(p1); add(p2); } public void actionPerformed(ActionEvent e){ String kiri = e.getActionCommand(); fail1=failinimi1.getText(); fail2=failinimi2.getText(); if (kiri.equals("Crypt")) { try{ InputStream sisse=new FileInputStream(fail1); int nr=sisse.read(); int arv=0; while(nr!=-1){ nr=sisse.read(); arv=arv+1; } System.out.println(arv); byte[] failibaidid=new byte[arv]; InputStream sisse2=new FileInputStream(fail1); int nr2=sisse2.read(); for (int i=0; i