VistALink v1.5.0.026

gov.va.med.crypto
Class VistaKernelHash

java.lang.Object
  extended bygov.va.med.crypto.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.5.0.026
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. Must be characters between ASCII 32 and 128.
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:
VistaKernelHashCountLimitExceededException - 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.

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. Must be characters between ASCII 32 and 128.
Returns:
a decrypted (decoded) version of the input string.

VistALink v1.5.0.026

VistALink v1.5.0.026