com.monica.javacom.ssh
Class MJCSSHArcfourCipher

java.lang.Object
  |
  +--com.monica.javacom.ssh.MJCSSHArcfourCipher
All Implemented Interfaces:
MJCSSHCipherAlgorithm

public class MJCSSHArcfourCipher
extends java.lang.Object
implements MJCSSHCipherAlgorithm

Class for implementing the ARCFOUR stream cipher as defined in draft-kaukonen-cipher-arcfour.


Constructor Summary
MJCSSHArcfourCipher()
           
 
Method Summary
 java.lang.String decode(java.lang.String data)
          Method for decryption of a String.
 java.lang.String encode(java.lang.String data)
          Method for encryption of a String.
 java.lang.String getCipherAlgorithmName()
          Returns the MJC name of the of the MJCSSHCipherAlgorithm.
 java.lang.String getCipherAlgorithmVersion()
          Returns the MJC version of the MJCSSHCipherAlgorithm.
 int getCipherBlockSize()
          Returns the length of the minimal encryption length.
 java.lang.Object getState()
          Returns the state of the cipher mechanism.
 void setKeys(java.lang.String key, java.lang.String IV)
          Method for setting the cryptographic key and the initialization vector.
 void setState(java.lang.Object o)
          Sets the state of the cipher mechanism.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MJCSSHArcfourCipher

public MJCSSHArcfourCipher()
Method Detail

getCipherAlgorithmName

public java.lang.String getCipherAlgorithmName()
Description copied from interface: MJCSSHCipherAlgorithm
Returns the MJC name of the of the MJCSSHCipherAlgorithm.
Specified by:
getCipherAlgorithmName in interface MJCSSHCipherAlgorithm
Following copied from interface: com.monica.javacom.interfaces.MJCSSHCipherAlgorithm
Returns:
String: the MJC name of the MJCSSHCipherAlgorithm

getCipherAlgorithmVersion

public java.lang.String getCipherAlgorithmVersion()
Description copied from interface: MJCSSHCipherAlgorithm
Returns the MJC version of the MJCSSHCipherAlgorithm.
Specified by:
getCipherAlgorithmVersion in interface MJCSSHCipherAlgorithm
Following copied from interface: com.monica.javacom.interfaces.MJCSSHCipherAlgorithm
Returns:
String: the MJC version of the MJCSSHCipherAlgorithm

setKeys

public void setKeys(java.lang.String key,
                    java.lang.String IV)
Description copied from interface: MJCSSHCipherAlgorithm
Method for setting the cryptographic key and the initialization vector.
Specified by:
setKeys in interface MJCSSHCipherAlgorithm
Following copied from interface: com.monica.javacom.interfaces.MJCSSHCipherAlgorithm
Parameters:
String - key: the key for the cryptography
string - IV: the initialization vector

setState

public void setState(java.lang.Object o)
Description copied from interface: MJCSSHCipherAlgorithm
Sets the state of the cipher mechanism.
Specified by:
setState in interface MJCSSHCipherAlgorithm
Following copied from interface: com.monica.javacom.interfaces.MJCSSHCipherAlgorithm
Parameters:
Object - o: the to be set state of the cipher mechanism

getState

public java.lang.Object getState()
Description copied from interface: MJCSSHCipherAlgorithm
Returns the state of the cipher mechanism. This state can be restored with the setState method.
Specified by:
getState in interface MJCSSHCipherAlgorithm
Following copied from interface: com.monica.javacom.interfaces.MJCSSHCipherAlgorithm
Returns:
Object: the state of the cipher mechanism

encode

public java.lang.String encode(java.lang.String data)
Description copied from interface: MJCSSHCipherAlgorithm
Method for encryption of a String. The to be encrypted String has to be of a length that is a multipy of getCipherBlockSize(). Encryption is done with the key set with setKeys(String, String).
Specified by:
encode in interface MJCSSHCipherAlgorithm
Following copied from interface: com.monica.javacom.interfaces.MJCSSHCipherAlgorithm
Parameters:
String - s: the String to be encrypted
Returns:
String: the encrypted String

decode

public java.lang.String decode(java.lang.String data)
Description copied from interface: MJCSSHCipherAlgorithm
Method for decryption of a String. The to be decrypted String has to be of a length that is a multiply of getCipherBlockSize(). Decryption is done with the key set with setKeys(String, String).
Specified by:
decode in interface MJCSSHCipherAlgorithm
Following copied from interface: com.monica.javacom.interfaces.MJCSSHCipherAlgorithm
Parameters:
String - s: the String to be decrypted
Returns:
String: the decrypted String

getCipherBlockSize

public int getCipherBlockSize()
Description copied from interface: MJCSSHCipherAlgorithm
Returns the length of the minimal encryption length. Strings for encryption/decryption have to be of a length that is a multiply of this.
Specified by:
getCipherBlockSize in interface MJCSSHCipherAlgorithm
Following copied from interface: com.monica.javacom.interfaces.MJCSSHCipherAlgorithm
Returns:
int: the minimal encryption length