Subtrees hinzugefügt
This commit is contained in:
parent
e913ca6350
commit
7cf55ce953
53 changed files with 3807 additions and 0 deletions
25
Quellcodes/iud_key_rsachat/TestRSA.java
Normal file
25
Quellcodes/iud_key_rsachat/TestRSA.java
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/**
|
||||
*
|
||||
* description
|
||||
*
|
||||
* @version 1.0 from 20.01.2016
|
||||
* @author
|
||||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Random;
|
||||
public class TestRSA {
|
||||
|
||||
public static void main(String[] args) {
|
||||
RSA rsa = new RSA();
|
||||
Key k1 = rsa.getPublicKey();
|
||||
Key k2 = rsa.getPrivateKey();
|
||||
System.out.println("Keys generiert");
|
||||
BigInteger i = BigInteger.valueOf(100);
|
||||
BigInteger j = k1.encrypt(i);
|
||||
BigInteger z = k2.encrypt(j);
|
||||
System.out.println(i.toString()+"\n"+j.toString()+"\n"+z.toString());
|
||||
System.out.println(k1.encrypt(k2.encrypt("Hallo Leute, dies ist ein langer Text")).trim());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue