Update cipher descriptions
This commit is contained in:
@@ -2,6 +2,8 @@ package com.mattrixwv.cipherstream.controller.polysubstitution;
|
||||
|
||||
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -22,20 +24,27 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/hill")
|
||||
@PropertySource("classpath:ciphers.properties")
|
||||
public class HillCipherController{
|
||||
@Value("${cipher.poly.hill.name}")
|
||||
private String hillName;
|
||||
@Value("${cipher.poly.hill.description}")
|
||||
private String hillDescription;
|
||||
|
||||
|
||||
@GetMapping
|
||||
public ObjectNode getCipherInfo(){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.HILL_CIPHER_NAME);
|
||||
log.info("Getting info for {}", CipherInfoUtil.HILL_CIPHER_NAME);
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, hillName);
|
||||
log.info("Getting info for {}", hillName);
|
||||
|
||||
|
||||
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.HILL_CIPHER_NAME, CipherInfoUtil.HILL_CIPHER_DESCRIPTION);
|
||||
return CipherInfoUtil.buildInfoNode(hillName, hillDescription);
|
||||
}
|
||||
|
||||
@PostMapping("/encode")
|
||||
public ObjectNode encodeHill(@RequestBody ObjectNode cipherParams) throws JsonProcessingException{
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.HILL_CIPHER_NAME);
|
||||
log.info("Encoding {}", CipherInfoUtil.HILL_CIPHER_NAME);
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, hillName);
|
||||
log.info("Encoding {}", hillName);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyHillParams(cipherParams);
|
||||
@@ -57,8 +66,8 @@ public class HillCipherController{
|
||||
|
||||
@PostMapping("/decode")
|
||||
public ObjectNode decodeHill(@RequestBody ObjectNode cipherParams) throws JsonProcessingException{
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.HILL_CIPHER_NAME);
|
||||
log.info("Decoding {}", CipherInfoUtil.HILL_CIPHER_NAME);
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, hillName);
|
||||
log.info("Decoding {}", hillName);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyHillParams(cipherParams);
|
||||
|
||||
Reference in New Issue
Block a user