Please anyone can help me the combine of XOR cipher , Substitution cipher and permutation cipher java coding? i already do to the coding but got some error..can anyone help me solve the error
import java. util.*;
class question1{
private final static String ALPHABET = "abcdefghijklmnopqrstuvwxyz";
public static void main (String args[])
{
Scanner in = new Scanner(System.in); //define scanner for input
String messageString;
System.out.println("Please enter the plaintext:");
messageString=in.nextLine(); //read a line
String cipherText ="";
int shft = 5;
for(int i=0;i
{
int charPosition = ALPHABET.indexOf(messageString.charAt(i));
int keyVal = (shft+charPosition)%26;
char replaceVal = this.ALPHABET.charAt(keyVal);
cipherText += replaceVal;
}
int xor;
char temp;
for(int i = 0 ; i < messageString.length() ; i++){
xor = messageString.charAt(i) ^ shft;
temp = (char)xor;
cipherText = cipherText+ temp;
}
for(int i=0;i
{
cipherText = messageString.length()^[shft[i] -1];
}
}
}
解决方案
To ''combine'' (whatever you mean with such a term) the three methods you have to first master them. That should not be difficult, after all those are ''cassic'', simple ones.
Then you have to implement your algorithm, so a good knowledge of the java programming language is required.
Once you have satisfied the above prerequisites, start coding and feel free to ask here specific questions.