{"base":{"id":"cs10-16","subject":"Networks","title":"Error checking and encryption","scene":"mix","steps":[{"use":"net9","mode":"parity","eyebrow":"Parity checks","title":"Count the 1s","body":"With even parity, an extra bit is added so the total number of 1s is even. If one bit flips on the way, the count becomes odd and the error is spotted. Try even and odd parity.","controls":[{"id":"v","label":"Value","min":0,"max":127,"step":1,"value":77}],"actions":[{"id":"even","label":"Even parity"},{"id":"odd","label":"Odd parity"}]},{"use":"sys10","mode":"checksum","eyebrow":"Checksums","title":"Add it up and compare","body":"A checksum is calculated from the data and sent with it. The receiver calculates it again. Different results mean an error. Send the data cleanly, then with an error.","actions":[{"id":"send","label":"Send"},{"id":"flip","label":"Send with an error"}]},{"use":"network","mode":"echo","eyebrow":"Echo checks and ARQ","title":"Send it back to compare","body":"An echo check sends the data back to the sender to compare. With automatic repeat requests (ARQ), the receiver sends an acknowledgement; if none arrives before a timeout, the data is resent.","controls":[{"id":"noise","label":"Noise","min":0,"max":50,"step":5,"value":25}],"actions":[{"id":"send","label":"Send"},{"id":"resend","label":"Resend"}]},{"use":"sys10","mode":"checkdigit","eyebrow":"Check digits","title":"Catch typing mistakes","body":"A check digit is calculated from the other digits of a code, like a barcode or ISBN. It catches mistakes when the code is typed or scanned. Find the right check digit.","controls":[{"id":"d","label":"Last digit","min":0,"max":9,"step":1,"value":3}]},{"use":"sys10","mode":"encrypt","eyebrow":"Encryption","title":"Scramble it with a key","body":"Encryption scrambles data so anyone who intercepts it can't read it. Symmetric encryption uses one shared key; asymmetric uses a public key to lock and a private key to unlock.","actions":[{"id":"sym","label":"Symmetric"},{"id":"asym","label":"Asymmetric"}]},{"use":"net9","mode":"quiz","look":"parity","eyebrow":"Check yourself","title":"Spot the error","body":"Even parity is used. A byte arrives as 1011 0110.","question":"Has an error happened?","options":["No: it has an even number of 1s","Yes: it has an odd number of 1s","You can't tell with parity"],"answer":1,"right":"Correct. 1+0+1+1+0+1+1+0 = 5 ones, which is odd, so with even parity an error has occurred.","wrong":"Not quite. Count the 1s."}],"more":[{"type":"cards","id":"worked","eyebrow":"Worked examples","title":"Step by step","items":[{"tag":"Even parity","title":"Add a parity bit to 1100101","body":"count 1s: 4 (even)\nparity bit = 0 → 01100101","code":true},{"tag":"Odd parity","title":"Add a parity bit to 1100101","body":"count 1s: 4\nneed odd → parity bit 1 → 11100101","code":true},{"tag":"Symmetric","title":"Problem","body":"both sides need the same key\nsending the key is risky: it could be intercepted","code":true},{"tag":"Asymmetric","title":"Solution","body":"receiver publishes a public key\nsender locks with it\nonly the receiver's private key unlocks","code":true}]},{"type":"cards","id":"detail","eyebrow":"The ideas in detail","title":"The ideas in detail","items":[{"tag":"Parity bit","title":"One extra bit","body":"Detects any single-bit error, but misses two flips (they cancel out) and can't say which bit is wrong."},{"tag":"Parity block","title":"Rows and columns","body":"Checking parity for every row and column of a block can find WHICH bit flipped, at the crossing point."},{"tag":"Checksum","title":"A calculated total","body":"Detects most errors in a block of data; if it fails, the block is resent."},{"tag":"ARQ","title":"Acknowledge or repeat","body":"Receiver sends a positive acknowledgement (ACK). If the sender hears nothing before the timeout, it resends."}]},{"type":"cards","id":"mistakes","eyebrow":"Common mistakes","title":"Watch out for these","items":[{"tag":"Mistake","title":"\"Parity finds every error\"","body":"Two flipped bits keep the parity correct, so they go unnoticed."},{"tag":"Mistake","title":"\"Encryption stops data being intercepted\"","body":"It can still be intercepted, but it can't be understood without the key."},{"tag":"Mistake","title":"Sharing the private key","body":"The private key must never be shared; only the public key is given out."},{"tag":"Mistake","title":"Confusing check digits with checksums","body":"Check digits catch typing errors in codes; checksums catch transmission errors in data."}]},{"type":"cards","id":"deeper","eyebrow":"Go deeper","title":"More than the lesson","items":[{"tag":"Real world","title":"The padlock in your browser","body":"HTTPS uses asymmetric encryption to agree a secret key safely, then switches to fast symmetric encryption for the rest of the session."},{"tag":"History","title":"Enigma","body":"In World War II, Alan Turing and the team at Bletchley Park broke the German Enigma cipher, using early computing machines."},{"tag":"Careers","title":"Who works with codes?","body":"Cryptographers, security engineers, penetration testers and network engineers who keep data correct and private."},{"tag":"Coming next","title":"Where this leads","body":"Next: how routers, IP addresses and DNS get a web page to your browser."}]},{"type":"cards","id":"challenge","eyebrow":"Challenge yourself","title":"Stretch your brain","intro":"Try each one on paper before opening the card.","items":[{"tag":"Challenge","title":"With even parity, which bit is wrong? Rows: 1010 (parity 0) 1101 (parity 1) 0111 (parity 0). Column parities: 0 0 1 0.","body":"Rows: 1010+0 (two 1s ✓), 1101+1 (four ✓), 0111+0 (three: odd ✗) → error in row 3.\nColumns: col 1 = 1,1,0 + 0 ✓; col 2 = 0,1,1 + 0 ✓; col 3 = 1,0,1 + 1 (odd ✗); col 4 = 0,1,1 + 0 ✓ → error in column 3.\nThe flipped bit is row 3, column 3: it should be 0 (row 3 was 0101)."},{"tag":"Challenge","title":"Why is asymmetric encryption slower but still useful?","body":"Its maths is heavier, so it's used only to exchange a symmetric key safely. Then the fast symmetric key encrypts the bulk of the data."}]},{"type":"activities","id":"try","eyebrow":"Try it at home","title":"Try it yourself","items":[{"title":"Parity magic trick","time":"15 minutes","need":["25 coins or cards","A friend"],"steps":["Lay out a 4 × 4 grid of coins, heads or tails at random.","Secretly add a 5th row and column so every row and column has an even number of heads.","Turn away; your friend flips ONE coin.","Find it by checking which row and column are now odd."],"why":"This is a parity block: the odd row and odd column cross at the flipped bit.","safety":"No safety risks."},{"title":"Caesar cipher","time":"15 minutes","need":["Paper"],"steps":["Choose a shift, like 3.","Encrypt a message by shifting each letter.","Give it to a friend with the key.","Try to crack a friend's message without the key by testing all 25 shifts."],"why":"With only 25 possible keys, a Caesar cipher is easy to crack, which is why modern keys are hundreds of bits long.","safety":"No safety risks."}]},{"type":"quiz","id":"quiz","eyebrow":"Quiz","title":"Eight more questions","questions":[{"question":"A parity bit is added to make the number of 1s…","options":["zero","equal to 8","even (or odd, as agreed)"],"answer":2,"right":"Correct.","wrong":"Not quite."},{"question":"Which error can a single parity bit miss?","options":["Two bits flipped","One bit flipped","The parity bit itself flipping"],"answer":0,"right":"Correct.","wrong":"Not quite."},{"question":"In ARQ, what does the receiver send back?","options":["The whole file","An acknowledgement","A password"],"answer":1,"right":"Correct.","wrong":"Not quite."},{"question":"If no acknowledgement arrives before the timeout…","options":["the data is deleted","the network shuts down","the data is resent"],"answer":2,"right":"Correct.","wrong":"Not quite."},{"question":"An echo check…","options":["sends the data back to compare","adds a parity bit","encrypts data"],"answer":0,"right":"Correct.","wrong":"Not quite."},{"question":"Which key is shared publicly in asymmetric encryption?","options":["The private key","The public key","Both keys"],"answer":1,"right":"Correct.","wrong":"Not quite."},{"question":"A barcode's last digit is a…","options":["parity bit","private key","check digit"],"answer":2,"right":"Correct.","wrong":"Not quite."},{"question":"Encrypted data that is intercepted…","options":["can't be understood without the key","is automatically deleted","is sent back"],"answer":0,"right":"Correct.","wrong":"Not quite."}]},{"type":"checklist","id":"check","eyebrow":"Self-check","title":"I can…","items":["explain why errors happen during transmission","add and check even and odd parity bits","use a parity block to find a flipped bit","explain checksums and echo checks","explain ARQ with acknowledgements and timeouts","explain how check digits catch typing errors","explain symmetric encryption and its key problem","explain asymmetric encryption with public and private keys"]},{"type":"keywords","id":"words","eyebrow":"Key words","title":"Words to know","items":[{"word":"parity bit","meaning":"An extra bit making the count of 1s even or odd."},{"word":"parity block","meaning":"Parity checked across rows and columns."},{"word":"checksum","meaning":"A value calculated from data to detect errors."},{"word":"echo check","meaning":"Data sent back to the sender to compare."},{"word":"ARQ","meaning":"Automatic repeat request."},{"word":"acknowledgement","meaning":"A message confirming data arrived correctly."},{"word":"timeout","meaning":"A time limit for waiting for a reply."},{"word":"check digit","meaning":"A digit calculated from the rest of a code."},{"word":"encryption","meaning":"Scrambling data so only key holders can read it."},{"word":"public / private key","meaning":"The pair of keys in asymmetric encryption."}]},{"type":"sources","id":"sources","title":"Sources","items":["BBC Bitesize, GCSE Computer Science: Error checking; encryption","Isaac Computer Science: Error detection; encryption","Bletchley Park Trust: Breaking Enigma","CS Unplugged: Card flip magic (parity)"]}]},"overlay":null}