private byte [ ] decrypt ( final byte [ ] bytes ) throws IOException { if ( bytes . length < CcAes . BLOCK << 1 ) { throw new DecodingException ( "Invalid encrypted message format" ) ; } try { final byte [ ] vector = new byte [ CcAes . BLOCK ] ; final byte [ ] message = new byte [ bytes . length - vector . length ] ; System . arraycopy ( bytes , 0 , vector , 0 , vector . length ) ; System . arraycopy ( bytes , vector . length , message , 0 , message . length ) ; return this . cipher ( Cipher . DECRYPT_MODE , new IvParameterSpec ( vector ) ) . doFinal ( message ) ; } catch ( final BadPaddingException | IllegalBlockSizeException ex ) { throw new DecodingException ( ex ) ; } }
Decrypt the given bytes using AES .