public String encrypt ( String toEncrypt ) throws DuraCloudRuntimeException { try { byte [ ] input = toEncrypt . getBytes ( "UTF-8" ) ; cipher . init ( Cipher . ENCRYPT_MODE , key ) ; byte [ ] cipherText = cipher . doFinal ( input ) ; return encodeBytes ( cipherText ) ; } catch ( Exception e ) { throw new DuraCloudRuntimeException ( e ) ; } }
Provides basic encryption on a String .