Package org.opensourcephysics.controls
Class Cryptic
java.lang.Object
org.opensourcephysics.controls.Cryptic
A class to represent an encrypted version of a UTF-8-encoded String.
- Version:
- 1.0 May 2006
- Author:
- Doug Brown
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecrypt()
Gets the decrypted string.Gets the decrypted string using a password.Encrypts the input and saves in cryptic form using a default password.Encrypts the input with a password and saves in cryptic form.Gets the cryptic.static XML.ObjectLoader
Returns an ObjectLoader to save and load data for this class.void
setCryptic
(String encrypted) Sets the cryptic.
-
Constructor Details
-
Cryptic
protected Cryptic()Protected no-arg constructor has null cryptic. -
Cryptic
Public constructor with input string.- Parameters:
input
- UTF-8 String to encrypt
-
Cryptic
Public constructor with input and password.- Parameters:
input
- UTF-8 String to encryptpassword
-
-
-
Method Details
-
encrypt
Encrypts the input and saves in cryptic form using a default password.- Parameters:
content
- UTF-8 String to encrypt- Returns:
- the encrypted content
-
encrypt
Encrypts the input with a password and saves in cryptic form.- Parameters:
content
- UTF-8 String to encryptpassword
- password for encryption- Returns:
- the encrypted content
-
decrypt
Gets the decrypted string.- Returns:
- the decrypted string
-
decrypt
Gets the decrypted string using a password.- Parameters:
password
- the password- Returns:
- the decrypted string
-
getCryptic
Gets the cryptic.- Returns:
- the encrypted version of the input
-
setCryptic
Sets the cryptic.- Parameters:
encrypted
- an encrypted string
-
getLoader
Returns an ObjectLoader to save and load data for this class.- Returns:
- the object loader
-