Package com.uc4.util

Class RC4


  • public class RC4
    extends java.lang.Object
    Encryption class using RC4 cipher
    • Constructor Summary

      Constructors 
      Constructor Description
      RC4()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String decode​(java.lang.String encrypted, ConnectionAttributes connectionAttributes)
      Decodes the passed string with the RC4 cipher using a key created from connection attributes
      static java.lang.String encode​(java.lang.String orig)
      Encodes the passed string with the RC4 cipher using the default key
      static java.lang.String encode​(java.lang.String orig, ConnectionAttributes connectionAttributes)
      Encodes the passed string with the RC4 cipher using a key created from connection attributes
      static java.lang.String fillString​(java.lang.String s, char indent, int len)
      fills a string with the given char to the given length
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RC4

        public RC4()
    • Method Detail

      • fillString

        public static java.lang.String fillString​(java.lang.String s,
                                                  char indent,
                                                  int len)
        fills a string with the given char to the given length
      • encode

        public static java.lang.String encode​(java.lang.String orig)
        Encodes the passed string with the RC4 cipher using the default key
        Parameters:
        orig - string to be encrypted
        Returns:
        the encoded string
      • encode

        public static java.lang.String encode​(java.lang.String orig,
                                              ConnectionAttributes connectionAttributes)
        Encodes the passed string with the RC4 cipher using a key created from connection attributes
        Parameters:
        orig - string to be encrypted
        connectionAttributes - the connection attributes to use for creating the key
        Returns:
        the encoded string
      • decode

        public static java.lang.String decode​(java.lang.String encrypted,
                                              ConnectionAttributes connectionAttributes)
        Decodes the passed string with the RC4 cipher using a key created from connection attributes
        Parameters:
        orig - string to be decrypted
        connectionAttributes - the connection attributes to use for creating the key
        Returns:
        the decoded string