How Secure Is My Bike Lock?
How Secure Is My Bike Lock?
In this module, students will be introduced to password security by working with combinations and word patterns to help break a lock.
Appropriate for ages 11+.
Allow 45 minutes to complete the module.
Important note: This module should be led by an instructor with basic Wolfram Language knowledge. If you would like to learn the language, please try this free online introduction. If you would like a Computational Thinking Initiative ambassador or volunteer to help you run an adventure, please contact us.
Appropriate for ages 11+.
Allow 45 minutes to complete the module.
Important note: This module should be led by an instructor with basic Wolfram Language knowledge. If you would like to learn the language, please try this free online introduction. If you would like a Computational Thinking Initiative ambassador or volunteer to help you run an adventure, please contact us.
Learning Objective
◼
Students will be able to justify their design of a bike lock as it pertains to use and security
Computational Thinking Principles and Practices
◼
Using data to address real-world situations
◼
Simulating things that are hard or impossible to do by performing real-world experiments
◼
Using code, graphics and text to communicate ideas while working on the project and after finishing
Standards Alignment
◼
CSTA K–12 Computer Science Standards:
◼
Level 2 CPP 6: demonstrate good practices in personal information security, using passwords, encryption and secure transactions
◼
Level 3B CPP 5: deploy principles of security by implementing encryption and authentication strategies
Helpful Background
◼
Community post that inspired this module: http://community.wolfram.com/groups/-/m/t/926136
Note: the process to come to an answer in the Community post is different than the one suggested below
Note: the process to come to an answer in the Community post is different than the one suggested below
STARTING POINT
STARTING POINT
Ask the class to imagine that their friend locked their bike lock months ago, and now they cannot remember the combination. Luckily, the bike lock is a word lock, where the letters make up the combination, and the friend knows that they set the combination to be an English word (and not something like “BEKL”).
Show the class that the letters on the lock are arranged like this:
Letters on dial 1 are B, F, R, M, D, T, S, W, P or L
Letters on dial 2 are E, L, O, I, A, U, Y, R, W or H
Letters on dial 3 are K, S, N, T, M, R, E, L, A or O
Letters on dial 4 are L, Y, P, E, T, S, M, K, G or D
Letters on dial 1 are B, F, R, M, D, T, S, W, P or L
Letters on dial 2 are E, L, O, I, A, U, Y, R, W or H
Letters on dial 3 are K, S, N, T, M, R, E, L, A or O
Letters on dial 4 are L, Y, P, E, T, S, M, K, G or D
Be sure to put the letter configuration someplace where the students can always see it (e.g. on the board, in a handout or in an email). Keep in mind that typing the combination in a projected notebook might not be the best idea because you may scroll to where it is out of view.
“With this arrangement, FORT or MILK could be words that unlock the bike, but LOCK could not be because the third dial does not have a ‘C’. What are some ways we could help our friend remember their combination?”
◼ What are some word options?
◼ Think of what your friend likes. Do your personal preferences change the possibilities?
◼ Is there a systematic way to put together all of the possible letter patterns?
◼ Is that a real English word? Look it up.
◼ What if we knew all of the words the lock could be arranged to?
CHECKPOINT
Check to make sure students attempt to make a list of all of the possible words the password could be.
Have students try picking out words from the configuration.
“Is there a systematic way to find all of the configurations?”
Have students try finding all of the words if the configuration were like this:
Letters on dial 1 are A, E, T
Letters on dial 2 are A, E, T
Letters on dial 3 are A, E, T
Letters on dial 1 are A, E, T
Letters on dial 2 are A, E, T
Letters on dial 3 are A, E, T
Remember that they cannot just list all of the combinations of these letters—they need to be real English words to unlock the bike lock.
◼ Is there a way for us to know how many word options there are so we know when we have listed them all?
◼ Can we come together to list all of the possible word options on the board?
◼ Did we list them all?
◼ Where could you find a list of all of the English words? How will you pick out the words that meet our other constraints (four letters, first letter can only be B, F, R, M, etc.)?
CHECKPOINT
Check to see if students have come to the realization that there are too many words to list all of the options by hand.
Direct students to An Elementary Introduction to the Wolfram Language, chapter 11 on a browser to discuss WordList[].
In[1]:=
WordList[]
Out[1]=
“How will we pick out all of the words from this list that could break the lock?”
Chapter 42 of An Elementary Introduction to the Wolfram Language includes all of the functions needed to pull out all of the possible combinations.
Give students time to figure this out on their own.
We suggest the following as a possible way to list all of the words:
In[2]:=
Select[WordList[],StringMatchQ[#,"b"|"f"|"r"|"m"|"d"|"t"|"s"|"w"|"p"|"l"~~"e"|"l"|"o"|"i"|"a"|"u"|"y"|"r"|"w"|"h"~~"k"|"s"|"n"|"t"|"m"|"r"|"e"|"l"|"a"|"o"~~"l"|"y"|"p"|"e"|"t"|"s"|"m"|"k"|"g"|"d"]&]
Out[2]=
{baas,bake,bald,bale,balk,ball,balm,band,bane,bang,bank,bard,bare,bark,bars,base,bask,bass,bast,bate,bats,bead,beak,beam,beat,beep,beet,bell,belt,bend,bent,berg,berk,berm,best,bias,bike,bile,bilk,bill,bind,bird,bite,blot,boat,bold,bole,boll,bolt,bond,bone,bong,bonk,bony,book,boom,boot,bore,boss,brad,brae,brag,brat,bray,bulk,bull,bump,bung,bunk,buns,bunt,buoy,burg,burl,burp,bury,busk,buss,bust,busy,butt,byre,byte,dale,dame,damp,dang,dank,dare,dark,dart,date,dead,deal,deed,deem,deep,dell,dent,deny,desk,dial,diet,dike,dill,dime,dine,ding,dint,dire,dirk,dirt,disk,dole,doll,dolt,dome,done,doom,dork,dorm,dory,dose,doss,dote,drag,dram,drat,dray,drop,dual,duel,duet,duke,dull,duly,dump,dune,dung,dunk,dusk,dust,duty,dyad,dyed,dyne,fake,fall,fame,fang,fare,farm,fast,fate,feat,feed,feel,fell,felt,fend,fess,fete,fiat,file,fill,film,find,fine,fink,fire,firm,fist,flag,flak,flap,flat,flay,flee,floe,flog,flop,foal,foam,fold,folk,fond,font,food,fool,foot,ford,fore,fork,form,fort,frat,fray,free,fret,frog,from,fuel,full,fume,fund,funk,furl,fury,fuse,fuss,lake,lame,lamp,land,lane,lank,lard,lark,lass,last,late,lats,lead,leak,leap,leek,lees,lend,lens,less,lest,lied,like,lilt,lily,lime,limp,line,link,lint,lisp,list,lite,load,loam,loll,lone,long,look,loom,loop,loot,lord,lore,lose,loss,lost,lots,lull,lump,lung,lure,lurk,lust,lute,lyre,make,male,mall,malt,mane,many,mare,mark,marl,mart,mask,mass,mast,mate,mead,meal,meat,meed,meek,meet,meld,melt,mend,mere,mess,mete,mike,mild,mile,milk,mill,milt,mime,mind,mine,mink,mint,mire,miry,miss,mist,mite,mitt,moat,mold,mole,moll,molt,monk,mood,moot,more,moss,most,mote,mule,mull,murk,muse,musk,muss,must,mute,mutt,pale,pall,palm,pane,pang,pant,pare,park,part,pass,past,pate,peak,peal,peat,peek,peel,peep,pelt,pent,perk,perm,pert,pest,pied,pike,pile,pill,pimp,pine,ping,pink,pint,pity,play,plod,plop,plot,ploy,poem,poet,poke,poky,pole,poll,pomp,pond,pone,pong,pony,pool,poop,pore,pork,port,pose,post,posy,pram,prat,pray,prep,prey,prod,prom,prop,puke,pule,pull,pulp,pump,punk,punt,puny,pure,purl,puss,putt,pyre,rake,ramp,rand,rank,rant,rare,rasp,rate,rats,read,real,ream,reap,reed,reek,reel,rely,rend,rent,rest,rial,rile,rill,rime,rind,ring,rink,riot,rise,risk,rite,road,roam,role,roll,romp,rood,rook,room,root,rose,rosy,rote,rule,rump,rune,rung,runt,ruse,rusk,rust,sake,sale,salt,same,sand,sane,sang,sans,sass,sate,seal,seam,seat,seed,seek,seem,seep,sell,send,sens,sent,sere,sett,shad,shag,sham,shay,shed,shod,shoe,shop,shot,silk,sill,silt,sine,sing,sink,sire,site,slag,slam,slap,slat,slay,sled,sloe,slog,slop,slot,soak,soap,sold,sole,some,song,soot,sore,sort,suet,sulk,sump,sunk,surd,sure,swag,swap,swat,sway,swot,take,tale,talk,tall,tame,tamp,tang,tank,tare,tarp,tart,task,teak,teal,team,teat,teem,tell,temp,tend,tent,term,test,that,thee,them,they,tied,tile,till,tilt,time,tine,ting,tint,tiny,tire,toad,toed,toke,tole,toll,tome,tone,tons,tool,toot,tore,tort,toss,tote,trad,tram,trap,tray,tree,trek,trey,trot,troy,tune,turd,tusk,twee,tyke,wake,wale,walk,wall,wand,wane,wank,want,ward,ware,warm,warp,wart,wary,wasp,watt,weak,weal,weed,week,weep,weld,well,welt,wend,west,wham,what,whee,whet,whey,whom,whop,wild,wile,will,wilt,wily,wimp,wind,wine,wing,wink,winy,wire,wiry,wise,wisp,wits,woad,wold,wonk,wont,wood,wool,word,work,worm,wort,wrap,wuss}
◼ List the functions/topics they may find helpful in your projected notebook: WordList, Select, StringMatchQ, pure functions, Alternative (|) or StringExpression (~~).
◼ Direct them to the Wolfram Language System & Documentation Center for the functions WordList, Select, StringMatchQ, pure functions, Alternative (|) and StringExpression (~~) so that they can explore examples on their own.
◼ Demonstrate examples of the functions they may find helpful in your notebook without giving the answer away:
Select[{1,3, 5,6,1000,2422},EvenQ]
Select[{1,3, 5,6,1000,2422}, #>100&]
StringMatchQ[“abc”, _~~ “a”~~_]
StringMatchQ[“cab”, _~~ “a”~~_]
StringMatchQ[“a”, “a”|“b”]
StringMatchQ[“b”, “a”|“b”]
StringMatchQ[“c”, “a”|“b”]
Select[WordList[], StringLength[#]>3&]
Select[WordList[], StringStartsQ[#, “a”]&]
Select[WordList[], StringMatchQ[#, _~~_]&]
Select[{1,3, 5,6,1000,2422},EvenQ]
Select[{1,3, 5,6,1000,2422}, #>100&]
StringMatchQ[“abc”, _~~ “a”~~_]
StringMatchQ[“cab”, _~~ “a”~~_]
StringMatchQ[“a”, “a”|“b”]
StringMatchQ[“b”, “a”|“b”]
StringMatchQ[“c”, “a”|“b”]
Select[WordList[], StringLength[#]>3&]
Select[WordList[], StringStartsQ[#, “a”]&]
Select[WordList[], StringMatchQ[#, _~~_]&]
CHECKPOINT
Check to make sure students come up with a viable way to list all of the words.
“Now that we have a list of words, how secure do you think this bike lock is?”
◼ How many possible words are there?
◼ Does this kind of bike lock seem secure?
◼ If people only used English words for their combinations, what are the chances that you and your neighbor used the same word?
◼ Why might it be important that your combination isn’t used by a lot of other people?
◼ How many options are there that are not English words?
◼ Would it be more or less secure for your friend to have chosen an English word or just a mix of letters?
◼ What if the bike lock had one of its letters changed to a Z? Would the lock itself be more or less secure? Why?
◼ What if the bike lock had fewer letters on each dial, or fewer dials? Would the lock be more or less secure? Why?
◼ Demonstrate finding all common words in another language: WordList[Language->”French”].
◼ Show the students the Community post that inspired this module. Discuss the difference between using DictionaryWordQ and WordList. WordList only contains common words. Do common words make it more secure or less? Could a list of words for a lock be different than common English words in general?
FINAL POINT
FINAL POINT
Ten minutes before the end of the module time.
Summarize
Summarize
Summarize what was done in the module and talk about the findings.
Refer
Refer
Refer back to the learning objective and summarize how you have reached it.
Extend
Extend
Extend the module to the future. For example, "What are some things you would need to think about when designing a bike lock or an online password to make it secure?"
Possible Additional Relevant Functions
Possible Additional Relevant Functions
Length • WordTranslate • Map • Tuples
Possible Pitfalls
Possible Pitfalls
◼
Map is not introduced in the checkpoints, but when diving deeper you may need to take some time to go over Map thoroughly.