question: public byte [ ] encryptDataWithPrivateKey ( byte [ ] buffer , int length ) { try { Cipher cipher = Cipher . getInstance ( TTT_ENCRYPTION_ALGORITHM ) ; cipher . init ( Cipher . ENCRYPT_MODE , privateKey ) ; byte [ ] cipherData = cipher . doFinal ( buffer , 0 , length ) ; return cipherData ; } catch ( GeneralSecurityException e ) { throw new IllegalStateException ( e ) ; } }
target:  Uses private key directly to encrypt the data. Note that this is a slow method and not meant for high performance. See crypt.encryptData() for an alternative