文件名称:RSA加密算法
文件大小:4KB
文件格式:CLASS
更新时间:2016-12-14 15:29:05
RSA 加密 JAVA
RSA加密算法 对文档进行加密 public void inputPQ() throws Exception { do { System.out.println("请输入素数p: "); BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); String br = stdin.readLine(); this.p = Integer.parseInt(br); } while (!primenumber(this.p)); do { System.out.println("请输入素数q: "); BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); String br = stdin.readLine(); this.q = Integer.parseInt(br); } while (!primenumber(this.q)); this.n = this.p * this.q; this.m = (p - 1) * (q - 1); System.out.println("这两个素数的乘积为p*q:" + this.n); System.out.println("所得的小于N并且与N互素的整数的个数为m=(p-1)(q-1) :" + this.m); }