Skip to content

Instantly share code, notes, and snippets.

@Anass-ABEA
Created July 25, 2021 00:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Anass-ABEA/37e56bbd55391a94589c2fe10d3895e7 to your computer and use it in GitHub Desktop.
Save Anass-ABEA/37e56bbd55391a94589c2fe10d3895e7 to your computer and use it in GitHub Desktop.
RSA Server Controller ( Encryption )
package com.thexcoders.RSA_server.controllers;
import com.thexcoders.RSA_server.EncryptionManager;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class ApplicationController {
@GetMapping("getSecretMessage")
public String getMessage(){
String message = "TheXCoders";
EncryptionManager manager = new EncryptionManager();
manager.initFromStrings();
try{
return manager.encrypt(message);
}catch (Exception ignored){}
return null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment