@@ -0,0 +1,2077 @@
+import java.util.Scanner;%0Apublic class CaesarCipher %7B%0A    public static String encryption(String message, int key) %7B%0A        String encryptedMessage = %22%22;%0A        char ch;%0A        for (int i = 0; i %3C message.length(); ++i) %7B%0A            ch = message.charAt(i);%0A            if (ch %3E= 'a' && ch %3C= 'z') %7B%0A                ch = (char) (ch + key);%0A                if (ch %3E 'z') %7B%0A                    ch = (char) (ch - 'z' + 'a' - 1);%0A                %7D%0A                encryptedMessage += ch;%0A            %7D else if (ch %3E= 'A' && ch %3C= 'Z') %7B%0A                ch = (char) (ch + key);%0A                if (ch %3E 'Z') %7B%0A                    ch = (char) (ch - 'Z' + 'A' - 1);%0A                %7D%0A                encryptedMessage += ch;%0A            %7D else %7B%0A                encryptedMessage += ch;%0A            %7D%0A        %7D%0A        return encryptedMessage;%0A    %7D%0A    public static String decryption(String message, int key) %7B%0A        String decryptedMessage = %22%22;%0A        char ch;%0A        for (int i = 0; i %3C message.length(); ++i) %7B%0A            ch = message.charAt(i);%0A            if (ch %3E= 'a' && ch %3C= 'z') %7B%0A                ch = (char) (ch - key);%0A                if (ch %3C 'a') %7B%0A                    ch = (char) (ch + 'z' - 'a' + 1);%0A                %7D%0A                decryptedMessage += ch;%0A            %7D else if (ch %3E= 'A' && ch %3C= 'Z') %7B%0A                ch = (char) (ch - key);%0A                if (ch %3C 'A') %7B%0A                    ch = (char) (ch + 'Z' - 'A' + 1);%0A                %7D%0A                decryptedMessage += ch;%0A            %7D else %7B%0A                decryptedMessage += ch;%0A            %7D%0A        %7D%0A        return decryptedMessage;%0A    %7D%0A    public static void main(String%5B%5D args) %7B%0A        System.out.print(%22Enter message: %22);%0A        Scanner sc = new Scanner(System.in);%0A        String message = sc.nextLine();%0A        System.out.print(%22Enter key: %22);%0A        int key = sc.nextInt();%0A        String encMsg = encryption(message, key);%0A        System.out.println(%22Encrypted message: %22 + encMsg);%0A        System.out.println(%22Decrypted message: %22 + decryption(encMsg, key));%0A    %7D%0A%7D%0A

Add Caesar Cipher