private byte [ ] cipherData ( final byte [ ] data ) { byte [ ] result = null ; try { final byte [ ] buffer = new byte [ this . paddedBufferedBlockCipher . getOutputSize ( data . length ) ] ; final int processedBytes = this . paddedBufferedBlockCipher . processBytes ( data , 0 , data . length , buffer , 0 ) ; final int finalBytes = this . paddedBufferedBlockCipher . doFinal ( buffer , processedBytes ) ; result = new byte [ processedBytes + finalBytes ] ; System . arraycopy ( buffer , 0 , result , 0 , result . length ) ; } catch ( final CryptoException e ) { LOG . error ( "Failed to encrypt/decrypt data array" , e ) ; } return result ; }
Encrypts or decrypts a given byte array of data