|
Project Wonder 2.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object er.extensions.ERXCrypto
Provides a nice wrapper around the blowfish cipher and
the sha digest algorithms.
The blowfish cipher is a two-way cipher meaning the original
string that was encrypted can be retrieved. The blowfish
cipher uses a secret key that should be set in the System
properties using the key: ERBlowfishCipherKey. The way
that this version of the blowfish cipher is enrcypted it is
safe to use as a form value.
The sha digest uses one-way encryption to form a hash of a
given string. The digest formed is safe for use in form values
and cookies.
Field Summary | |
static int |
BLOCK_SIZE
Block size of blowfish encrypted strings |
static ERXLogger |
log
logging support |
Constructor Summary | |
ERXCrypto()
|
Method Summary | |
static String |
base64EncryptedString(String v)
DES Encrypts and then base64 encodes the passed in String using the secret key returned by secretKey . |
static String |
base64EncryptedString(String v,
Key sKey)
DES Encrypts and then base64 encodes the passed in String using the passed in secret key. |
static String |
base64HashedString(String v)
Uses the SHA hash algorithm found in the Sun JCE to hash the passed in String. |
static String |
blowfishDecode(String s)
Decodes a blowfish encoded string. |
static String |
blowfishEncode(String s)
Blowfish encodes a given string using the secret key specified in the System property: ERBlowfishCipherKey. |
static String |
bytesToString(byte[] bytes)
Deprecated. use ERXStringUtilities.byteArrayToHexString instead. |
static NSMutableDictionary |
decodedFormValuesDictionary(NSDictionary dict)
Decodes all of the values from a given dictionary using blowfish. |
static String |
decryptedBase64String(String v)
Base64 decodes and then DES decrypts the passed in string using the secret key returned by secretKey . |
static String |
decryptedBase64String(String v,
Key sKey)
Base64 decodes and then DES decrypts the passed in string using the passed in secret key. |
static Key |
secretKey(File skFile)
|
static File |
secretKeyFile()
Returns the File object holding the secret key used by this class's DES encryption routines. |
static String |
secretKeyPath()
|
static String |
secretKeyPathFramework()
|
static void |
setSecretKeyPath(String v)
|
static void |
setSecretKeyPathFramework(String v)
|
static String |
shaEncode(String string)
Sha encodes a given string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final ERXLogger log
public static final int BLOCK_SIZE
Constructor Detail |
public ERXCrypto()
Method Detail |
public static String bytesToString(byte[] bytes)
ERXStringUtilities.byteArrayToHexString
instead.
public static String shaEncode(String string)
string
- to be put through the sha digest
public static String blowfishEncode(String s)
blowfishDecode
. The
resultant string from encoding a string is safe for
use in urls and cookies.
s
- string to be encrypted
public static String blowfishDecode(String s)
blowfishEncode
.
s
- blowfish encoded string to be decoded
public static NSMutableDictionary decodedFormValuesDictionary(NSDictionary dict)
dict
- dictionary of key value pairs where the
values are blowfish encoded strings
public static String secretKeyPathFramework()
public static void setSecretKeyPathFramework(String v)
public static String secretKeyPath()
public static void setSecretKeyPath(String v)
public static String base64HashedString(String v)
public static File secretKeyFile()
public static Key secretKey(File skFile)
public static String base64EncryptedString(String v)
secretKey
. The base64 encoding is
performed to ensure that the encrypted string can be stored in places
that don't support extended character sets.
public static String base64EncryptedString(String v, Key sKey)
public static String decryptedBase64String(String v)
secretKey
.
public static String decryptedBase64String(String v, Key sKey)
|
Last updated: Do, Dez 9, 2004 12:46 PM CET | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |