Password contains methods which are useful to encrypt and decrypt passwords using symetric algorithms.
| Modifier and Type | Field and Description |
|---|---|
| private final Cipher | |
| private final IvParameterSpec | |
| private final byte[] | |
| private final SecretKeySpec |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: Decrypted phrase/passwordDecrypts the set phrase/password which was encrypted via |
| public String | Returns: Encrypted phrase/passwordEncrypts the set phrase/password with a symmetric encryption algorithm. |
| private byte[] |
| cipher | back to summary |
|---|---|
| private final Cipher cipher | |
| ivSpec | back to summary |
|---|---|
| private final IvParameterSpec ivSpec | |
| phrase | back to summary |
|---|---|
| private final byte[] phrase | |
| secretKey | back to summary |
|---|---|
| private final SecretKeySpec secretKey | |
| Password | back to summary |
|---|---|
public Password(char[] phrase, String key) throws NoSuchAlgorithmException, NoSuchPaddingException
| |
| Password | back to summary |
|---|---|
| public Password(String phrase, String key) throws NoSuchAlgorithmException, NoSuchPaddingException | |
| decrypt | back to summary |
|---|---|
| public String decrypt() throws GeneralSecurityException, UnsupportedEncodingException Decrypts the set phrase/password which was encrypted via
| |
| encrypt | back to summary |
|---|---|
| public String encrypt() throws GeneralSecurityException, UnsupportedEncodingException Encrypts the set phrase/password with a symmetric encryption algorithm.
| |
| get128BitHash | back to summary |
|---|---|
| private byte[] get128BitHash(byte[] byteArrayToHash) throws NoSuchAlgorithmException Returns a 128 bit hash using SHA-256. | |