Java中的加密问题
我采用DESede加密算法,使用sun提供的JCE包,但我已经有一个密钥了。
这个密钥是字符串形式的。现在我怎样使用这个密钥对inStr(字符串形式的明文)进行加密。
import javax.crypto.*;
String deskey = privateKey;
Cipher c1 = Cipher.getInstance("DESede");
c1.init(Cipher.ENCRYPT_MODE, deskey.getBytes());
cipherByte = c1.doFinal(inStr.getBytes());
return new String(cipherByte);
问题点数:100、回复次数:11Top




