Package com.uc4.util

Class RC4

java.lang.Object
com.uc4.util.RC4

public class RC4 extends Object
Encryption class using RC4 cipher
  • Constructor Details

    • RC4

      public RC4()
  • Method Details

    • fillString

      public static String fillString(String s, char indent, int len)
      fills a string with the given char to the given length
    • encodeWithDefaultKey

      public static String encodeWithDefaultKey(String orig, ConnectionAttributes connectionAttributes)
      Encodes the passed string with the RC4 cipher using the default key
      Parameters:
      orig - string to be encrypted
      connectionAttributes - the connection attributes to use for detecting the server version
      Returns:
      the encoded string
    • encode

      public static String encode(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 String decode(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