// Numbas version: exam_results_page_options {"name": "Vernam Cipher encryption/decryption", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Vernam Cipher encryption/decryption", "tags": [], "metadata": {"description": "

A straightforward test of encrypting and decrypting an eight-bit message with the Vernam Cipher.  The message and the key are uniform and independently generated eight-bit strings.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Suppose we wish to encrypt the plaintext {message} using the Vernam Cipher.

", "advice": "

a) We add the first bit of the key to the first bit of the message, working modulo 2, then proceed to add the second bit of the key to the second bit of the message and so on.

\n

b) Since addition and subtraction modulo 2 are in fact the same operation, decrypting a Vernam ciphertext using a given key is exactly the same operation as encrypting with that key.

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"message": {"name": "message", "group": "Ungrouped variables", "definition": "Repeat(Random(0..1),8)", "description": "", "templateType": "anything", "can_override": false}, "key": {"name": "key", "group": "Ungrouped variables", "definition": "Repeat(Random(0..1),8)", "description": "", "templateType": "anything", "can_override": false}, "ciphertext": {"name": "ciphertext", "group": "Ungrouped variables", "definition": "Repeat(Random(0..1),8)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["message", "key", "ciphertext"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Encrypt the plaintext using the key {key}.

", "correctAnswer": "matrix(map(mod(message[i]+key[i],2),i,0..7))", "correctAnswerFractions": false, "numRows": 1, "numColumns": "8", "allowResize": false, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Decrypt the ciphertext {ciphertext} using the key {key}.

", "correctAnswer": "matrix(map(mod(ciphertext[i]+key[i],2),i,0..7))", "correctAnswerFractions": false, "numRows": 1, "numColumns": "8", "allowResize": false, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Maura Paterson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7001/"}]}]}], "contributors": [{"name": "Maura Paterson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7001/"}]}