return new PasswordBasedEncryptionUtil(createAndInitCipher(deriveSecretKey()), algorithmParameters, alphabet, usePadding, picketBoxCompatibility);
private Cipher createAndInitCipher(SecretKey secretKey) throws GeneralSecurityException { Cipher cipher = provider == null ? Cipher.getInstance(transformation) : Cipher.getInstance(transformation, provider); if (cipherMode == Cipher.ENCRYPT_MODE) { cipher.init(cipherMode, secretKey, generateAlgorithmParameters(parametersAlgorithm, cipherIteration, cipherSalt, null, provider)); algorithmParameters = cipher.getParameters(); } else { if (algorithmParameters != null) { cipher.init(cipherMode, secretKey, algorithmParameters); } else { cipher.init(cipherMode, secretKey, generateAlgorithmParameters(parametersAlgorithm, cipherIteration, cipherSalt, ivSpec, provider)); } } return cipher; }
return new PasswordBasedEncryptionUtil(createAndInitCipher(deriveSecretKey()), algorithmParameters, alphabet, usePadding, picketBoxCompatibility);
return new PasswordBasedEncryptionUtil(createAndInitCipher(deriveSecretKey()), algorithmParameters, alphabet, usePadding, picketBoxCompatibility);
return new PasswordBasedEncryptionUtil(createAndInitCipher(deriveSecretKey()), algorithmParameters, alphabet, usePadding, picketBoxCompatibility);
private Cipher createAndInitCipher(SecretKey secretKey) throws GeneralSecurityException { Cipher cipher = provider == null ? Cipher.getInstance(transformation) : Cipher.getInstance(transformation, provider); if (cipherMode == Cipher.ENCRYPT_MODE) { cipher.init(cipherMode, secretKey, generateAlgorithmParameters(parametersAlgorithm, cipherIteration, cipherSalt, null, provider)); algorithmParameters = cipher.getParameters(); } else { if (algorithmParameters != null) { cipher.init(cipherMode, secretKey, algorithmParameters); } else { cipher.init(cipherMode, secretKey, generateAlgorithmParameters(parametersAlgorithm, cipherIteration, cipherSalt, ivSpec, provider)); } } return cipher; }
private Cipher createAndInitCipher(SecretKey secretKey) throws GeneralSecurityException { Cipher cipher = provider == null ? Cipher.getInstance(transformation) : Cipher.getInstance(transformation, provider); if (cipherMode == Cipher.ENCRYPT_MODE) { cipher.init(cipherMode, secretKey, generateAlgorithmParameters(parametersAlgorithm, cipherIteration, cipherSalt, null, provider)); algorithmParameters = cipher.getParameters(); } else { if (algorithmParameters != null) { cipher.init(cipherMode, secretKey, algorithmParameters); } else { cipher.init(cipherMode, secretKey, generateAlgorithmParameters(parametersAlgorithm, cipherIteration, cipherSalt, ivSpec, provider)); } } return cipher; }
private Cipher createAndInitCipher(SecretKey secretKey) throws GeneralSecurityException { Cipher cipher = provider == null ? Cipher.getInstance(transformation) : Cipher.getInstance(transformation, provider); if (cipherMode == Cipher.ENCRYPT_MODE) { cipher.init(cipherMode, secretKey, generateAlgorithmParameters(parametersAlgorithm, cipherIteration, cipherSalt, null, provider)); algorithmParameters = cipher.getParameters(); } else { if (algorithmParameters != null) { cipher.init(cipherMode, secretKey, algorithmParameters); } else { cipher.init(cipherMode, secretKey, generateAlgorithmParameters(parametersAlgorithm, cipherIteration, cipherSalt, ivSpec, provider)); } } return cipher; }