Package gnu.cajo.utils.extra
Class HashedProxy
java.lang.Object
gnu.cajo.utils.ZippedProxy
gnu.cajo.utils.extra.HashedProxy
- All Implemented Interfaces:
Invoke
,Serializable
,Remote
This class is used to hash a ZippedProxy. Primarily it is intended to
simply and quickly convert the serialized proxy representation in to, and
out of plaintext, for transmission over the network. It should be noted
that the default hashing algorithm is not cryptographically strong.
(The author lives in the United States and doesn't want to go to jail)
It's purpose is to provide a simple example encryption, which could be
sufficient for many purposes. It can always be subclassed, to employ much
more sophisticated cryptography. ;-)
The underlying paradigm is that rather than incurring the extensive computational overhead of running encrypted streams between clients and servers, it much more efficient to encrypt only those specific objects containing sensitive information. It is even stronger than conventional encrypted streams in that each object can employ different cryptography. If the client and the server both have the derived class in their local codebases; it is possible to employ 'pad' (i.e. uncrackable) cyphers.
- Version:
- 1.0, 01-Nov-99 Initial release
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
A flag to indicate if the payload has been hashed.private static final long
Fields inherited from class gnu.cajo.utils.ZippedProxy
payload, proxy
-
Constructor Summary
ConstructorsConstructorDescriptionHashedProxy
(Object proxy) The constructor simply invokes the superclass ZippedProxy constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
A symetric hash algorithm, to convolve the array in to and out of plain text.private void
private void
Methods inherited from class gnu.cajo.utils.ZippedProxy
invoke
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
hashed
protected transient boolean hashedA flag to indicate if the payload has been hashed. To reduce overhead, the payload is hashed only once per session.
-
-
Constructor Details
-
HashedProxy
The constructor simply invokes the superclass ZippedProxy constructor.- Parameters:
proxy
- The client proxy object, to be hashed at the server, and unhashed at the client.
-
-
Method Details
-
writeObject
- Throws:
IOException
-
readObject
- Throws:
IOException
ClassNotFoundException
-
hashPayload
protected void hashPayload()A symetric hash algorithm, to convolve the array in to and out of plain text. It is invoked once at the sending VM, then once at the receiving VM.
-