Update cipher descriptions

This commit is contained in:
2024-04-22 00:03:36 -04:00
parent f40d18e54c
commit 71c50f0608
66 changed files with 1317 additions and 599 deletions

View File

@@ -2,6 +2,8 @@ package com.mattrixwv.cipherstream.controller.combination;
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;
@@ -20,20 +22,27 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
@RestController
@RequestMapping("/adfgvx")
@PropertySource("classpath:ciphers.properties")
public class AdfgvxCipherController{
@Value("${cipher.combination.adfgvx.name}")
private String adfgvxName;
@Value("${cipher.combination.adfgvx.description}")
private String adfgvxDescription;
@GetMapping
public ObjectNode getCipherInfo(){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ADFGVX_CIPHER_NAME);
log.info("Getting info for {}", CipherInfoUtil.ADFGVX_CIPHER_NAME);
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgvxName);
log.info("Getting info for {}", adfgvxName);
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.ADFGVX_CIPHER_NAME, CipherInfoUtil.ADFGVX_CIPHER_DESCRIPTION);
return CipherInfoUtil.buildInfoNode(adfgvxName, adfgvxDescription);
}
@PostMapping("/encode")
public ObjectNode encodeAdfgvx(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ADFGVX_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.ADFGVX_CIPHER_NAME);
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgvxName);
log.info("Encoding {}", adfgvxName);
CipherParameterUtil.verifySquareKeyword(cipherParams);
@@ -56,8 +65,8 @@ public class AdfgvxCipherController{
@PostMapping("/decode")
public ObjectNode decodeAdfgvx(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ADFGVX_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.ADFGVX_CIPHER_NAME);
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgvxName);
log.info("Decoding {}", adfgvxName);
CipherParameterUtil.verifySquareKeyword(cipherParams);