question: public static String decryptWithSymmetricKey ( String data , String encAlgorithm , String secret ) throws Exception { try { String algorithm = encAlgorithm ; if ( ! algorithm . startsWith ( "PBEWith" ) ) { algorithm = "PBEWithMD5And" + encAlgorithm ; } SecretKeyFactory skFactory = SecretKeyFactory . getInstance ( algorithm ) ; PBEKeySpec pbeKeySpec = new PBEKeySpec ( secret . toCharArray ( ) ) ; SecretKey sKey = skFactory . generateSecret ( pbeKeySpec ) ; Cipher cipher = Cipher . getInstance ( algorithm ) ; cipher . init ( Cipher . DECRYPT_MODE , sKey , pbeParameterSpec ) ; byte [ ] tmp = Base64 . decode ( data ) ; byte [ ] encData = removePrefix ( tmp ) ; byte [ ] decData = cipher . doFinal ( encData ) ; return Base64 . encode ( decData ) ; } catch ( NoSuchAlgorithmException nse ) { throw new Exception ( nse . getMessage ( ) ) ; } }
target:  Decrypts the given data with a symmetric key generated using shared secret.