private byte [ ] encryptInternal ( SecretKeySpec key , String toEncrypt ) { try { Cipher cipher = Cipher . getInstance ( ENCRYPTION_ALGORITHM + ENCRYPTION_ALGORITHM_MODIFIER ) ; cipher . init ( Cipher . ENCRYPT_MODE , key ) ; return cipher . doFinal ( toEncrypt . getBytes ( ENCODING ) ) ; } catch ( GeneralSecurityException e ) { throw new RuntimeException ( "Exception during decryptInternal: " + e , e ) ; } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( "Exception during encryptInternal: " + e , e ) ; } }
Internal Encryption method .