Product Cipher (Java)
import java.util.*;
class ProductCipher {
public static void main(String args[]) {
System.out.println(“Enter the input to be encrypted:”);
String substitutionInput = new Scanner(System.in).nextLine();
System.out.println(“Enter a number:”);
int n = new Scanner(System.in).nextInt();
// Substitution encryption
StringBuffer substitutionOutput = new StringBuffer();
for(int i=0 ; i<substitutionInput.length() ; i++) {
char c = substitutionInput.charAt(i);
substitutionOutput.append((char) (c+5));
} Continue reading “Product Cipher (Java)”