VLJ Iteration II, v. 1.0.0.193

gov.va.med.foundations.utilities
Class VistaKernelHash

java.lang.Object
  |
  +--gov.va.med.foundations.utilities.VistaKernelHash

public class VistaKernelHash
extends java.lang.Object

Implements static methods to provide the encoding algorithms used by the RPC Broker and Kernel to encode and decode data strings. Using these algorithms makes it harder to sniff the contents of text sent over the network. This is not, however, encryption-class encoding, nor does it protect against replay attacks of un-decoded strings, and therefore use of this algorithm should not be considered to imply or achieve any particular level of security.

For example:

 String encodedString = VistaKernelHash.encrypt("some text to encode", true);
 

Version:
1.0.0.193
Author:
Application Modernization - Foundations Team
See Also:
VistaKernelHashCountLimitExceededException

Constructor Summary
VistaKernelHash()
           
 
Method Summary
static java.lang.String decrypt(java.lang.String encryptedText)
          Decrypts a string using the same encoding algorithm as the RPC Broker uses.
static java.lang.String encrypt(java.lang.String normalText, boolean preventEncryptionsContainingCDataSectionBoundaries)
          Encrypts a string using the same encoding algorithm as the RPC Broker uses.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VistaKernelHash

public VistaKernelHash()
Method Detail

encrypt

public static java.lang.String encrypt(java.lang.String normalText,
                                       boolean preventEncryptionsContainingCDataSectionBoundaries)
                                throws VistaKernelHashCountLimitExceededException
Encrypts a string using the same encoding algorithm as the RPC Broker uses.

Parameters:
normalText - the text to encode
preventEncryptionsContainingCDataSectionBoundaries - if true, the returned encrypted strings are guaranteed not to contain either "]]>" or "<![CDATA[". Otherwise, it is possible a returned encryption may contain those character sequences.
Returns:
an encrypted (encoded) version of the input string
Throws:
VistaHashCountLimitExceededException - if requested that the method not return a result with CData section boundaries, and if the algorithm runs up to a count limit (presently 2000 tries) without generating a result without such boundaries, an exception is thrown.
VistaKernelHashCountLimitExceededException

decrypt

public static java.lang.String decrypt(java.lang.String encryptedText)
Decrypts a string using the same encoding algorithm as the RPC Broker uses.

Parameters:
encryptedText - the text to decode
Returns:
a decrypted (decoded) version of the input string.

VLJ Iteration II, v. 1.0.0.193

VistaLink Iteration II, v. 1.0.0.193