question: public static SecretKey generateKey ( String key , String algorithm ) throws EncodingException { try { SecretKey skey = new SecretKeySpec ( key . getBytes ( "UTF-8" ) , algorithm ) ; return skey ; } catch ( Exception e ) { throw new EncodingException ( e ) ; } }
target:  Generate a key based on the provided secret.