文件名称:用java写的凯撒加密器源码
文件大小:1KB
文件格式:RAR
更新时间:2014-06-29 15:33:52
凯撒加密器源码
package cn.jbit.encryption; import java.util.Scanner; public class Switcher { public static void main(String[] args){ System.out.println("******************欢 迎 使 用凯撒加密器******************"); Scanner input = new Scanner(System.in); System.out.print("\n请选择操作(1.加密,2.解密): "); int operator = input.nextInt(); if(operator == 1){ System.out.print("请输入待加密的字符串:"); String source = input.next(); Encryption encryption = new Encryption(); String encrytStr = encryption.encrypt(source); System.out.println("加密后的字符串是:"); System.out.println(encrytStr); }else if(operator == 2){ System.out.print("请输入待解密的字符串:"); String source = input.next(); Decryption decryption = new Decryption(); String decryptStr = decryption.decrypt(source); System.out.println("解密后的字符串是:"); System.out.println(decryptStr); }else{ System.out.println("操作失误"); } } }
【文件预览】:
Encryption.java
Decryption.java
Switcher.java