// Numbas version: exam_results_page_options {"name": "El Gamal Decryption", "extensions": ["numbertheory", "elliptic-curves"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "El Gamal Decryption", "tags": [], "metadata": {"description": "

In this question the students are given the public and private keys for El Gamal through Elliptic Curve and a message to decrypt. They have to decrypt the message.

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

Alice and Bob decide to use El Gamal on the Elliptic curve $\\var{curve}$. They agree to use the point $P=\\var{P}$.Alice's private key is $\\var{na}$.

\n

She receives from Bob the message $[\\var{c1},\\var{c2}]$. What was Bob's decrypted message? The message must be a point. Enter x,y.

", "advice": "

From the private key $\\var{na}$ and the encrypted message $[\\var{c1},\\var{c2}]$, we can compute the original message using the operation (on the elliptic curve): $\\var{c2} - \\var{na}\\cdot \\var{c1} = \\var{MessageDecrypt}$.

", "rulesets": {}, "extensions": ["elliptic-curves", "numbertheory"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"m": {"name": "m", "group": "Ungrouped variables", "definition": "random(primelist(20,100))", "description": "", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "1", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(-10..10)", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(-10..10 except 0)", "description": "", "templateType": "anything", "can_override": false}, "curve": {"name": "curve", "group": "Ungrouped variables", "definition": "curve(a,b,c,m)", "description": "", "templateType": "anything", "can_override": false}, "p": {"name": "p", "group": "Ungrouped variables", "definition": "random(getpoints(curve))", "description": "", "templateType": "anything", "can_override": false}, "q": {"name": "q", "group": "Ungrouped variables", "definition": "order(p)", "description": "", "templateType": "anything", "can_override": false}, "na": {"name": "na", "group": "Ungrouped variables", "definition": "3", "description": "", "templateType": "anything", "can_override": false}, "AlicePublic": {"name": "AlicePublic", "group": "Ungrouped variables", "definition": "na*p", "description": "", "templateType": "anything", "can_override": false}, "Message": {"name": "Message", "group": "Ungrouped variables", "definition": "random(getpoints(curve))", "description": "", "templateType": "anything", "can_override": false}, "k": {"name": "k", "group": "Ungrouped variables", "definition": "random(2..q-1)", "description": "

Bob's one-time password.

", "templateType": "anything", "can_override": false}, "c1": {"name": "c1", "group": "Ungrouped variables", "definition": "k*P", "description": "", "templateType": "anything", "can_override": false}, "c2": {"name": "c2", "group": "Ungrouped variables", "definition": "(k*AlicePublic)+Message", "description": "", "templateType": "anything", "can_override": false}, "MessageDecrypt": {"name": "MessageDecrypt", "group": "Ungrouped variables", "definition": "c2-na*c1", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "q<> Infinity and q>2 and q<10", "maxRuns": 100}, "ungrouped_variables": ["m", "a", "b", "c", "curve", "p", "q", "na", "AlicePublic", "Message", "k", "c1", "c2", "MessageDecrypt"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "Decrypted Message", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The decrypted message is: ([[0]],[[1]])

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "x", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "get(MessageDecrypt,'x')", "maxValue": "get(MessageDecrypt,'x')", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "y", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "get(MessageDecrypt,'y')", "maxValue": "get(MessageDecrypt,'y')", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Julien Ugon", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3575/"}, {"name": "Guillermo Pineda", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/20075/"}]}]}], "contributors": [{"name": "Julien Ugon", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3575/"}, {"name": "Guillermo Pineda", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/20075/"}]}