Blackbird
Class PAD

java.lang.Object
  extended by Blackbird.PAD
All Implemented Interfaces:
EncryptionEntity

public class PAD
extends java.lang.Object
implements EncryptionEntity

Blackbird Encryption Project.
Copyright 2008 Blackbird Encryption Project - www.ravenproject.us

   This file is part of Blackbird.

Blackbird is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Blackbird is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Blackbird. If not, see <http://www.gnu.org/licenses/>.
Changes


Field Summary
static java.lang.String strClassID
           
static java.lang.String strDecPWParamID
           
 
Fields inherited from interface Blackbird.EncryptionEntity
strBBCodeSelect, strFlatSelect, strHTMLSelect
 
Constructor Summary
PAD(int x)
           
 
Method Summary
 java.lang.String decrypt(java.lang.String strArgList)
          This is the upper level decrypt call in the class that takes an arg string assembled in the JavaScript code that is subject to an eval operation in the applet.
 boolean DOMLoaded()
          This function tests for cases of the DOM being active.
 byte[] encrypt(byte[] bToEncrypt, byte[] key)
          This is the PAD function that performs the encryption.
 java.lang.String getClassID()
          Return the class identification string.
 int getIndex()
          Returns the index number assigned in the applet on instantiation of this class.
 java.lang.String getJavaScriptCode()
          This function creates and returns the javaScript code that is subjected from there in the applet to an eval function.
 java.awt.MenuItem[] getMenuItems()
          When created in the applet, this is called upon to help build the right-click menu of the applet to aid in further operations of this class.
 int getOPCode(java.lang.String s)
          When the Applet responds to a selection of the right-click menu, it needs to know by name what to do next.
 void killPanel()
          Though inconsistent with other Blackbird encryption systems, this class does not make us this function.
 void killPanel(Blackbird.PAD.PADKeyLoadPanel o)
          This class calls on it's own version of killPanel.
 boolean loadedXML()
          This function tests for cases of the XML Data being loaded or not.
 java.lang.String parseID(java.lang.String arglist)
          parseID is used by those entities that need to single out an Identifier string needed by a using class to find out "who" created the encryption entry.
 void setFrameTarget(int i)
          setFrameTarget is used to set a variable that is concated in the Javascript generation function that is set pertaining to the "position" the applet resides in the DOM.
 void setID(java.lang.String sid)
          Not used in PAD Key Encryption
 boolean setPasswordExternally(java.lang.String p)
          The application of this interface function for the PAD class is for automatic loading of PAD Key Sequence Data.
 void showEncryptionControlPanel(int i, java.awt.Image iconImage, java.lang.Object o)
          This version of this function in this class uses the variable i to determine which of several panels to display.
 boolean testRuntime()
          This encryption object does not rely on a third party runtime to function.
 boolean usesPWIVector()
          Some Encryption entities use passwords or initialization vectors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

strDecPWParamID

public static final java.lang.String strDecPWParamID
See Also:
Constant Field Values

strClassID

public static final java.lang.String strClassID
See Also:
Constant Field Values
Constructor Detail

PAD

public PAD(int x)
Method Detail

encrypt

public byte[] encrypt(byte[] bToEncrypt,
                      byte[] key)
This is the PAD function that performs the encryption. Simply, this is XOR operations typical of One Time Pad Encryption.

Parameters:
bToEncrypt -
key -
Returns:

getJavaScriptCode

public java.lang.String getJavaScriptCode()
This function creates and returns the javaScript code that is subjected from there in the applet to an eval function. In that case the anonymous JavaScript function will perform a callback through the DOM back into the Applet, on a top level decrypt call that will use a modified index value to call back into this class and carry out decryption operations.

Specified by:
getJavaScriptCode in interface EncryptionEntity
Returns:

getMenuItems

public java.awt.MenuItem[] getMenuItems()
When created in the applet, this is called upon to help build the right-click menu of the applet to aid in further operations of this class.

Specified by:
getMenuItems in interface EncryptionEntity
Returns:

getIndex

public int getIndex()
Returns the index number assigned in the applet on instantiation of this class.

Specified by:
getIndex in interface EncryptionEntity
Returns:

killPanel

public void killPanel(Blackbird.PAD.PADKeyLoadPanel o)
This class calls on it's own version of killPanel.

Parameters:
o -

loadedXML

public boolean loadedXML()
This function tests for cases of the XML Data being loaded or not.

Returns:

DOMLoaded

public boolean DOMLoaded()
This function tests for cases of the DOM being active.

Returns:

killPanel

public void killPanel()
Though inconsistent with other Blackbird encryption systems, this class does not make us this function.

Specified by:
killPanel in interface EncryptionEntity

showEncryptionControlPanel

public void showEncryptionControlPanel(int i,
                                       java.awt.Image iconImage,
                                       java.lang.Object o)
This version of this function in this class uses the variable i to determine which of several panels to display.

Specified by:
showEncryptionControlPanel in interface EncryptionEntity
Parameters:
i -
iconImage -
o -

getOPCode

public int getOPCode(java.lang.String s)
When the Applet responds to a selection of the right-click menu, it needs to know by name what to do next. Every class in the Applets encryption class abstract vector gets called on and the menu item name compared with the class' internal menu item string that built the menu item to begin with.

Specified by:
getOPCode in interface EncryptionEntity
Parameters:
s -
Returns:

testRuntime

public boolean testRuntime()
This encryption object does not rely on a third party runtime to function.

Specified by:
testRuntime in interface EncryptionEntity
Returns:

setPasswordExternally

public boolean setPasswordExternally(java.lang.String p)
The application of this interface function for the PAD class is for automatic loading of PAD Key Sequence Data. Under normal circumstances, this information comes from the PAD Key Load Panel, but there could be cases where this class is used by another program that does not implement that control panel. The function runs in two modes depending on the String arguement given to it. One mode is for setting the internal PAD decryption password that would be used to decrypt the PAD Sequences, the other is for loading the actual PAD sequences.

Specified by:
setPasswordExternally in interface EncryptionEntity
Parameters:
p -
Returns:

decrypt

public java.lang.String decrypt(java.lang.String strArgList)
This is the upper level decrypt call in the class that takes an arg string assembled in the JavaScript code that is subject to an eval operation in the applet. This is mainly called up by the decrypt function in the applet that calls this internally. The applet, or more likely the callbacks, cannot access the vector of EncryptionEntity classes directly. This is not the case in all browsers.

Specified by:
decrypt in interface EncryptionEntity
Parameters:
strArgList -
Returns:

setFrameTarget

public void setFrameTarget(int i)
setFrameTarget is used to set a variable that is concated in the Javascript generation function that is set pertaining to the "position" the applet resides in the DOM. What is meant by "Frame Target" is the name of the frame, derived from the frames Name parameter that the applet must invoke Javascript callback results into.

Specified by:
setFrameTarget in interface EncryptionEntity
Parameters:
i -

getClassID

public java.lang.String getClassID()
Return the class identification string.

Specified by:
getClassID in interface EncryptionEntity
Returns:

usesPWIVector

public boolean usesPWIVector()
Some Encryption entities use passwords or initialization vectors. Using programs may need to know that in some cases.

Specified by:
usesPWIVector in interface EncryptionEntity
Returns:

parseID

public java.lang.String parseID(java.lang.String arglist)
parseID is used by those entities that need to single out an Identifier string needed by a using class to find out "who" created the encryption entry. This is not needed by those classes that need not single out an encryption entry for a particuler initialization vector or password. Different classes that use this might have this Identifier is different parts of comma-delimited listing.

Specified by:
parseID in interface EncryptionEntity
Parameters:
arglist -
Returns:

setID

public void setID(java.lang.String sid)
Not used in PAD Key Encryption

Specified by:
setID in interface EncryptionEntity
Parameters:
sid -