Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javaapplication2;
- import java.util.Scanner;
- public class cipher1 {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- while(true){
- System.out.print("text to encrypt: ");
- String plain_text = scan.next();
- System.out.print("encryption key(must be between 0 and 25): ");
- int encryption_key = scan.nextInt();
- System.out.println(abc.encrypt(plain_text,encryption_key));
- System.out.print("text to decrypt: ");
- String cipher_text = scan.next();
- System.out.print("encryption key(must be the same key used to encrypt the text): ");
- int decryption_key = scan.nextInt();
- System.out.println(abc.decrypt(cipher_text,decryption_key));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment