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("/adfgx")
@PropertySource("classpath:ciphers.properties")
public class AdfgxCipherController{
@Value("${cipher.combination.adfgvx.name}")
private String adfgxName;
@Value("${cipher.combination.adfgvx.description}")
private String adfgxDescription;
@GetMapping
public ObjectNode getCipherInfo(){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ADFGX_CIPHER_NAME);
log.info("Getting info for {}", CipherInfoUtil.ADFGX_CIPHER_NAME);
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgxName);
log.info("Getting info for {}", adfgxName);
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.ADFGX_CIPHER_NAME, CipherInfoUtil.ADFGX_CIPHER_DESCRIPTION);
return CipherInfoUtil.buildInfoNode(adfgxName, adfgxDescription);
}
@PostMapping("/encode")
public ObjectNode encodeAdfgx(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ADFGX_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.ADFGX_CIPHER_NAME);
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgxName);
log.info("Encoding {}", adfgxName);
CipherParameterUtil.verifySquareKeyword(cipherParams);
@@ -56,8 +65,8 @@ public class AdfgxCipherController{
@PostMapping("/decode")
public ObjectNode decodeAdfgx(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ADFGX_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.ADFGX_CIPHER_NAME);
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, adfgxName);
log.info("Decoding {}", adfgxName);
CipherParameterUtil.verifySquareKeyword(cipherParams);