Code example for DESedeKeySpec

0
	 */ 
	public static byte[] encryptTripleDES(String to_encrypt, String strkey)
	{ 
		try 
		{ 
			DESedeKeySpec desKeySpec = new DESedeKeySpec(strkey.getBytes());
			SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DESede");
			Key key = keyFactory.generateSecret(desKeySpec);
			Cipher cipher = Cipher.getInstance("DESede/ECB/PKCS5Padding");
			cipher.init(Cipher.ENCRYPT_MODE, key);
			return cipher.doFinal(to_encrypt.getBytes());
		} 
		catch (Exception e)
		{ 
			return null; 
		} 
	} 
 
	/** 
	 * TripleDES로 암호화된 문자열을 복호화 
	 *