Class HashedProxy

  • All Implemented Interfaces:
    Invoke, java.io.Serializable, java.rmi.Remote

    public class HashedProxy
    extends ZippedProxy
    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:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean hashed
      A flag to indicate if the payload has been hashed.
      private static long serialVersionUID  
    • Constructor Summary

      Constructors 
      Constructor Description
      HashedProxy​(java.lang.Object proxy)
      The constructor simply invokes the superclass ZippedProxy constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void hashPayload()
      A symetric hash algorithm, to convolve the array in to and out of plain text.
      private void readObject​(java.io.ObjectInputStream in)  
      private void writeObject​(java.io.ObjectOutputStream out)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • hashed

        protected transient boolean hashed
        A flag to indicate if the payload has been hashed. To reduce overhead, the payload is hashed only once per session.
    • Constructor Detail

      • HashedProxy

        public HashedProxy​(java.lang.Object proxy)
        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 Detail

      • writeObject

        private void writeObject​(java.io.ObjectOutputStream out)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • readObject

        private void readObject​(java.io.ObjectInputStream in)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.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.