Cipher.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /**
  2. * Cipher tests.
  3. *
  4. * @author Matt C [matt@artemisbot.uk]
  5. *
  6. * @copyright Crown Copyright 2017
  7. * @license Apache-2.0
  8. */
  9. import TestRegister from "../../TestRegister.js";
  10. TestRegister.addTests([
  11. {
  12. name: "Bifid Cipher Encode: no input",
  13. input: "",
  14. expectedOutput: "",
  15. recipeConfig: [
  16. {
  17. "op": "Bifid Cipher Encode",
  18. "args": ["nothing"]
  19. }
  20. ],
  21. },
  22. {
  23. name: "Bifid Cipher Encode: no key",
  24. input: "We recreate conditions similar to the Van-Allen radiation belt in our secure facilities.",
  25. expectedOutput: "Vq daqcliho rmltofvlnc qbdhlcr nt qdq Fbm-Rdkkm vuoottnoi aitp al axf tdtmvt owppkaodtx.",
  26. recipeConfig: [
  27. {
  28. "op": "Bifid Cipher Encode",
  29. "args": [""]
  30. }
  31. ],
  32. },
  33. {
  34. name: "Bifid Cipher Encode: normal",
  35. input: "We recreate conditions similar to the Van-Allen radiation belt in our secure facilities.",
  36. expectedOutput: "Wc snpsigdd cpfrrcxnfi hikdnnp dm crc Fcb-Pdeug vueageacc vtyl sa zxm crebzp lyoeuaiwpv.",
  37. recipeConfig: [
  38. {
  39. "op": "Bifid Cipher Encode",
  40. "args": ["Schrodinger"]
  41. }
  42. ],
  43. },
  44. {
  45. name: "Bifid Cipher Decode: no input",
  46. input: "",
  47. expectedOutput: "",
  48. recipeConfig: [
  49. {
  50. "op": "Bifid Cipher Decode",
  51. "args": ["nothing"]
  52. }
  53. ],
  54. },
  55. {
  56. name: "Bifid Cipher Decode: no key",
  57. input: "Vq daqcliho rmltofvlnc qbdhlcr nt qdq Fbm-Rdkkm vuoottnoi aitp al axf tdtmvt owppkaodtx.",
  58. expectedOutput: "We recreate conditions similar to the Van-Allen radiation belt in our secure facilities.",
  59. recipeConfig: [
  60. {
  61. "op": "Bifid Cipher Decode",
  62. "args": [""]
  63. }
  64. ],
  65. },
  66. {
  67. name: "Bifid Cipher Decode: normal",
  68. input: "Wc snpsigdd cpfrrcxnfi hikdnnp dm crc Fcb-Pdeug vueageacc vtyl sa zxm crebzp lyoeuaiwpv.",
  69. expectedOutput: "We recreate conditions similar to the Van-Allen radiation belt in our secure facilities.",
  70. recipeConfig: [
  71. {
  72. "op": "Bifid Cipher Decode",
  73. "args": ["Schrodinger"]
  74. }
  75. ],
  76. },
  77. ]);