123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- /**
- * Cipher tests.
- *
- * @author Matt C [matt@artemisbot.uk]
- * @author n1474335 [n1474335@gmail.com]
- *
- * @copyright Crown Copyright 2018
- * @license Apache-2.0
- */
- import TestRegister from "../../TestRegister";
- TestRegister.addTests([
- {
- name: "Affine Encode: no input",
- input: "",
- expectedOutput: "",
- recipeConfig: [
- {
- op: "Affine Cipher Encode",
- args: [1, 0]
- }
- ],
- },
- {
- name: "Affine Encode: no effect",
- input: "some keys are shaped as locks. index[me]",
- expectedOutput: "some keys are shaped as locks. index[me]",
- recipeConfig: [
- {
- op: "Affine Cipher Encode",
- args: [1, 0]
- }
- ],
- },
- {
- name: "Affine Encode: normal",
- input: "some keys are shaped as locks. index[me]",
- expectedOutput: "vhnl tldv xyl vcxelo xv qhrtv. zkolg[nl]",
- recipeConfig: [
- {
- op: "Affine Cipher Encode",
- args: [23, 23]
- }
- ],
- },
- {
- name: "Affine Decode: no input",
- input: "",
- expectedOutput: "",
- recipeConfig: [
- {
- op: "Affine Cipher Decode",
- args: [1, 0]
- }
- ],
- },
- {
- name: "Affine Decode: no effect",
- input: "vhnl tldv xyl vcxelo xv qhrtv. zkolg[nl]",
- expectedOutput: "vhnl tldv xyl vcxelo xv qhrtv. zkolg[nl]",
- recipeConfig: [
- {
- op: "Affine Cipher Decode",
- args: [1, 0]
- }
- ],
- },
- {
- name: "Affine Decode: normal",
- input: "vhnl tldv xyl vcxelo xv qhrtv. zkolg[nl]",
- expectedOutput: "some keys are shaped as locks. index[me]",
- recipeConfig: [
- {
- op: "Affine Cipher Decode",
- args: [23, 23]
- }
- ],
- },
- {
- name: "Atbash: no input",
- input: "",
- expectedOutput: "",
- recipeConfig: [
- {
- op: "Atbash Cipher",
- args: []
- }
- ],
- },
- {
- name: "Atbash: normal",
- input: "old slow slim horn",
- expectedOutput: "low hold horn slim",
- recipeConfig: [
- {
- op: "Atbash Cipher",
- args: []
- }
- ],
- },
- {
- name: "Bifid Cipher Encode: no input",
- input: "",
- expectedOutput: "",
- recipeConfig: [
- {
- "op": "Bifid Cipher Encode",
- "args": ["nothing"]
- }
- ],
- },
- {
- name: "Bifid Cipher Encode: no key",
- input: "We recreate conditions similar to the Van-Allen radiation belt in our secure facilities.",
- expectedOutput: "Vq daqcliho rmltofvlnc qbdhlcr nt qdq Fbm-Rdkkm vuoottnoi aitp al axf tdtmvt owppkaodtx.",
- recipeConfig: [
- {
- "op": "Bifid Cipher Encode",
- "args": [""]
- }
- ],
- },
- {
- name: "Bifid Cipher Encode: normal",
- input: "We recreate conditions similar to the Van-Allen radiation belt in our secure facilities.",
- expectedOutput: "Wc snpsigdd cpfrrcxnfi hikdnnp dm crc Fcb-Pdeug vueageacc vtyl sa zxm crebzp lyoeuaiwpv.",
- recipeConfig: [
- {
- "op": "Bifid Cipher Encode",
- "args": ["Schrodinger"]
- }
- ],
- },
- {
- name: "Bifid Cipher Decode: no input",
- input: "",
- expectedOutput: "",
- recipeConfig: [
- {
- "op": "Bifid Cipher Decode",
- "args": ["nothing"]
- }
- ],
- },
- {
- name: "Bifid Cipher Decode: no key",
- input: "Vq daqcliho rmltofvlnc qbdhlcr nt qdq Fbm-Rdkkm vuoottnoi aitp al axf tdtmvt owppkaodtx.",
- expectedOutput: "We recreate conditions similar to the Van-Allen radiation belt in our secure facilities.",
- recipeConfig: [
- {
- "op": "Bifid Cipher Decode",
- "args": [""]
- }
- ],
- },
- {
- name: "Bifid Cipher Decode: normal",
- input: "Wc snpsigdd cpfrrcxnfi hikdnnp dm crc Fcb-Pdeug vueageacc vtyl sa zxm crebzp lyoeuaiwpv.",
- expectedOutput: "We recreate conditions similar to the Van-Allen radiation belt in our secure facilities.",
- recipeConfig: [
- {
- "op": "Bifid Cipher Decode",
- "args": ["Schrodinger"]
- }
- ],
- },
- ]);
|