|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sandev.tools.UIProcessor.CookieEncryptor
A weak encryptor used for making cookie values harder to read. Things
like "remember me" functionality require storing authentication
information in a cookie on the client machine. Because cookies are
not necessarily sent over a secure protocol (in fact they frequently
are not), we need to encrypt the value text.
Working assumptions:
XHTMLSandUIServlet would like to accept a passphrase from
the controlling servlet as the only requirement to enable encryption.
| Field Summary | |
protected int |
iterationCount
The number of iterations used is generally recommended to be at least 1000. |
protected byte[] |
salt
Because we need to do multiple decryptions over time, we need the salt to be the same 8 bytes each time. |
| Method Summary | |
java.lang.String |
decrypt(org.sandev.basics.util.AuthUser user,
java.lang.String str)
Decrypt the plaintext. |
java.lang.String |
encrypt(org.sandev.basics.util.AuthUser user,
java.lang.String str)
Encrypt the plaintext. |
long |
getCypherUserID(java.lang.String cyphertext)
Always returns zero. |
int |
getIterationCount()
accessor for iterationCount |
byte[] |
getSalt()
accessor for salt |
void |
init(java.lang.String passPhrase)
Set up for work. |
void |
setIterationCount(int val)
mutator for iterationCount |
void |
setSalt(byte[] salt)
mutator for salt |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected byte[] salt
protected int iterationCount
| Method Detail |
public byte[] getSalt()
public void setSalt(byte[] salt)
public int getIterationCount()
public void setIterationCount(int val)
public void init(java.lang.String passPhrase)
throws org.sandev.basics.util.SandEncryptorException
org.sandev.basics.util.SandEncryptorException
public java.lang.String encrypt(org.sandev.basics.util.AuthUser user,
java.lang.String str)
throws org.sandev.basics.util.SandEncryptorException
encrypt in interface org.sandev.basics.util.SandEncryptororg.sandev.basics.util.SandEncryptorException
public java.lang.String decrypt(org.sandev.basics.util.AuthUser user,
java.lang.String str)
throws org.sandev.basics.util.SandEncryptorException
decrypt in interface org.sandev.basics.util.SandEncryptororg.sandev.basics.util.SandEncryptorException
public long getCypherUserID(java.lang.String cyphertext)
throws org.sandev.basics.util.SandEncryptorException
getCypherUserID in interface org.sandev.basics.util.SandEncryptororg.sandev.basics.util.SandEncryptorException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||