Code example for Cipher

Methods: doFinalinit

0
	 
	public String decode(String encodeText){
		String str = null;
		try { 
			SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(),"AES");
			ci.init(Cipher.DECRYPT_MODE, keySpec,ips);
			byte[] d = dbs64.decodeBuffer(encodeText);
			byte[] dStr = ci.doFinal(d);
			str = new String(dStr);
		} catch (Exception e) {
			e.printStackTrace();
		}  
		return str;
	} 
	 
	public String ebcEncode(String text){
		String str = null;
		try{ 
			SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(), "TripleDES");
			ci.init(Cipher.ENCRYPT_MODE, keySpec);
Stop searching for code, let great code find you!  Add Codota to your java IDE