public class PasswordBasedEncryption extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decrypt(PBEAlgo algo,
byte[] cipherTextWithIv,
char[] password,
int iterationCount,
byte[] salt) |
static byte[] |
encrypt(PBEAlgo algo,
byte[] plaintext,
char[] password,
int iterationCount,
byte[] salt)
Encrypts the message using password based encryption.
|
public static byte[] encrypt(PBEAlgo algo, byte[] plaintext, char[] password, int iterationCount, byte[] salt) throws GeneralSecurityException
algo - the encryption algorithmplaintext - the message to be encryptedpassword - the passworditerationCount - the iteration countsalt - the saltGeneralSecurityException - if error occurs.public static byte[] decrypt(PBEAlgo algo, byte[] cipherTextWithIv, char[] password, int iterationCount, byte[] salt) throws GeneralSecurityException
GeneralSecurityExceptionCopyright © 2017. All rights reserved.