分类：电脑/网络-程序设计
问题：Java中DES加密算法 
回答：三个文件：一：ey_DES.java//对称秘钥生成及对象化保存import java.io.FileOutputStream;import java.io.ObjectOutputStream;import javax.crypto.KeyGenerator;import javax.crypto.SecretKey;public class Skey_DES{  public static void main(String args[])throws Exception  {    KeyGenerator kg=KeyGenerator.getInstance("DESede");    kg.init(168);    SecretKey k=kg.generateKey();    FileOutputStream f=new FileOutputStream("key1.txt");    ObjectOutputStream b= new ObjectOutputStream(f);    b.writeObject(k);  }};二：SEnc.java//对称秘钥加密，使用字节码import java.io.*;import java.security.*;import javax.crypto.*;public class SEnc{  public static void main(String args[]) throws Exception  {    String s="Hello123Hello123Hello123Hello123";    FileInputStream f=new FileInputStream("key1.txt");    ObjectInputStream b=new ObjectInputStream(f);    Key k=(Key)b.readObject();    Cipher cp=Cipher.getInstance("DESede");    cp.init(Cipher.ENCRYPT_MODE,k);    byte ptext[]=s.getBytes("UTF8");    for(int i=0;i