This commit is contained in:
@@ -34,7 +34,7 @@ public class Seal {
|
|||||||
Richiesta req = ctx.bodyAsClass(Richiesta.class);
|
Richiesta req = ctx.bodyAsClass(Richiesta.class);
|
||||||
RSA.RSAkeys keys = RSA.defkeys(req.keysize / 2);
|
RSA.RSAkeys keys = RSA.defkeys(req.keysize / 2);
|
||||||
String ciphertext = RSA.encrypt(req.text,keys.e(), keys.n());
|
String ciphertext = RSA.encrypt(req.text,keys.e(), keys.n());
|
||||||
ctx.result("{\"ciphertext\":"+ciphertext+",\"keys\":{\"d\":" + keys.d().toString() + ",\"n\":" + keys.n().toString() + "}}");
|
ctx.result("{\"ciphertext\":\""+ciphertext+"\",\"keys\":{\"d\":\"" + keys.d().toString() + "\",\"n\":\"" + keys.n().toString() + "\"}}");
|
||||||
});
|
});
|
||||||
|
|
||||||
// Decifratura con RSA
|
// Decifratura con RSA
|
||||||
|
|||||||
Reference in New Issue
Block a user