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.monosubstitution;
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("/vigenere")
@PropertySource("classpath:ciphers.properties")
public class VigenereCipherController{
@Value("${cipher.mono.vigenere.name}")
private String vigenereName;
@Value("${cipher.mono.vigenere.description}")
private String vigenereDescription;
@GetMapping
public ObjectNode getCipherInfo(){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.VIGENERE_CIPHER_NAME);
log.info("Getting info for {}", CipherInfoUtil.VIGENERE_CIPHER_NAME);
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, vigenereName);
log.info("Getting info for {}", vigenereName);
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.VIGENERE_CIPHER_NAME, CipherInfoUtil.VIGENERE_CIPHER_DESCRIPTION);
return CipherInfoUtil.buildInfoNode(vigenereName, vigenereDescription);
}
@PostMapping("/encode")
public ObjectNode encodeVigenere(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.VIGENERE_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.VIGENERE_CIPHER_NAME);
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, vigenereName);
log.info("Encoding {}", vigenereName);
CipherParameterUtil.verifyParamsWithKeyword(cipherParams);
@@ -55,8 +64,8 @@ public class VigenereCipherController{
@PostMapping("/decode")
public ObjectNode decodeVigenere(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.VIGENERE_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.VIGENERE_CIPHER_NAME);
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, vigenereName);
log.info("Decoding {}", vigenereName);
CipherParameterUtil.verifyParamsWithKeyword(cipherParams);