Question:
We are given with an encryption algorithm and we have to write an attack program in Java to decipher the text?
anonymous
2007-11-04 07:32:17 UTC
algois
public class StreamCipher
{
private StringBuffer plainText;
private StringBuffer cipherText;
private KeyStore keyStore;


public int blockSize = 0;

// all characters that are not recognized will be replaced by this
public static final byte PADDING_CHAR = ' ';

/**
* Initialize the Stream Cipher with the key
* @param key
*/
public StreamCipher(KeyStore key)
{
this.keyStore = key;
this.blockSize = key.getBlockSize();
}

public void setPlainText(String plainText)
{
this.plainText = this.padString(plainText.toLowerCase());
this.cipherText = null;
}

public void setCipherText(String cipherText)
{
this.cipherText = new StringBuffer(cipherText.toLowerCase());
this.plainText = null;
}


public String getCipherText()
{
return new String(cipherText);
}

public String getPlainText()
{
return new String(plainText);
}


/**
* Adds the block level padding for the strings, so that the number of characters
* are multiples of block si
Four answers:
Gary
2007-11-10 23:08:42 UTC
You might have better luck reposting your question in the Programming & Design section

.
ludlum
2016-10-15 04:05:48 UTC
properly i do no longer understand approximately C, yet while it makes use of VCL then you certainly ought to seek for encryption factors as writing cryptography code via your self is something many human beings have a PHD in computing technological know-how for. i would not advise writing crypting code your self - you will probable loose some years of your life. What you're able to do even with the undeniable fact that, is to jot down the GUI, the thread code, the enter/output circulate code etc etc. maximum needed element to bear in mind: Cryptography can take a number of of time and equipment aspects. This in turn can freeze the GUI except you nonetheless technique the needs message queue from domicile windows. as a result i might strongly advise that the crytpo stuff is done in a seperate thread which will enable the GUI to proceed fresh itself. good success.... i think of you will possibly choose it ;) J
anonymous
2007-11-04 07:36:08 UTC
Hi,

so what is the question ???
Harry
2007-11-04 07:54:57 UTC
So wut do u want wityh it??? Any questions???


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...