I'm working on Caesar cipher example in which I want that it get different keys from user and finally one key decrypt the original text , but I got a problem, here is my code
public static void main(String[] args) {
Scanner user_input= new Scanner(System.in);
String plainText = "University of malakand";
String key;
key = user_input.next();
Ceasercipher cc = new Ceasercipher();
String cipherText = cc.encrypt(plainText,key);
System.out.println("Your Plain Text :" + plainText);
System.out.println("Your Cipher Text :" + cipherText);
String cPlainText = cc.decrypt(cipherText,key);
System.out.println("Your Plain Text :" + cPlainText);
}
it shows an error on this line
String cipherText = cc.encrypt(plainText,key);
it shows me error on key incompatible types:
String cannot be converted into int
What can I do?