import javax.crypto.*; import javax.crypto.spec.*; import java.io.*; public class DESKrypt3a{ public static void main(String argumendid[]) throws Exception{ byte[] sool=new byte[8]; for(int i=0; i<8; i++){ sool[i]=(byte)0xFF; } int segamiskordadearv=10; SecretKey voti=SecretKeyFactory.getInstance("PBEWithMD5AndDES").generateSecret( new PBEKeySpec(DESKrypt3.loeRida("Parool:").toCharArray()) ); Cipher kodeerija=Cipher.getInstance("PBEWithMD5AndDES"); kodeerija.init(Cipher.DECRYPT_MODE, voti, new PBEParameterSpec(sool, segamiskordadearv)); CipherInputStream salasisendvoog=new CipherInputStream( new FileInputStream("DES3.dat"), kodeerija ); int nr=salasisendvoog.read(); while(nr != -1){ System.out.print(((char)nr)); nr=salasisendvoog.read(); } System.out.println(); } }