Code example for PBEKeySpec

     * @return 
     * @throws SecurityFeaturesException 
    public static SecretKey keyFromPassword(Context ctx, String password, byte[] salt) throws SecurityFeaturesException 
        PBEKeySpec spec = new PBEKeySpec(password.toCharArray(), salt, CIPHER_KEY_ITERATIONS, CIPHER_KEY_SIZE);
        SecretKeyFactory f;
        try { 
            // First convert Key to something more secure using the pbekeyspec 
            f = SecretKeyFactory.getInstance(PASSWORD_KEY_ALGORITHM);
            SecretKey x = f.generateSecret(spec);
            return x;   
        } catch (NoSuchAlgorithmException e) {
        } catch (InvalidKeySpecException e) {
Connect your IDE to all the code out there  Get Codota for Java