Class SimpleStringEncrypter

java.lang.Object
com.vividsolutions.jump.util.SimpleStringEncrypter

public class SimpleStringEncrypter extends Object
Provides a simple encyrption/decryption mechanism for ASCII string values. The algorithm does not provide strong encryption, but serves as a way of obfuscating the value of short strings (such as passwords). The code symbol set is drawn from the set of printable ASCII symbols. The encrypted strings are longer than the clear text (roughly double in length). A random element is used, so that different encryptions of the same clear text will result in different encodings.
  • Constructor Details

    • SimpleStringEncrypter

      public SimpleStringEncrypter()
      Creates a new encrypter
  • Method Details

    • encrypt

      public String encrypt(String clearText)
      Encrypts a string.
      Parameters:
      clearText - the string to encrypt
      Returns:
      the encryted code
    • setEncryptedSymbol

      public void setEncryptedSymbol(char c, char[] code, int i)
    • decrypt

      public String decrypt(String codeText)
      Decrypts a code string.
      Parameters:
      codeText - the code to decrypt
      Returns:
      the clear text for the code
      Throws:
      IllegalArgumentException - if the code string is invalid