// (adapted) from http://novocode.de/doc/servlet-essentials/chapter2b.html
import java.util.Vector;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class serv extends HttpServlet
{
//private Vector addresses;
//private String filename;
String temp = "";
String but="";
String plain ="";
String key="";
String cipher="";
int blockSize = 0;
int keySize =0;
String explanation = "Rijndael
To Encrypt a message using Rijndael, type message into Plaintext, " +
"type in a Key and select block size and key size (or leave as default). Click Encrypt Rijndael.
" +
"To Decrypt a cipher using Rijndael, type the ciphertext into Cipher, type in a Key and press Decrypt Rijndael. " +
"
El Gamal
To Encrypt a message for me, type in a message and leave the key blank (it will use my public " +
"key as default).
To Encrypt a message for somebody else, type a message into Plaintext and enter their Key. " +
"The public key must be of the format \"(p,g,y)\". My p,g,y values are below as an example. For further information about this work, follow this link.
" +
"It is only possible to decrypt a message for me. Type in the cipher and click Decrypt El Gamal. My private key is " +
"just that. Private.";
public void init(ServletConfig config) throws ServletException {
super.init(config);
}
protected void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException ,IOException{
res.setContentType("text/html");
res.setHeader("pragma", "no-cache");
PrintWriter out = res.getWriter();
// myPrint(out);
but="";
plain ="";
key="";
cipher="";
temp = "doGet";
myPrint(out);
}
public void myPrint(PrintWriter out){
out.print("