|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sandev.basics.util.SampleEncryptor
A sample encryptor implementation. This creates cyphertext using the username/password information for the AuthUser.
If the AuthUser given during encryption is null, then the user ID for the resulting cyphertext will be zero, which indicates that null should be used for decryption as well.
| Constructor Summary | |
SampleEncryptor()
Default ctor does nothing. |
|
| Method Summary | |
java.lang.String |
decrypt(AuthUser user,
java.lang.String str)
Decrypt the plaintext. |
java.lang.String |
encrypt(AuthUser user,
java.lang.String str)
Encrypt the plaintext. |
long |
getCypherUserID(java.lang.String cyphertext)
Return the userID for the given cyphertext. |
protected int |
getIterationCount()
The number of iterations used is generally recommended to be at least 1000, but this is a trade-off in terms of compute time. |
protected java.lang.String |
getPaddingText()
The passphrase needs to be longer than 24 characters. |
protected byte[] |
getSalt(java.lang.String base)
Return a salt value given a base string to work from. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SampleEncryptor()
| Method Detail |
protected int getIterationCount()
protected java.lang.String getPaddingText()
public java.lang.String encrypt(AuthUser user,
java.lang.String str)
throws SandEncryptorException
encrypt in interface SandEncryptorSandEncryptorException
public java.lang.String decrypt(AuthUser user,
java.lang.String str)
throws SandEncryptorException
decrypt in interface SandEncryptorSandEncryptorException
public long getCypherUserID(java.lang.String cyphertext)
throws SandEncryptorException
getCypherUserID in interface SandEncryptorSandEncryptorExceptionprotected byte[] getSalt(java.lang.String base)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||