Different or operations with a specified value with a specified value through different or computing symbols to change the value of each character in the string, so that the encrypted string can be obtained.
Import Java.util.Scanner; Public Class Encypt {Public Static Void Main (String ARGS []) {Scanner Scan = New Scanner (System.in); System.out.println ("Please enter An English string or decryption string : "); String password = scan.nextline (); // Get the user input char [] array = password.tocharray (); // Get the character array for (int i = 0; i <array.length; i ++) / / /Traversing the character array {array [i] = (char) (array [i]^20000); // Different or operations on each array element} System.out.println System.out.println (New String (Array));}}
Output results:
Please enter a English string or decryption string: www.sohu.com encryption or decryption result is as follows: with Pong Lares and Nai Lun
Summarize:
Putting operations can achieve many high -level and efficient operations. For example, encrypted, the N front side in the multiplication is to move the N position right, and the speed is fast.