Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Solutions to the Large numbers exercise

Distributed Lab Course in Spring of 2022.

Task:

  1. Using one of the existing libraries, find the number of key variants which can be set at 8-, 16-, 32-, 64-, 128-, 256-, 512- , 1024-, 2048-, 4096-bit sequence.

    • Example: If the key length is 16 bits, the keyspace is 65,536.
      • Key space is the number of unique keys that are in a given range.
  2. For each variant, it is necessary to generate a random key value in the range 0x00...0 to 0xFF...F depending on the reverse length of the key.

  3. Write a function for bruteforce the values from the range to find the key. The function's goal is to look through the values of the key from 0x00 ... 0 until a value equal to the previously generated key is found. The function must display the amount of time in milliseconds it took to find the key.

Program result

--------------------
Variety of keys for 8: 
 256

Generated key: 148

It took: 0 ms
To determine 148
--------------------

--------------------
Variety of keys for 16: 
 65_536

Generated key: 111

It took: 0 ms
To determine 111
--------------------

--------------------
Variety of keys for 32: 
 4_294_967_296

Generated key: 1593630239

It took: 27416000 ms
To determine 1593630239
--------------------

--------------------
Variety of keys for 64: 
 18_446_744_073_709_551_616

Generated key: 2499398857869395731

--------------------

--------------------
Variety of keys for 128: 
 340_282_366_920_938_463_463_374_607_431_768_211_456

Generated key: 152636673387059632465391075365173929046

--------------------

--------------------
Variety of keys for 256: 
 115_792_089_237_316_195_423_570_985_008_687_907_853_269_984_665_640_564_039_457_584_007_913_129_639_936

Generated key: 68918629306455961840986435111699705573559298516146147254161618384609607604315

--------------------

--------------------
Variety of keys for 512: 
 13_407_807_929_942_597_099_574_024_998_205_846_127_479_365_820_592_393_377_723_561_443_721_764_030_073_546_976_801_874_298_166_903_427_690_031_858_186_486_050_853_753_882_811_946_569_946_433_649_006_084_096

Generated key: 8245569939177400490108427655388638214292650256210414775458333436125649899021272219846624973610224586044379786110215544321558999739832167744547994731183327

--------------------

--------------------
Variety of keys for 1024: 
 179_769_313_486_231_590_772_930_519_078_902_473_361_797_697_894_230_657_273_430_081_157_732_675_805_500_963_132_708_477_322_407_536_021_120_113_879_871_393_357_658_789_768_814_416_622_492_847_430_639_474_124_377_767_893_424_865_485_276_302_219_601_246_094_119_453_082_952_085_005_768_838_150_682_342_462_881_473_913_110_540_827_237_163_350_510_684_586_298_239_947_245_938_479_716_304_835_356_329_624_224_137_216

Generated key: 3270202288202404619870243782015409609299481307092538669544482050842075680408340276163604969213712813724086467262614277551085370887602621888415560998275451949191860081801403967913615091142048358817436018674302835893683873421942189883711902695571094562296530105940194512126456389758509513798250780670325077028

--------------------

--------------------
Variety of keys for 2048: 
 32_317_006_071_311_007_300_714_876_688_669_951_960_444_102_669_715_484_032_130_345_427_524_655_138_867_890_893_197_201_411_522_913_463_688_717_960_921_898_019_494_119_559_150_490_921_095_088_152_386_448_283_120_630_877_367_300_996_091_750_197_750_389_652_106_796_057_638_384_067_568_276_792_218_642_619_756_161_838_094_338_476_170_470_581_645_852_036_305_042_887_575_891_541_065_808_607_552_399_123_930_385_521_914_333_389_668_342_420_684_974_786_564_569_494_856_176_035_326_322_058_077_805_659_331_026_192_708_460_314_150_258_592_864_177_116_725_943_603_718_461_857_357_598_351_152_301_645_904_403_697_613_233_287_231_227_125_684_710_820_209_725_157_101_726_931_323_469_678_542_580_656_697_935_045_997_268_352_998_638_215_525_166_389_437_335_543_602_135_433_229_604_645_318_478_604_952_148_193_555_853_611_059_596_230_656

Generated key: 17785985616405729970985312279257902826025598260613393237904269114135339089428543983479867799609981700571722790748050642932304401113130075173637244169648782463524532822506473162343298542459146862350961464140912008484987496604969107493341888143085443546278205286742371771429225863111582972528929222982483764157965398465385633293772075296220556015803551211537058193993160986512727567229687866452359244026161183548851954021795284035170311227495583729713022961529290250331084265237474957408591629330140192210937369856412076315995380792881907341380751573832264058776921457350430847007377718958899641723934060490959445713551

--------------------

--------------------
Variety of keys for 4096: 
 1_044_388_881_413_152_506_691_752_710_716_624_382_579_964_249_047_383_780_384_233_483_283_953_907_971_557_456_848_826_811_934_997_558_340_890_106_714_439_262_837_987_573_438_185_793_607_263_236_087_851_365_277_945_956_976_543_709_998_340_361_590_134_383_718_314_428_070_011_855_946_226_376_318_839_397_712_745_672_334_684_344_586_617_496_807_908_705_803_704_071_284_048_740_118_609_114_467_977_783_598_029_006_686_938_976_881_787_785_946_905_630_190_260_940_599_579_453_432_823_469_303_026_696_443_059_025_015_972_399_867_714_215_541_693_835_559_885_291_486_318_237_914_434_496_734_087_811_872_639_496_475_100_189_041_349_008_417_061_675_093_668_333_850_551_032_972_088_269_550_769_983_616_369_411_933_015_213_796_825_837_188_091_833_656_751_221_318_492_846_368_125_550_225_998_300_412_344_784_862_595_674_492_194_617_023_806_505_913_245_610_825_731_835_380_087_608_622_102_834_270_197_698_202_313_169_017_678_006_675_195_485_079_921_636_419_370_285_375_124_784_014_907_159_135_459_982_790_513_399_611_551_794_271_106_831_134_090_584_272_884_279_791_554_849_782_954_323_534_517_065_223_269_061_394_905_987_693_002_122_963_395_687_782_878_948_440_616_007_412_945_674_919_823_050_571_642_377_154_816_321_380_631_045_902_916_136_926_708_342_856_440_730_447_899_971_901_781_465_763_473_223_850_267_253_059_899_795_996_090_799_469_201_774_624_817_718_449_867_455_659_250_178_329_070_473_119_433_165_550_807_568_221_846_571_746_373_296_884_912_819_520_317_457_002_440_926_616_910_874_148_385_078_411_929_804_522_981_857_338_977_648_103_126_085_903_001_302_413_467_189_726_673_216_491_511_131_602_920_781_738_033_436_090_243_804_708_340_403_154_190_336

Generated key: 950517329863808064597660867586580481423664308208072488174533965001223703309709230203106866336650327873227196710879824168280129634168409381386272459586580665323975774503750996447215987087649785021086680029904058893612984199556895463215619026215547430948284074031077603492745952723848818809917296248095361720558278824529600925705025810042610312476415748727382688718033842645594874352933115651781270452618157312237279980749586455884035633083448527123673528339798992581544071539337097877672274515811267732360945265488705018932045715275198720071667672934632309355730945228826983213557522218153086591193904023877661531196233000904042320307929574878028670155912891990668548890271927908426376670986974990429116026569700916975130962299902729211480199114012181263125549214894729125387132226620978293564565276481041131495132293557404127529427703698603342215069108910470937255087959247493758737289392901257724528301845317936627670583725313327140664939886904655001648540955255210183078989569891515896961774795068325206964866678719287184849075075402195582863879013225898176554691872793926869632468645430666933713286171445819345214863371251964067604366382379029907468890890430791887299361416706667551618375880247087477138274439659701676823276036400

--------------------