Class FieldCryptoXmlTxt0.ConcealReal

java.lang.Object
pygar.zoneable.FieldCryptoXmlTxt0.ConcealReal
Enclosing class:
FieldCryptoXmlTxt0

public class FieldCryptoXmlTxt0.ConcealReal
extends java.lang.Object
This class contains the algorithm for concealing or revealing real numbers. In Java, there are two real number types: double and float. We use double exclusively to avoid concerns about loss of accuracy.

The algorithm conceals by mapping the value in a linear fashion that cannot be reversed without the encryption key. The mapping preserves the numerical order relationship between values so that one can say the concealment effectively hides the true value but the method of hiding it falls short of some definitions of encryption because encryption, by those definitions, would randomize the order relationship in an apparently random fashion.

In the current algorithm, the linear relationship scales by a factor between a very large and a very small amount depending on the bit pattern found by encryption of the name.

If the estimated range of the values has been given in the EncryptedFieldTable, then the value will first be offset by a positive amount between vmin and vmax. The offset is applied before scaling to prevent certain roundoff errors that occur with low probability when the addition operation is performed after scaling.

  • Constructor Summary

    Constructors 
    Constructor Description
    ConcealReal()  
  • Method Summary

    Modifier and Type Method Description
    java.lang.String concealRange​(EncryptedFieldTable.Row row, java.lang.String s)
    Conceal a real range by concealing both the high and low values with the concealReal function.
    java.lang.String concealRange​(EncryptedFieldTable.Row row, EncryptedFieldTable.RealRange range)
    Conceal a real range by concealing both the high and low values with the concealReal function.
    java.lang.String concealReal​(EncryptedFieldTable.Row row, double xvalue)
    Conceal the real value contained in "xvalue" according to the description provided in the "row".
    java.lang.String concealReal​(EncryptedFieldTable.Row row, java.lang.String value)
    Conceal the real value contained in the string "value" according to the description provided in the row.
    java.lang.String revealRange​(EncryptedFieldTable.Row row, java.lang.String s)
    Reveal a real range by revealing both the high and low values with the revealReal function.
    java.lang.String revealRange​(EncryptedFieldTable.Row row, EncryptedFieldTable.RealRange range)
    Reveal a real range by revealing both the high and low values with the revealReal function.
    java.lang.String revealReal​(EncryptedFieldTable.Row row, double xvalue)
    Reveal the real value contained in "xvalue" according to the description provided in the "row".
    java.lang.String revealReal​(EncryptedFieldTable.Row row, java.lang.String value)
    Reveal the real value contained in the string "value" according to the description provided in the row.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • concealReal

      public java.lang.String concealReal​(EncryptedFieldTable.Row row, java.lang.String value) throws CryptoException
      Conceal the real value contained in the string "value" according to the description provided in the row. The concealment algorithm uses scale and offset factors determined from the encrypted value of the name - a value that appears random and can only be determined if the encryption key is known.

      Note that the name that is used for the method is partially qualified name found in the EncryptedFieldTable. We do not use two other alternatives those being the fully qualified name in the document and the single, rightmost part of the qualified name.

      Parameters:
      row - from EncryptedFieldTable that describes the field
      value -
      Returns:
      concealed value
      Throws:
      CryptoException
    • revealReal

      public java.lang.String revealReal​(EncryptedFieldTable.Row row, java.lang.String value) throws CryptoException
      Reveal the real value contained in the string "value" according to the description provided in the row. Reverse the concealment algorithm performed by function concealReal.
      Parameters:
      row - from EncryptedFieldTable that describes the field
      value - - concealed real value
      Returns:
      clear text real value
      Throws:
      CryptoException
    • concealReal

      public java.lang.String concealReal​(EncryptedFieldTable.Row row, double xvalue) throws CryptoException
      Conceal the real value contained in "xvalue" according to the description provided in the "row". The concealment algorithm uses scale and offset factors determined from the encrypted value of the name - a value that appears random and can only be determined if the encryption key is known.

      Note that the name that is used for the method is partially qualified name found in the EncryptedFieldTable. We do not use two other alternatives those being the fully qualified name in the document and the single, rightmost part of the qualified name.

      Parameters:
      row - from EncryptedFieldTable that describes the field
      xvalue -
      Returns:
      concealed value
      Throws:
      CryptoException
    • revealReal

      public java.lang.String revealReal​(EncryptedFieldTable.Row row, double xvalue) throws CryptoException
      Reveal the real value contained in "xvalue" according to the description provided in the "row". Reverse the effect of concealReal.
      Parameters:
      row - from EncryptedFieldTable that describes the field
      xvalue - - concealed value
      Returns:
      clear text real value
      Throws:
      CryptoException
    • concealRange

      public java.lang.String concealRange​(EncryptedFieldTable.Row row, EncryptedFieldTable.RealRange range) throws CryptoException
      Conceal a real range by concealing both the high and low values with the concealReal function.
      Parameters:
      row - from EncryptedFieldTable that describes the field
      range -
      Returns:
      concealed value range
      Throws:
      CryptoException
    • revealRange

      public java.lang.String revealRange​(EncryptedFieldTable.Row row, EncryptedFieldTable.RealRange range) throws CryptoException
      Reveal a real range by revealing both the high and low values with the revealReal function.
      Parameters:
      row - - from EncryptedFieldTable that describes the field
      range - - concealed range
      Returns:
      clear text range
      Throws:
      CryptoException
    • concealRange

      public java.lang.String concealRange​(EncryptedFieldTable.Row row, java.lang.String s) throws CryptoException
      Conceal a real range by concealing both the high and low values with the concealReal function.
      Parameters:
      row - - from EncryptedFieldTable that describes the field
      s - - a string containing a text representation of a real range
      Returns:
      a string containing the range concealed with encryption key
      Throws:
      CryptoException
    • revealRange

      public java.lang.String revealRange​(EncryptedFieldTable.Row row, java.lang.String s) throws CryptoException
      Reveal a real range by revealing both the high and low values with the revealReal function. Reverse the effect of the concealRange function.
      Parameters:
      row - - from EncryptedFieldTable that describes the field
      s - -string containing a concealed text representation of a real range
      Returns:
      clear text real range
      Throws:
      CryptoException