{"id":27837,"date":"2022-12-27T00:51:47","date_gmt":"2022-12-26T19:21:47","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-algorithm-for-slicing-brute-force-keyspace-closed\/"},"modified":"2022-12-27T00:51:47","modified_gmt":"2022-12-26T19:21:47","slug":"solved-algorithm-for-slicing-brute-force-keyspace-closed","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-algorithm-for-slicing-brute-force-keyspace-closed\/","title":{"rendered":"[Solved] algorithm for slicing brute force keyspace [closed]"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-20029581\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"20029581\" data-parentid=\"20028361\" data-score=\"0\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<p>Let&#8217;s start with a slightly simpler problem. All keys are 8 numeric digits, and you have 10 machines.<\/p>\n<p>Simple enough &#8211; one machine checks <code>0???????<\/code>, another checks <code>1???????<\/code> and so on. Note that this slicing doesn&#8217;t care that you&#8217;re doing multiprocessing &#8211; it&#8217;s just allocating ranges by fixing one of the digits.<\/p>\n<p>Your version is only slightly more involved. Each slice has a range for the first digit (and maybe the second, maybe more, depending how equal you need the slice-sizes to be).<\/p>\n<p>Assume you want two-character prefixes. Do the checks for single-character passwords up front, so you no longer have to worry about those &#8211; there aren&#8217;t enough of them to worry about multi-processing.<\/p>\n<p>Then (conceptually, at least) you make a list of two-character prefixes, and divide up that list.<\/p>\n<p>What do I mean by &#8220;conceptually&#8221;? There are 62 valid characters (26 uppercase, 26 lowercase, 10 digits). So there are <code>62*62 = 3844<\/code> possible two-character prefixes. But you don&#8217;t need to list them all out to determine which prefix happens at which position. If there are five processors, I want that list of prefixes into 5. So there are 6 boundaries between slices&#8230;<\/p>\n<pre><code>Bound   0     1     2     3     4     5\n        |     |     |     |     |     |\nSlice   |  1  |  2  |  3  |  4  |  5  |\n<\/code><\/pre>\n<p>The positions of the bounds within those 3844 prefixes are&#8230;<\/p>\n<pre><code>|-------+------------+--------|\n| Bound | Calc       | Result |\n|-------+------------+--------|\n|     0 | (3844*0)\/5 |      0 |\n|     1 | (3844*1)\/5 |    768 |\n|     2 | (3844*2)\/5 |   1537 |\n|     3 | (3844*3)\/5 |   2306 |\n|     4 | (3844*4)\/5 |   3075 |\n|     5 | (3844*5)\/5 |   3844 |\n|-------+------------+--------|\n<\/code><\/pre>\n<p>So the slices are&#8230;<\/p>\n<pre><code>|-------+------------------|\n| Slice | Indexes          |\n|-------+------------------|\n|     1 |    0 &lt;= i &lt;  768 |\n|     2 |  768 &lt;= i &lt; 1537 |\n|     3 | 1537 &lt;= i &lt; 2306 |\n|     4 | 2306 &lt;= i &lt; 3075 |\n|     5 | 3075 &lt;= i &lt; 3844 |\n|-------+------------------|\n<\/code><\/pre>\n<p>For each processor to keep track of how many prefixes it has handled so far is no real problem, but it needs to know where to start, so we need to convert an index to a two-character prefix. Assuming you use codes 0 to 61 (62 different codes) for lowercase, then uppercase, then digits, here&#8217;s how you convert for bound 1&#8230;<\/p>\n<ul>\n<li>768 \/ 62 = 12 remainder 24<\/li>\n<li>Character 12 (with zero = <code>a<\/code>) is <code>m<\/code><\/li>\n<li>Character 24 is <code>y<\/code><\/li>\n<li>The two-character prefix is &#8220;my&#8221;.<\/li>\n<\/ul>\n<p>So your first slice is from &#8220;aa&#8221; up to, but not including &#8220;my&#8221;. The processor dealing with that just has to try every possible suffix, including the empty suffix.<\/p>\n<\/p><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\"><\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved algorithm for slicing brute force keyspace [closed] <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] Let&#8217;s start with a slightly simpler problem. All keys are 8 numeric digits, and you have 10 machines. Simple enough &#8211; one machine checks 0???????, another checks 1??????? and so on. Note that this slicing doesn&#8217;t care that you&#8217;re doing multiprocessing &#8211; it&#8217;s just allocating ranges by fixing one of the digits. Your version &#8230; <a title=\"[Solved] algorithm for slicing brute force keyspace [closed]\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-algorithm-for-slicing-brute-force-keyspace-closed\/\" aria-label=\"More on [Solved] algorithm for slicing brute force keyspace [closed]\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[457,2310,5493,5250,2844],"class_list":["post-27837","post","type-post","status-publish","format-standard","hentry","category-solved","tag-algorithm","tag-brute-force","tag-distributed","tag-distributed-system","tag-multiprocessing"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>[Solved] algorithm for slicing brute force keyspace [closed] - JassWeb<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jassweb.com\/solved\/solved-algorithm-for-slicing-brute-force-keyspace-closed\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] algorithm for slicing brute force keyspace [closed] - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] Let&#8217;s start with a slightly simpler problem. All keys are 8 numeric digits, and you have 10 machines. Simple enough &#8211; one machine checks 0???????, another checks 1??????? and so on. Note that this slicing doesn&#8217;t care that you&#8217;re doing multiprocessing &#8211; it&#8217;s just allocating ranges by fixing one of the digits. Your version ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-algorithm-for-slicing-brute-force-keyspace-closed\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2022-12-26T19:21:47+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-algorithm-for-slicing-brute-force-keyspace-closed\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-algorithm-for-slicing-brute-force-keyspace-closed\\\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/person\\\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] algorithm for slicing brute force keyspace [closed]\",\"datePublished\":\"2022-12-26T19:21:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-algorithm-for-slicing-brute-force-keyspace-closed\\\/\"},\"wordCount\":317,\"publisher\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#organization\"},\"keywords\":[\"algorithm\",\"brute-force\",\"distributed\",\"distributed-system\",\"multiprocessing\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-algorithm-for-slicing-brute-force-keyspace-closed\\\/\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-algorithm-for-slicing-brute-force-keyspace-closed\\\/\",\"name\":\"[Solved] algorithm for slicing brute force keyspace [closed] - JassWeb\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#website\"},\"datePublished\":\"2022-12-26T19:21:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-algorithm-for-slicing-brute-force-keyspace-closed\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-algorithm-for-slicing-brute-force-keyspace-closed\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-algorithm-for-slicing-brute-force-keyspace-closed\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] algorithm for slicing brute force keyspace [closed]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#website\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/jassweb.com\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/jass-website-logo-1.png\",\"contentUrl\":\"https:\\\/\\\/jassweb.com\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/person\\\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/wp-content\\\/litespeed\\\/avatar\\\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/wp-content\\\/litespeed\\\/avatar\\\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400\",\"contentUrl\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/wp-content\\\/litespeed\\\/avatar\\\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\\\/\\\/jassweb.com\"],\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/author\\\/jaspritsinghghumangmail-com\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] algorithm for slicing brute force keyspace [closed] - JassWeb","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jassweb.com\/solved\/solved-algorithm-for-slicing-brute-force-keyspace-closed\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] algorithm for slicing brute force keyspace [closed] - JassWeb","og_description":"[ad_1] Let&#8217;s start with a slightly simpler problem. All keys are 8 numeric digits, and you have 10 machines. Simple enough &#8211; one machine checks 0???????, another checks 1??????? and so on. Note that this slicing doesn&#8217;t care that you&#8217;re doing multiprocessing &#8211; it&#8217;s just allocating ranges by fixing one of the digits. Your version ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-algorithm-for-slicing-brute-force-keyspace-closed\/","og_site_name":"JassWeb","article_published_time":"2022-12-26T19:21:47+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-algorithm-for-slicing-brute-force-keyspace-closed\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-algorithm-for-slicing-brute-force-keyspace-closed\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] algorithm for slicing brute force keyspace [closed]","datePublished":"2022-12-26T19:21:47+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-algorithm-for-slicing-brute-force-keyspace-closed\/"},"wordCount":317,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["algorithm","brute-force","distributed","distributed-system","multiprocessing"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-algorithm-for-slicing-brute-force-keyspace-closed\/","url":"https:\/\/jassweb.com\/solved\/solved-algorithm-for-slicing-brute-force-keyspace-closed\/","name":"[Solved] algorithm for slicing brute force keyspace [closed] - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2022-12-26T19:21:47+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-algorithm-for-slicing-brute-force-keyspace-closed\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-algorithm-for-slicing-brute-force-keyspace-closed\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-algorithm-for-slicing-brute-force-keyspace-closed\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] algorithm for slicing brute force keyspace [closed]"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/27837","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=27837"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/27837\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=27837"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=27837"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=27837"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}