}
if (ecipher == null) {
try {
SecretKey key;
try{
KeySpec keySpec = new PBEKeySpec(passPhrase, mSalt, iterationCount);
key = SecretKeyFactory.getInstance(mAlgorithm).generateSecret(keySpec);
}
catch (final java.security.spec.InvalidKeySpecException e) {
try {
passPhrase = URLEncoder.encode(new String(passPhrase), "UTF-8").toCharArray();
}
catch (UnsupportedEncodingException e1) {
throw e;
}
KeySpec keySpec = new PBEKeySpec(passPhrase, mSalt, iterationCount);
key = SecretKeyFactory.getInstance(mAlgorithm).generateSecret(keySpec);
}
ecipher = Cipher.getInstance(mAlgorithm);
dcipher = Cipher.getInstance(mAlgorithm);
final AlgorithmParameterSpec paramSpec = new PBEParameterSpec(mSalt, iterationCount);