![]() |
Page History
...
"PBEWithMD5AndDES" is the widely used algorithm used for the encryption process. Other available algorithms are "PBEWithHmacSHA1AndDESede", "AES", "Blowfish", "DES", "DESede" etc.
Initializing a Cipher Object
Code Block | ||||
---|---|---|---|---|
| ||||
cipher.init(<MODE>, _<KEY>_, <_PBEParameterSpec_>); |
...
- ENCRYPT_MODE: Encryption of data.
- DECRYPT_MODE: Decryption of data.
- WRAP_MODE: Wrapping a Key into bytes so that the key can be securely transported.
- UNWRAP_MODE: Unwrapping of a previously wrapped key into a java.security.Key object.
Encrypting and Decrypting Data
cipherBytes = cipher.doFinal(<text to encrypt/decrypt>);
...