Java tutorial
//package com.java2s; public class Main { public static String encryption(String inStr) { char[] a = inStr.toCharArray(); for (int i = 0; i < a.length; i++) { a[i] = (char) (a[i] ^ 'p'); } String s = new String(a); return s; } }