Not logged in. Login

Assignment 1: More Examples

Same Parameters

These examples use the same parameters as the assignment description:

pwLength = 8
nLetters = 5
width = 40
height = 1000

Here are some more examples of values the functions should return: yours should be the same in all cases.

*Main> pwReduce (4::Hash)
"aaaaaaae"
*Main> pwReduce (1742526836::Hash)
"ebdcedcb"
*Main> pwReduce (-1726491528::Hash)
"aecdcdec"
*Main> pwReduce (-439590745::Hash)
"dbaeeaba"
*Main> pwReduce (-1::Hash)
"eeeeeeee"
*Main> pwReduce (-8::Hash)
"eeeeeedc"
*Main> rainbowTable 0 ["acdgcddh","fcfeggeh","ebfeecbe"]
fromList [(-397497993,"acdgcddh"),(501873960,"fcfeggeh"),(1832318221,"ebfeecbe")]
*Main> rainbowTable 1 ["acdgcddh","fcfeggeh","ebfeecbe"]
fromList [(-743605312,"ebfeecbe"),(-217206443,"fcfeggeh"),(689654816,"acdgcddh")]
*Main> rainbowTable 2 ["acdgcddh","fcfeggeh","ebfeecbe"]
fromList [(-2064295851,"fcfeggeh"),(-1060984018,"acdgcddh"),(-417807727,"ebfeecbe")]
*Main> rainbowTable width ["acdgcddh","fcfeggeh","ebfeecbe"]
fromList [(-1097908233,"acdgcddh"),(967401793,"fcfeggeh"),(1209123232,"ebfeecbe")]
*Main> let table = rainbowTable width ["acdgcddh","fcfeggeh","ebfeecbe"]
*Main> table
fromList [(-1097908233,"acdgcddh"),(967401793,"fcfeggeh"),(1209123232,"ebfeecbe")]
*Main> findPassword table width (19040862::Hash)
Just "adbdcdba"
*Main> findPassword table width (592655920::Hash)
Nothing
*Main> findPassword table width (967401793::Hash)
Just "cbaebebe"
*Main> findPassword table width (1832318221::Hash)
Just "ebfeecbe"
*Main> let many_collisions = rainbowTable width ["aabeadab","aacbcced","abdcdead","abeebdac","acbeaece","baaceacb","baaeceac","bbccceeb","beadeeeb","bebabebe","beccdece","cacdabbd","cdaaadca","cedaaaee","daeaadcc","dbbaecee","dbdaeded","ddaacbda","ddaddaac","ddbbccad","ddddaedb","decdbdbd","deedaedb","eaccaedb","ebbabede","edabeade","edddcecd","edeacbca","edeeebdb","eeadbeed"]
*Main> findPassword many_collisions width (-2055206335)
Just "dabbbcbe"
*Main> findPassword many_collisions width (-1412968889)
Just "baadbade"

Different Parameters

These examples use a different set of parameters than previous examples:

pwLength = 5
nLetters = 18
width = 60
height = 800

But, of course, these should work and produce the same results.

*Main> pwReduce (4::Hash)
"aaaae"
*Main> pwReduce (1742526836::Hash)
"dfdei"
*Main> pwReduce (-1726491528::Hash)
"figia"
*Main> pwReduce (-1::Hash)
"rrrrr"
*Main> rainbowTable 0 ["cifei","pcmda","dhbgd","lpnei"]
fromList [(-1503203201,"lpnei"),(-1487366839,"cifei"),(-640214828,"pcmda"),(2079210298,"dhbgd")]
*Main> rainbowTable 1 ["cifei","pcmda","dhbgd","lpnei"]
fromList [(-954349282,"cifei"),(-489260427,"dhbgd"),(1393638303,"lpnei"),(1735727550,"pcmda")]
*Main> rainbowTable 8 ["cifei","pcmda","dhbgd","lpnei"]
fromList [(-1124643307,"lpnei"),(-302912064,"dhbgd"),(343965490,"pcmda"),(1405018158,"cifei")]
*Main> rainbowTable width ["cifei","pcmda","dhbgd","lpnei"]
fromList [(-1280634116,"lpnei"),(-973728692,"pcmda"),(-53714259,"cifei"),(560614378,"dhbgd")]
*Main> let table = rainbowTable width ["aljdm","dlkhg","madnh","fcdfo","lndof"]
*Main> table
fromList [(-974986852,"aljdm"),(-579478432,"fcdfo"),(60687648,"madnh"),(1461195680,"lndof"),(2103023663,"dlkhg")]
*Main> findPassword table width (-1185182264::Hash)
Nothing
*Main> findPassword table width (261038628::Hash)
Just "qinmg"
*Main> findPassword table width (60687648::Hash)
Just "hhoid"
*Main> findPassword table width (60687649::Hash)
Nothing
Updated Fri April 28 2023, 10:19 by ggbaker.