Update encryption functions to post

This commit is contained in:
Matthew Ellison
2024-04-16 16:08:18 -04:00
parent fcc04b3416
commit 93c631d7e0
20 changed files with 60 additions and 40 deletions

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.combination;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -29,7 +30,7 @@ public class AdfgvxCipherController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.ADFGVX_CIPHER_NAME, CipherInfoUtil.ADFGVX_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.ADFGVX_CIPHER_NAME, CipherInfoUtil.ADFGVX_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodeAdfgvx(@RequestBody ObjectNode cipherParams){ public ObjectNode encodeAdfgvx(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ADFGVX_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ADFGVX_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.ADFGVX_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.ADFGVX_CIPHER_NAME);
@@ -53,7 +54,7 @@ public class AdfgvxCipherController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodeAdfgvx(@RequestBody ObjectNode cipherParams){ public ObjectNode decodeAdfgvx(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ADFGVX_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ADFGVX_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.ADFGVX_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.ADFGVX_CIPHER_NAME);

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.combination;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -29,7 +30,7 @@ public class AdfgxCipherController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.ADFGX_CIPHER_NAME, CipherInfoUtil.ADFGX_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.ADFGX_CIPHER_NAME, CipherInfoUtil.ADFGX_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodeAdfgx(@RequestBody ObjectNode cipherParams){ public ObjectNode encodeAdfgx(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ADFGX_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ADFGX_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.ADFGX_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.ADFGX_CIPHER_NAME);
@@ -53,7 +54,7 @@ public class AdfgxCipherController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodeAdfgx(@RequestBody ObjectNode cipherParams){ public ObjectNode decodeAdfgx(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ADFGX_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ADFGX_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.ADFGX_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.ADFGX_CIPHER_NAME);

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.monosubstitution;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -29,7 +30,7 @@ public class AffineCipherController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.AFFINE_CIPHER_NAME, CipherInfoUtil.AFFINE_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.AFFINE_CIPHER_NAME, CipherInfoUtil.AFFINE_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodeAffine(@RequestBody ObjectNode cipherParams){ public ObjectNode encodeAffine(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.AFFINE_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.AFFINE_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.AFFINE_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.AFFINE_CIPHER_NAME);
@@ -53,7 +54,7 @@ public class AffineCipherController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodeAffine(@RequestBody ObjectNode cipherParams){ public ObjectNode decodeAffine(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.AFFINE_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.AFFINE_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.AFFINE_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.AFFINE_CIPHER_NAME);

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.monosubstitution;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -29,7 +30,7 @@ public class AtbashCipherController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.ATBASH_CIPHER_NAME, CipherInfoUtil.ATBASH_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.ATBASH_CIPHER_NAME, CipherInfoUtil.ATBASH_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodeAtbash(@RequestBody ObjectNode cipherParams){ public ObjectNode encodeAtbash(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ATBASH_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ATBASH_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.ATBASH_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.ATBASH_CIPHER_NAME);
@@ -51,7 +52,7 @@ public class AtbashCipherController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodeAtbash(@RequestBody ObjectNode cipherParams){ public ObjectNode decodeAtbash(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ATBASH_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ATBASH_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.ATBASH_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.ATBASH_CIPHER_NAME);

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.monosubstitution;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -29,7 +30,7 @@ public class AutokeyCipherController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.AUTOKEY_CIPHER_NAME, CipherInfoUtil.AUTOKEY_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.AUTOKEY_CIPHER_NAME, CipherInfoUtil.AUTOKEY_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodeAutokey(@RequestBody ObjectNode cipherParams){ public ObjectNode encodeAutokey(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.AUTOKEY_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.AUTOKEY_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.AUTOKEY_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.AUTOKEY_CIPHER_NAME);
@@ -52,7 +53,7 @@ public class AutokeyCipherController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodeAutokey(@RequestBody ObjectNode cipherParams){ public ObjectNode decodeAutokey(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.AUTOKEY_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.AUTOKEY_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.AUTOKEY_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.AUTOKEY_CIPHER_NAME);

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.monosubstitution;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -29,7 +30,7 @@ public class BaconianCipherController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.BACONIAN_CIPHER_NAME, CipherInfoUtil.BACONIAN_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.BACONIAN_CIPHER_NAME, CipherInfoUtil.BACONIAN_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodeBaconian(@RequestBody ObjectNode cipherParams){ public ObjectNode encodeBaconian(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Baconian"); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Baconian");
log.info("Encoding {}", CipherInfoUtil.BACONIAN_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.BACONIAN_CIPHER_NAME);
@@ -49,7 +50,7 @@ public class BaconianCipherController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodeBaconian(@RequestBody ObjectNode cipherParams){ public ObjectNode decodeBaconian(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Baconian"); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Baconian");
log.info("Decoding {}", CipherInfoUtil.BACONIAN_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.BACONIAN_CIPHER_NAME);

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.monosubstitution;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -29,7 +30,7 @@ public class BaseXCipherController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.BASE_X_CIPHER_NAME, CipherInfoUtil.BASE_X_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.BASE_X_CIPHER_NAME, CipherInfoUtil.BASE_X_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodeBaseX(@RequestBody ObjectNode cipherParams){ public ObjectNode encodeBaseX(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BASE_X_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BASE_X_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.BASE_X_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.BASE_X_CIPHER_NAME);
@@ -49,7 +50,7 @@ public class BaseXCipherController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodeBaseX(@RequestBody ObjectNode cipherParams){ public ObjectNode decodeBaseX(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BASE_X_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BASE_X_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.BASE_X_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.BASE_X_CIPHER_NAME);

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.monosubstitution;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -29,7 +30,7 @@ public class BeaufortCipherController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.BEAUFORT_CIPHER_NAME, CipherInfoUtil.BEAUFORT_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.BEAUFORT_CIPHER_NAME, CipherInfoUtil.BEAUFORT_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodeBeaufort(@RequestBody ObjectNode cipherParams){ public ObjectNode encodeBeaufort(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BEAUFORT_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BEAUFORT_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.BEAUFORT_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.BEAUFORT_CIPHER_NAME);
@@ -52,7 +53,7 @@ public class BeaufortCipherController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodeBeaufort(@RequestBody ObjectNode cipherParams){ public ObjectNode decodeBeaufort(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BEAUFORT_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BEAUFORT_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.BEAUFORT_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.BEAUFORT_CIPHER_NAME);

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.monosubstitution;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -29,7 +30,7 @@ public class OneTimePadCipherController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.ONE_TIME_PAD_CIPHER_NAME, CipherInfoUtil.ONE_TIME_PAD_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.ONE_TIME_PAD_CIPHER_NAME, CipherInfoUtil.ONE_TIME_PAD_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodeOneTimePad(@RequestBody ObjectNode cipherParams){ public ObjectNode encodeOneTimePad(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ONE_TIME_PAD_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ONE_TIME_PAD_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.ONE_TIME_PAD_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.ONE_TIME_PAD_CIPHER_NAME);
@@ -52,7 +53,7 @@ public class OneTimePadCipherController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodeOneTimePad(@RequestBody ObjectNode cipherParams){ public ObjectNode decodeOneTimePad(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ONE_TIME_PAD_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ONE_TIME_PAD_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.ONE_TIME_PAD_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.ONE_TIME_PAD_CIPHER_NAME);

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.monosubstitution;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -29,7 +30,7 @@ public class PortaCipherController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.PORTA_CIPHER_NAME, CipherInfoUtil.PORTA_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.PORTA_CIPHER_NAME, CipherInfoUtil.PORTA_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodePorta(@RequestBody ObjectNode cipherParams){ public ObjectNode encodePorta(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.PORTA_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.PORTA_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.PORTA_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.PORTA_CIPHER_NAME);
@@ -52,7 +53,7 @@ public class PortaCipherController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodePorta(@RequestBody ObjectNode cipherParams){ public ObjectNode decodePorta(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.PORTA_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.PORTA_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.PORTA_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.PORTA_CIPHER_NAME);

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.monosubstitution;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -29,7 +30,7 @@ public class SubstitutionCipherController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.SUBSTITUTION_CIPHER_NAME, CipherInfoUtil.SUBSTITUTION_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.SUBSTITUTION_CIPHER_NAME, CipherInfoUtil.SUBSTITUTION_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodeSubstitution(@RequestBody ObjectNode cipherParams){ public ObjectNode encodeSubstitution(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.SUBSTITUTION_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.SUBSTITUTION_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.SUBSTITUTION_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.SUBSTITUTION_CIPHER_NAME);
@@ -52,7 +53,7 @@ public class SubstitutionCipherController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodeSubstitution(@RequestBody ObjectNode cipherParams){ public ObjectNode decodeSubstitution(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.SUBSTITUTION_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.SUBSTITUTION_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.SUBSTITUTION_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.SUBSTITUTION_CIPHER_NAME);

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.monosubstitution;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -29,7 +30,7 @@ public class VigenereCipherController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.VIGENERE_CIPHER_NAME, CipherInfoUtil.VIGENERE_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.VIGENERE_CIPHER_NAME, CipherInfoUtil.VIGENERE_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodeVigenere(@RequestBody ObjectNode cipherParams){ public ObjectNode encodeVigenere(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.VIGENERE_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.VIGENERE_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.VIGENERE_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.VIGENERE_CIPHER_NAME);
@@ -52,7 +53,7 @@ public class VigenereCipherController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodeVigenere(@RequestBody ObjectNode cipherParams){ public ObjectNode decodeVigenere(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.VIGENERE_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.VIGENERE_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.VIGENERE_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.VIGENERE_CIPHER_NAME);

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.polysubstitution;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -29,7 +30,7 @@ public class BifidCipherController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.BIFID_CIPHER_NAME, CipherInfoUtil.BIFID_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.BIFID_CIPHER_NAME, CipherInfoUtil.BIFID_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodeBifid(@RequestBody ObjectNode cipherParams){ public ObjectNode encodeBifid(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BIFID_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BIFID_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.BIFID_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.BIFID_CIPHER_NAME);
@@ -52,7 +53,7 @@ public class BifidCipherController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodeBifid(@RequestBody ObjectNode cipherParams){ public ObjectNode decodeBifid(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BIFID_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BIFID_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.BIFID_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.BIFID_CIPHER_NAME);

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.polysubstitution;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -29,7 +30,7 @@ public class ColumnarCipherController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.COLUMNAR_CIPHER_NAME, CipherInfoUtil.COLUMNAR_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.COLUMNAR_CIPHER_NAME, CipherInfoUtil.COLUMNAR_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodeColumnar(@RequestBody ObjectNode cipherParams){ public ObjectNode encodeColumnar(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.COLUMNAR_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.COLUMNAR_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.COLUMNAR_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.COLUMNAR_CIPHER_NAME);
@@ -52,7 +53,7 @@ public class ColumnarCipherController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodeColumnar(@RequestBody ObjectNode cipherParams){ public ObjectNode decodeColumnar(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.COLUMNAR_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.COLUMNAR_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.COLUMNAR_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.COLUMNAR_CIPHER_NAME);

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.polysubstitution;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -31,7 +32,7 @@ public class HillCipherController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.HILL_CIPHER_NAME, CipherInfoUtil.HILL_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.HILL_CIPHER_NAME, CipherInfoUtil.HILL_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodeHill(@RequestBody ObjectNode cipherParams) throws JsonProcessingException{ public ObjectNode encodeHill(@RequestBody ObjectNode cipherParams) throws JsonProcessingException{
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.HILL_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.HILL_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.HILL_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.HILL_CIPHER_NAME);
@@ -54,7 +55,7 @@ public class HillCipherController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodeHill(@RequestBody ObjectNode cipherParams) throws JsonProcessingException{ public ObjectNode decodeHill(@RequestBody ObjectNode cipherParams) throws JsonProcessingException{
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.HILL_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.HILL_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.HILL_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.HILL_CIPHER_NAME);

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.polysubstitution;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -29,7 +30,7 @@ public class MorseCodeController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.MORSE_CIPHER_NAME, CipherInfoUtil.MORSE_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.MORSE_CIPHER_NAME, CipherInfoUtil.MORSE_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodeMorse(@RequestBody ObjectNode cipherParams){ public ObjectNode encodeMorse(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.MORSE_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.MORSE_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.MORSE_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.MORSE_CIPHER_NAME);
@@ -48,7 +49,7 @@ public class MorseCodeController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodeMorse(@RequestBody ObjectNode cipherParams){ public ObjectNode decodeMorse(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.MORSE_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.MORSE_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.MORSE_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.MORSE_CIPHER_NAME);

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.polysubstitution;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -29,7 +30,7 @@ public class PlayfairCipherController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.PLAYFAIR_CIPHER_NAME, CipherInfoUtil.PLAYFAIR_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.PLAYFAIR_CIPHER_NAME, CipherInfoUtil.PLAYFAIR_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodePlayfair(@RequestBody ObjectNode cipherParams){ public ObjectNode encodePlayfair(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.PLAYFAIR_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.PLAYFAIR_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.PLAYFAIR_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.PLAYFAIR_CIPHER_NAME);
@@ -52,7 +53,7 @@ public class PlayfairCipherController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodePlayfair(@RequestBody ObjectNode cipherParams){ public ObjectNode decodePlayfair(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.PLAYFAIR_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.PLAYFAIR_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.PLAYFAIR_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.PLAYFAIR_CIPHER_NAME);

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.polysubstitution;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -29,7 +30,7 @@ public class PolybiusSquareController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_NAME, CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_NAME, CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodePolybius(@RequestBody ObjectNode cipherParams){ public ObjectNode encodePolybius(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_NAME);
@@ -51,7 +52,7 @@ public class PolybiusSquareController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodePolybius(@RequestBody ObjectNode cipherParams){ public ObjectNode decodePolybius(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_NAME);

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.polysubstitution;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -29,7 +30,7 @@ public class RailFenceController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.RAIL_FENCE_CIPHER_NAME, CipherInfoUtil.RAIL_FENCE_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.RAIL_FENCE_CIPHER_NAME, CipherInfoUtil.RAIL_FENCE_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodeRailFence(@RequestBody ObjectNode cipherParams){ public ObjectNode encodeRailFence(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.RAIL_FENCE_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.RAIL_FENCE_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.RAIL_FENCE_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.RAIL_FENCE_CIPHER_NAME);
@@ -52,7 +53,7 @@ public class RailFenceController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodeRailFence(@RequestBody ObjectNode cipherParams){ public ObjectNode decodeRailFence(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.RAIL_FENCE_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.RAIL_FENCE_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.RAIL_FENCE_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.RAIL_FENCE_CIPHER_NAME);

View File

@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.controller.polysubstitution;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -29,7 +30,7 @@ public class TrifidCipherController{
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.TRIFID_CIPHER_NAME, CipherInfoUtil.TRIFID_CIPHER_DESCRIPTION); return CipherInfoUtil.buildInfoNode(CipherInfoUtil.TRIFID_CIPHER_NAME, CipherInfoUtil.TRIFID_CIPHER_DESCRIPTION);
} }
@GetMapping("/encode") @PostMapping("/encode")
public ObjectNode encodeTrifid(@RequestBody ObjectNode cipherParams){ public ObjectNode encodeTrifid(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.TRIFID_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.TRIFID_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.TRIFID_CIPHER_NAME); log.info("Encoding {}", CipherInfoUtil.TRIFID_CIPHER_NAME);
@@ -54,7 +55,7 @@ public class TrifidCipherController{
return cipherParams; return cipherParams;
} }
@GetMapping("/decode") @PostMapping("/decode")
public ObjectNode decodeTrifid(@RequestBody ObjectNode cipherParams){ public ObjectNode decodeTrifid(@RequestBody ObjectNode cipherParams){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.TRIFID_CIPHER_NAME); MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.TRIFID_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.TRIFID_CIPHER_NAME); log.info("Decoding {}", CipherInfoUtil.TRIFID_CIPHER_NAME);