Class NoneCipher
java.lang.Object
com.sshtools.common.ssh.components.AbstractSshCipher
com.sshtools.common.ssh.components.NoneCipher
- All Implemented Interfaces:
Component,SshCipher,SshComponent,SecureComponent
This special cipher implementation provides an unencrypted connection. This is not enabled by default and should be used with caution. To enable and use the cipher you should add the following code before you connect your SSH client.
SshConnector con = SshConnector.getInstance();
Ssh2Context ssh2Context = (Ssh2Context) con.getContext(SshConnector.SSH2);
ssh2Context.supportedCiphers().add("none", NoneCipher.class);
ssh2Context.setPreferredCipherCS("none");
ssh2Context.setPreferredCipherSC("none");
- Author:
- Lee David Painter
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface com.sshtools.common.ssh.components.SshCipher
DECRYPT_MODE, ENCRYPT_MODE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGet the cipher block size.intReturn the key length requiredvoidinit(int mode, byte[] iv, byte[] keydata) Initialize the cipher with up to 40 bytes of iv and key data.voidtransform(byte[] src, int start, byte[] dest, int offset, int len) Transform the byte array according to the cipher mode; it is legal for the source and destination arrays to reference the same physical array so care should be taken in the transformation process to safeguard this rule.Methods inherited from class com.sshtools.common.ssh.components.AbstractSshCipher
getAlgorithm, getMacLength, getPriority, getSecurityLevel, isMAC, transform
-
Constructor Details
-
NoneCipher
public NoneCipher()
-
-
Method Details
-
getBlockSize
public int getBlockSize()Get the cipher block size.- Specified by:
getBlockSizein interfaceSshCipher- Specified by:
getBlockSizein classAbstractSshCipher- Returns:
- the block size in bytes.
-
getKeyLength
public int getKeyLength()Description copied from class:AbstractSshCipherReturn the key length required- Specified by:
getKeyLengthin interfaceSshCipher- Specified by:
getKeyLengthin classAbstractSshCipher- Returns:
-
init
Initialize the cipher with up to 40 bytes of iv and key data.- Specified by:
initin interfaceSshCipher- Specified by:
initin classAbstractSshCipher- Parameters:
mode- the mode to operateiv- the initiaization vectorkeydata- the key data- Throws:
IOException
-
transform
Transform the byte array according to the cipher mode; it is legal for the source and destination arrays to reference the same physical array so care should be taken in the transformation process to safeguard this rule.- Specified by:
transformin interfaceSshCipher- Specified by:
transformin classAbstractSshCipher- Parameters:
src- byte[]start- intdest- byte[]offset- intlen- int- Throws:
IOException
-
getProviderName
- Specified by:
getProviderNamein interfaceSshCipher- Specified by:
getProviderNamein classAbstractSshCipher
-