Class Cryptic

java.lang.Object
org.opensourcephysics.controls.Cryptic

public class Cryptic extends Object
A class to represent an encrypted version of a UTF-8-encoded String.
Version:
1.0 May 2006
Author:
Doug Brown
  • Constructor Details

    • Cryptic

      protected Cryptic()
      Protected no-arg constructor has null cryptic.
    • Cryptic

      public Cryptic(String input)
      Public constructor with input string.
      Parameters:
      input - UTF-8 String to encrypt
    • Cryptic

      public Cryptic(String input, String password)
      Public constructor with input and password.
      Parameters:
      input - UTF-8 String to encrypt
      password -
  • Method Details

    • encrypt

      public String encrypt(String content)
      Encrypts the input and saves in cryptic form using a default password.
      Parameters:
      content - UTF-8 String to encrypt
      Returns:
      the encrypted content
    • encrypt

      public String encrypt(String content, String password)
      Encrypts the input with a password and saves in cryptic form.
      Parameters:
      content - UTF-8 String to encrypt
      password - password for encryption
      Returns:
      the encrypted content
    • decrypt

      public String decrypt()
      Gets the decrypted string.
      Returns:
      the decrypted string
    • decrypt

      public String decrypt(String password)
      Gets the decrypted string using a password.
      Parameters:
      password - the password
      Returns:
      the decrypted string
    • getCryptic

      public String getCryptic()
      Gets the cryptic.
      Returns:
      the encrypted version of the input
    • setCryptic

      public void setCryptic(String encrypted)
      Sets the cryptic.
      Parameters:
      encrypted - an encrypted string
    • getLoader

      public static XML.ObjectLoader getLoader()
      Returns an ObjectLoader to save and load data for this class.
      Returns:
      the object loader