/* * HelpTopicsDialog.java * * * ==================================================== Professional Data Security (PDS) http://crypto.brettlee.com ==================================================== Copyright (c) 2009-2011, Brett Lee All rights reserved. Portions Copyright (C) 1995-2008, Sun Microsystems, Inc. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the ORGANIZATION nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ============================================================================= */ package com.brettlee.crypto; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Insets; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTextPane; import javax.swing.text.StyledDocument; import javax.swing.text.BadLocationException; /** * HelpTopicsDialog - Help-> Help Topics "Dialog" */ class IntroductionDialog { /** * */ String newline = System.getProperty("line.separator"); public IntroductionDialog () { ///////////////////////////////////////////////////////////// // Build the Document String String[] documentString = { "***********************************************************" + newline + "Professional Data Security (PDS)" + newline + "***********************************************************" + newline + newline + newline + "TABLE OF CONTENTS:" + newline + "***********************************************************" + newline + newline + "1. ACCELERATOR KEYS" + newline + "2. QUICK START" + newline + "3. OVERVIEW OF THE APPLICATION" + newline + "4. DEFINITIONS" + newline + "5. COPYRIGHT" + newline + newline + newline + "1. ACCELERATOR KEYS:" + newline + "***********************************************************" + newline + newline + "F1 - Introduction" + newline + "F2 - New File" + newline + "F3 - View File" + newline + "F4 - Edit File" + newline + "F5 - Save File" + newline + "F7 - Close File" + newline + "F8 - Options" + newline + "F9 - About" + newline + newline + newline + "2. QUICK START:" + newline + "***********************************************************" + newline + newline + "PDS provides a secure editor, allowing you to create, view and edit " + "files securely. When a PDS file is written to disk, it is always encrypted. " + "Files created for use *within* this application are referred to as Native " + "PDS files. PDS also allows you to encrypt and decrypt other files; these " + "are referred to as External PDS files. Regardless of the type of file, " + "all PDS-encrypted files must be associated with one encryption Key. " + "Similarly, each encryption Key must be associated with one KeyStore. " + "Therefore, before you can create an encrypted file you must first create a " + "KeyStore and then create an encryption Key." + newline + newline + "It's a rather tedious process, but you only have to do it once. " + "Additionally, if you:" + newline + newline + "1) Create your KeyStore and Key using the same passphrase, and" + newline + "2) Define the newly created Key to be your Default Key," + newline + newline + "then the tedium associated with authentication will be greatly decreased." + newline + newline + "That said, you may create multiple KeyStores, each holding multiple Keys " + "each with unique passphrases." + newline + newline + "Creating a new KeyStore:" + newline + "---------------------------" + newline + "1. From the Gui, select File -> New -> KeyStore" + newline + "2. In the new dialog, type in the name of your new KeyStore (e.g. mystore). " + newline + "3. Type in a complex passphrase, twice." + newline + "4. Select Create." + newline + newline + "Creating a new Key:" + newline + "---------------------------" + newline + "1. From the Gui, select File -> New -> Key" + newline + "2. In the dialog, type in the name of your new Key (e.g. mykey)." + newline + "3. Type in a complex passphrase twice." + newline + "4. Use the file chooser to navigator and select the your KeyStore." + newline + "5. Type in the passphrase for the KeyStore." + newline + "6. Select Create." + newline + newline + "Creating a new File:" + newline + "---------------------------" + newline + "1. From the Gui, select File -> New -> PDS File" + newline + "2. In the dialog, type in the name of your new File (e.g. myfile)." + newline + "3. Select Create." + newline + "4. At the Authentication dialog, type in *only* the passphrase for the KeyStore." + newline + "5. Select Accept. Your new PDS file will be created and opened in the editor." + newline + newline + "For more information, please consult the Users Guide and/or Release Notes " + "that were distributed with this application. Or visit:" + newline + newline + "http://crypto.brettlee.com" + newline + newline + newline + "3. OVERVIEW OF THE APPLICATION:" + newline + "***********************************************************" + newline + newline + "PDS is a security application that allows you to save confidential data " + "to permanent storage in an encrypted format. The application was designed " + "to be installed on a thumb drive, with the goal of allowing you to plug " + "your thumb drive into any Java (1.6+) enabled computer to access your data." + "This application allows you to plug your thumb drive into a \"public\"" + "computer, as:" + newline + newline + "1) No temporary copies of your files are made on permanent storage." + newline + "2) Passphrases are wiped from memory (RAM) after use." + newline + newline + "Access to your data requires a Key, and every Key is protected " + "by at least one passphrase. This makes it possible to carry confidential " + "information on your thumb drive with a level of protection that " + "your data will not be compromised if the thumb " + "drive is lost or stolen." + newline + newline + "Most of us have at least several login accounts to manage. The beauty " + "of PDS is that one passphrase (or more) can provide access to all the others. " + "Just think of it, all your information is securely available to you, anytime, " + "anywhere. All you need is a modern Java Runtime Environment (JRE 1.6+)." + newline + newline + "If that was not enough, making backups of your data and keys is a snap. " + "Just a simple copy of the files using any standard utility is all it takes." + newline + newline + "To start PDS, simply copy this application (one JAR file) to your thumb drive " + "and you may securely keep your confidential data (passphrases, account numbers, " + "etc.) available for easy retrieval. As an enhancement, PDS is also delivered " + "via Java Web Start, providing additional goodies such as a Desktop icon and " + "access via the OS Control Panels." + newline + newline + "For more information, please consult the Users Guide and/or Release Notes " + "that were distributed with this application. Or visit:" + newline + newline + "http://crypto.brettlee.com" + newline + newline + newline + "4. DEFINITIONS:" + newline + "***********************************************************" + newline + newline + "PDS File:" + newline + "A file that has been encrypted using this application. PDS has two kinds " + "of files - Native files and External Files. Native files are simple \"text\" " + "files that can be edited or viewed within this application. External files " + "are files of any other format (ZIP, PDF, MP3, Word, Excel, etc.). External " + "files can be encrypted and decrypted by this application, but cannot be " + "edited or viewed as they would be with their originating application." + newline + newline + "Encoding:" + newline + "PDS files may be one of two formats - Text/Base64 or Binary. " + "Native files use the original encoding scheme, Text/Base64. Whereas " + "Native files are meant to be small text files (limited by the size " + "of the JVM), the size of an External file is limited by the OS. As the " + "overhead associated with encoding to Base64 quickly becomes significant " + "as the size increases, the encryption of External files supports " + "Base64 encoding but defaults to a Binary encoding format." + newline + newline + "KeyStore:" + newline + "A place where encryption keys are kept. A KeyStore may hold one " + "or more keys. A KeyStore is protected with a passphrase, such that " + "opening the KeyStore for any reason requires the passphrase. Reasons " + "for opening the KeyStore include browsing available keys or retrieving " + "a specific key. Inside a KeyStore, keys are referenced by their assigned " + "alias." + newline + newline + "Cipher Key (Key):" + newline + "Several bytes of data that fit into a cipher. If the cipher has the " + "appropriate (size, type) key the cipher can encrypt and decrypt data. Keys " + "are \"the keys\" and thus need to be kept in a secure place such as a " + "KeyStore. Much as a KeyStore is protected with a passphrase, each " + "key in the KeyStore is also protected by a passphrase. This passphrase " + "may be the same as the KeyStore passphrase or any other key in the " + "KeyStore, or it may be unique to that Key. Inside a KeyStore, keys " + "are referenced by their assigned alias." + newline + newline + "Cipher:" + newline + "A specific algorithm that is used to encrypt and decrypt data. Some examples " + "include the Data Encryption Standard (DES), Triple Des (3DES), and " + "Rijndael, also know as the Advanced Encryption Standard (AES)." + newline + newline + "Symmetric Key Cryptography (SKC):" + newline + "The examples mentioned above, DES, 3DES and AES are all symmetric ciphers, " + "in that they use the same key (or one easily derived) for both encryption " + "and decryption." + newline + newline + "Public Key Cryptography (PKC):" + newline + "PKC differs from the symmetric ciphers in that PKC uses two distinctly " + "different keys. Encryption can be done with either key, but decryption " + "must be done with the other key in the key pair. In practice, the owner " + "of the key pair keeps one key private and distributes the other to the " + "public. Algorithms that use this approach include RSA, DSA and ElGamal." + newline + newline + "Certificate (or Certificate Chain):" + newline + "A public key, along with a chain of certificates verifying the " + "authenticity of the public key." + newline + newline + "For more information, please consult the Users Guide and/or Release Notes " + "that were distributed with this application. Or visit:" + newline + newline + "http://crypto.brettlee.com" + newline + newline + newline + "5. COPYRIGHT:" + newline + "***********************************************************" + newline + newline + "Professional Data Security (PDS)" + newline + "Copyright (C) 2009-2011, Brett Lee" + newline + "All rights reserved." + newline + newline + "Portions Copyright (C) 1995-2008, Sun Microsystems, Inc." + newline + newline + "Redistribution and use in source and binary forms, with or without" + newline + "modification, are permitted provided that the following conditions" + newline + "are met:" + newline + newline + " * Redistributions of source code must retain the above copyright" + newline + " notice, this list of conditions and the following disclaimer." + newline + " * Redistributions in binary form must reproduce the above copyright" + newline + " notice, this list of conditions and the following disclaimer in the" + newline + " documentation and/or other materials provided with the distribution." + newline + " * Neither the name of the ORGANIZATION nor the names of its contributors" + newline + " may be used to endorse or promote products derived from this software" + newline + " without specific prior written permission." + newline + newline + "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS" + newline + "\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT" + newline + "LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS" + newline + "FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE" + newline + "COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT," + newline + "INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING," + newline + "BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;" + newline + "LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER" + newline + "CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT" + newline + "LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN" + newline + "ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE" + newline + "POSSIBILITY OF SUCH DAMAGE." + newline + newline + newline + newline }; ///////////////////////////////////////////////////////////// // Create the View JTextPane textPane = new JTextPane(); StyledDocument document = textPane.getStyledDocument(); try { for (int i=0; i < documentString.length; i++) { document.insertString(document.getLength(), documentString[i], null); } } catch (BadLocationException ex) { System.err.println("Error creating text pane."); } textPane.setMargin( new Insets(20, 20, 20, 20) ); textPane.setEditable(false); textPane.setOpaque(true); textPane.setCaretPosition(0); JScrollPane scrollPane = new JScrollPane(textPane); scrollPane.setPreferredSize(new Dimension(580,500)); JFrame frame = new JFrame(); frame.add(scrollPane, BorderLayout.CENTER); frame.pack(); frame.setTitle("Professional Data Security (PDS) - Introduction"); frame.setVisible(true); frame.setLocationRelativeTo(null); // Display dialog front and center // frame.setLocation(0, 0); // Display in the top left corner } }