public class CipherNone extends Object implements Cipher
none
, i.e. unencrypted transport.
This is used during key-exchange until the first real Cipher can be used.
The "none" algorithm specifies that no encryption is to be done. Note that this method provides no confidentiality protection, and it is NOT RECOMMENDED. Some functionality (e.g., password authentication) may be disabled for security reasons if this cipher is chosen.The implementation here consists mainly of no-ops.
DECRYPT_MODE, ENCRYPT_MODE
Constructor and Description |
---|
CipherNone() |
Modifier and Type | Method and Description |
---|---|
int |
getBlockSize()
Returns the block size of this algorithm.
|
int |
getIVSize()
Returns the size of the identity vector for this cipher.
|
void |
init(int mode,
byte[] key,
byte[] iv)
Initializes the Cipher object for a new encryption
or decryption operation.
|
boolean |
isCBC()
Checks whether this cipher is in Cipher Block Chaining mode.
|
void |
update(byte[] foo,
int s1,
int len,
byte[] bar,
int s2)
Encrypts or decrypts some more data.
|
public int getIVSize()
Cipher
public int getBlockSize()
Cipher
getBlockSize
in interface Cipher
public void init(int mode, byte[] key, byte[] iv) throws Exception
Cipher
init
in interface Cipher
mode
- one of Cipher.ENCRYPT_MODE
or Cipher.DECRYPT_MODE
.key
- the key to use for the crypting operation.iv
- the initialization vector necessary for operation.Exception
public void update(byte[] foo, int s1, int len, byte[] bar, int s2) throws Exception
Cipher
update
in interface Cipher
foo
- the array from which the plaintext (for encrypting) or
ciphertext (for decrypting) should be taken.s1
- the position in input
at which the data is
to be found.len
- the length of the input in bytes. The same number of output
bytes will be produced.bar
- the array into which the ciphertext (for encrypting) or
plaintext (for decrypting) will be written.s2
- the position in output
from which on the data
should be written.Exception
This is an inofficial Javadoc created by PaĆlo Ebermann. Have a look at the official homepage.