NullCipher

  • The NullCipher class in Java cryptography provides an "identity cipher" that does not transform plaintext, resulting in ciphertext identical to the plaintext.

  • It acts as a pass-through, with initialization methods having no effect and a block size of 1 byte.

  • All encryption and decryption operations performed by NullCipher effectively return the original input data without any modifications.

  • It inherits various constants and methods from the javax.crypto.Cipher class for compatibility but overrides them to maintain its identity transformation behavior.

  • Developers might utilize NullCipher in scenarios where encryption is not desired but a Cipher object is required by an API or framework, or for testing and debugging purposes.

public class NullCipher extends Cipher

The NullCipher class is a class that provides an "identity cipher" -- one that does not transform the plain text. As a consequence, the ciphertext is identical to the plaintext. All initialization methods do nothing, while the blocksize is set to 1 byte.

Inherited Constant Summary

Public Constructor Summary

NullCipher()
Creates a NullCipher object.

Inherited Method Summary

Public Constructors

public NullCipher ()

Creates a NullCipher object.