/*
OTP4U 0.8.2 - One Time Pad for you
Copyright (C) 2003 Pierre Blanc
Pierre Blanc: blanc_teutoburgo@yahoo.it
http://www.teutoburgo.tk
http://it.geocities.com/teutoburgo
This program 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 2 of the License, or
(at your option) any later version.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or go to http://www.gnu.org/copyleft/gpl.html
*/
package tk.teutoburgo.otp4u.util;
/**
* OTP4U 0.9 - Class MessagesPrinter (used to print the help, warranty, etc. messages)
* Creation date: (30/08/2002 16.50.29)
* @author: Pierre Blanc
*/
public class MessagesPrinter
{
boolean isGUI=false;
public MessagesPrinter(){
}
public MessagesPrinter(boolean isGUI){
this.isGUI=isGUI;
}
public void sPrintLog
(String s
){
if (isGUI) stringLog=stringLog+s+"\n";
}
/**
* Returns to the GUI application the String of the log messages.
*/
stringLog="";
return output;
}
public void sCatchException (){
if (isGUI)
{
}
/*
* Catches an exception differently if it's within the command-line or
* the GUI application.
* @param message The exception message.
*/
public void sCatchException
(String message
){
if (isGUI)
{
stringLog=stringLog+message+"\n";
}
public void printCopyright(){
sPrintLog("OTP4U 0.8.2 Copyright (C) Pierre Blanc 2003"+
" http://www.teutoburgo.tk");
sPrintLog("This software is under"+
" the GNU GPL license v.2");
}
public void printNoWarranty(){
sPrintLog("\n BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\n"+
"FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN\n"+
"OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n"+
"PROVIDE THE PROGRAM 'AS IS' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n"+
"OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n"+
"MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\n"+
"TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\n"+
"PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n"+
"REPAIR OR CORRECTION.\n\n"+
" IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n"+
"WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n"+
"REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n"+
"INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n"+
"OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n"+
"TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n"+
"YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n"+
"PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n"+
"POSSIBILITY OF SUCH DAMAGES.");
}
public void printHelpGUI(){
sPrintLog("\nThere's a short tutorial in the readme.txt file");
sPrintLog("Use the Encipher/Decipher buttons to operate on the selected file");
sPrintLog("The first time you need to generate K4K0 (see the Configure tab)");
sPrintLog("Use relative names if your files are in the otp4u/plaintexts or ciphertexts directories");
sPrintLog("Either you can choose every file pressing the 'File' button");
sPrintLog("You can use multiple configuration files:");
sPrintLog("to select another, type its name (it has to be in the"+
" otp4u/config direcory) or press 'Select configuration'");
sPrintLog("If your key isn't large enough, simply press 'New entropy -> Public'");
sPrintLog("If you need to retrieve the private key (key4message.rnd) from the public key press 'Random'");
sPrintLog("You can change its size either from the textfield or from the config file.");
sPrintLog("For mixed mode refer to the readme.txt file.");
sPrintLog("For more detailed help refer to the OTP4U manual in the OTP4U/doc directory.");
}
public void printLicenseGUI(){
sPrintLog("OTP4U comes with ABSOLUTELY NO WARRANTY; for details: Help->Warranty");
sPrintLog("This is free software, and you are welcome to redistribute it"+
" under certain\nconditions; for details see the gpl.txt file in the otp4u/doc directory.");
}
public void printHelp() {
sPrintLog("OTP4U comes with ABSOLUTELY NO WARRANTY; for details: otp4uwin w");
sPrintLog("This is free software, and you are welcome to redistribute it"+
" under certain\nconditions; for details see the gpl.txt file.");
sPrintLog("Usage (under Unix type otp4ux instead of otp4uwin):\n");
sPrintLog("otp4uwin option [parameter]");
sPrintLog("");
sPrintLog("Options:");
sPrintLog("e : performs encryption (parameter: the filename to write)");
sPrintLog("d : performs decryption (parameter: the filename to write)");
sPrintLog("g : generates a pseudo-random file as entropy source"+
"\n (parameter: the file length in KB)");
sPrintLog("gk4k0 : generates key4key for the first iteration (PRNG used)");
sPrintLog("p : generates 'publicKey', key4message and key4key for next iteration");
sPrintLog("r : from a 'publicKey', creates key4message and key4key for next iteration");
sPrintLog("If no filename is specified the default file is used.");
sPrintLog("If you type only the filename OTP4U will search the file in plain/ciphertexts");
sPrintLog("");
sPrintLog("Examples: otp4uwin e supersecret.txt");
sPrintLog("Encrypts the file specified and writes it in the ciphertexts directory");
sPrintLog(" otp4uwin d supersecret.txt");
sPrintLog("Decrypts the file specified and writes it in the plaintexts directory");
sPrintLog("\nSee the readme.txt , doc/algoritm.html , doc/help.html "+
", doc/gpl.txt for more\ninformations.");
sPrintLog("OTP4U 0.9.2 Copyright (C) Pierre Blanc 2003"+
" http://www.teutoburgo.tk");
}
}