NIH | National Cancer Institute | NCI Wiki  

Error rendering macro 'rw-search'

null

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

"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
titleInitializing a Cipher Object
borderStylesolid
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>);

...