Posts Tagged ‘brute force chip crack’
When Brute Force Works: The Attempts × Seconds Test
Every brute force proposal reduces to one line of arithmetic: the size of the space multiplied by the time each attempt takes. That line is easy to compute and almost never the reason a project fails. The reason projects fail is that the multiplication assumes attempts are free, and on real hardware they usually are not.
Sorting a request into “brute force is viable” or “brute force is not viable” therefore takes two questions, not one. How large is the space, and what does one attempt cost in the only currency that matters — wall-clock time before the device locks, slows, or dies.
The naive multiplication
Take a four-digit PIN. Ten thousand candidates. At one attempt per second, 2.8 hours. At ten attempts per second, seventeen minutes. The arithmetic is correct and the conclusion is usually right, which is why this class of problem is the one everybody quotes.
Now take a six-digit PIN. One million candidates, 11.6 days at one attempt per second. Still plausible if the device is on a bench and nobody is waiting. Eight characters of alphanumeric is 2.8 × 10^12, which is 89,000 years at the same rate, and that is the point at which the arithmetic stops being the interesting part of the conversation.
| Space | Size | 1/s | 10/s | 1000/s |
|---|---|---|---|---|
| 4-digit PIN | 10^4 | 2.8 h | 17 min | 10 s |
| 6-digit PIN | 10^6 | 11.6 d | 1.2 d | 17 min |
| 8 hex chars | 4.3 × 10^9 | 136 y | 13.6 y | 50 d |
| 16 hex chars | 1.8 × 10^19 | — | — | 580,000 y |
The table makes the shape obvious: for anything above about 40 bits, online guessing is not a computational problem at all. No amount of parallelism fixes it, because the limit is the number of attempts the target will accept per second, not the number of candidates a machine can generate.
The counter is the real gate
A design that accepts attempts at one per second forever is defeated by arithmetic. A design that accepts three attempts and then locks is not defeated by arithmetic at all. The difference between those two designs is a few bytes of state, and it is the single most effective security measure in the entire product.
Counters are implemented in four ways, and each fails differently.
| Implementation | Where state lives | How it fails |
|---|---|---|
| Volatile counter in RAM | MCU SRAM | Cleared by power cycle or reset pin |
| Counter in EEPROM, written per attempt | External EEPROM | Rewritable if bus is accessible; wears out |
| Counter in protected flash, written on lockout | MCU flash | Survives, but only after the lockout fires |
| Counter plus escalating delay | MCU flash plus timer | Survives and slows the attack |
The first row is defeated by removing power. The second is defeated by any bus access. The third is the first one that actually works, and its weakness is that the lockout is a single event: an attacker who can interrupt power at attempt two never triggers it, and the count is only persisted at the moment of lockout, so interrupt-and-retry resets the count.
The fourth row closes that hole by making the delay part of the state, so that interrupting power does not reset the accumulated time. This is the implementation that turns a ten-thousand-attempt problem into an unfundable one, and it is not expensive to build.
Free attempts versus metered attempts
The distinction that matters commercially is whether an attempt is observable and whether it costs the target anything. Three cases exist.
An attempt against a device that answers instantly and never records anything is free. The attacker can run at the bus limit, and the only cost is the rig. This is the case for an EEPROM read, and it is why an EEPROM has no secrets.
An attempt against a device that records each failure is metered. The rate is now set by the recording mechanism, and the endurance of that mechanism becomes an attack surface in its own right: an EEPROM counter written on every attempt wears out after a million cycles, and a worn-out cell may read as erased, which resets the count. That is a real and underappreciated failure mode, and it means a counter in EEPROM is worse than a counter in flash.
An attempt against a device that records and delays is metered with a rising price. After a few failures the delay doubles, and the total time to exhaust the space becomes dominated by the delay rather than by the number of candidates. A ten-second delay after five failures turns ten thousand attempts into twenty-eight hours; a sixty-second delay turns it into a week.
Measuring the rate before believing the model
The single per-attempt time in the multiplication is an input, not a constant, and it is the one variable that has to be measured rather than assumed.
The measurement is a hundred attempts, timed end to end, divided by a hundred. Doing it properly requires that the hundred attempts be failures, because a success ends the loop early and biases the average downwards. It also requires that the device be in the same state at the start of each attempt as it will be during the campaign: a device that has been power-cycled has a different first-attempt cost from one that has been running.
Three effects make the measured rate differ from the datasheet’s response time.
The first is the reboot. A device that requires a power cycle between attempts adds the boot time to every attempt, and a two-second boot on a device that answers in ten milliseconds turns a rate of a hundred per second into one every two seconds. That single fact changes the campaign duration by two orders of magnitude and is discovered only by measuring.
The second is the backoff. Many designs delay after each failure, and the delay grows. The measured average over the first hundred attempts is then not the average over ten thousand, because the last thousand attempts are much slower than the first hundred. Where backoff is present, the rate has to be measured in the regime the campaign will actually occupy, which means measuring the tenth thousandth attempt rather than the first.
The third is the wear-out of the counter itself. A counter written on every attempt into an EEPROM with a million-cycle endurance will fail somewhere around attempt one million, and the failure mode is usually a cell that reads as erased. That is a route to a reset count rather than a barrier, but it is also a route to a device that no longer boots, and the customer should be told which risk applies before the campaign starts.
| Measured quantity | What it changes | How to measure |
|---|---|---|
| Attempts per second | The whole estimate | 100 failures, timed |
| Reboot time per attempt | Rate, by orders of magnitude | Power cycle and time to first response |
| Backoff schedule | Late-campaign rate | Time attempts 1, 100, 1000, 10000 |
| Counter wear limit | Whether the campaign damages the device | Datasheet endurance of the storage |
Parallelism and its limits
Running many targets in parallel divides the wall-clock time by the number of targets, and this is the one form of parallelism that genuinely works. It requires many physical devices, which is unusual: a customer usually has one failed unit, not a thousand.
Running many generators in parallel — GPUs, FPGAs, clusters — divides nothing, because the target is still answering at one attempt per second. This is the most common misconception in the field, and it comes from confusing online guessing with offline cracking. Offline cracking, where the attacker holds the hash and can test candidates locally, is limited by compute and is exactly what GPUs are for. Online guessing is limited by the target’s response rate and is not helped by a single additional FLOP.
| Attack mode | Limited by | Helped by GPU |
|---|---|---|
| Online, target answers each attempt | Response rate and counters | No |
| Offline, hash or ciphertext in hand | Compute | Yes |
| Offline, key derived from a known structure | Compute plus structure | Yes |
| Physical, per-device extraction | Equipment and operator time | No |
The table is the reason a request that arrives as “we need the password brute forced” has to be classified before it is quoted. Two of the four rows are compute problems and two are not.
Side channels beat brute force
When the space is large and the counter is real, the productive route is usually not to reduce the space by guessing but to observe the device while it decides. A comparison that returns early leaks the position of the first wrong byte, which turns an n-byte search into n single-byte searches. A four-byte PIN becomes four searches of 256, which is a thousand attempts rather than four billion.
That transformation is worth more than any amount of compute, and it is the subject of the timing side of the problem: where timing leaks sets out the four leak shapes, and preventing timing attacks in code explains the defence that removes them.
What we actually do
The service at this layer is a feasibility assessment before a campaign, and it produces one of three answers. The counter classification that decides which answer applies is in brute force on a chip.
If the counter is defeatable — volatile state, or state written only at lockout — the campaign is viable and the time estimate is the multiplication above with the measured response rate. We run it and report the candidate when found.
If the counter is not defeatable and the space is small enough to survive the delay schedule, the campaign is viable but slow, and the estimate includes the delay escalation rather than just the candidate count. Customers frequently accept this and are glad to have been told the real number.
If neither holds, the answer is that online guessing will not work, and the route is a side channel or a physical extraction. Saying that in the first conversation is worth more than a month of attempts, and the alternative routes are set out in glitch attacks as a search problem and extracting IC flash. Where the target is an EEPROM on an accessible bus, the enumeration is a read rather than a guess, as described in brute force on EEPROM.
Four Kinds of Brute Force: Passwords, Keys, Addresses, States
“Can you brute force it” is a question with four different answers, and the answer depends on what is being guessed rather than on how large the space is. A password, a cryptographic key, a memory address and a protocol state are all things one might enumerate, and the four enumerations have nothing in common beyond the word.
Sorting a request into the correct category takes ten minutes and changes everything that follows: the equipment, the criterion for success, the expected duration and the reason the attempt will fail.
Category one: a password
A password is chosen by a person, which means it is drawn from a distribution that is nothing like uniform. That single fact is the whole reason password search is feasible at all, and it is why password search tools are dictionaries rather than counters.
The distribution is heavily skewed. A few hundred candidates cover a large fraction of real choices, because people pick dates, names, keyboard patterns, sports teams and the same handful of defaults that every product ships with. The tail is long, but the head is where the work happens.
| Property | Value |
|---|---|
| Chosen by | A person, usually once, usually quickly |
| Distribution | Highly skewed |
| Tool | Ordered dictionary, then rules, then exhaustion |
| Success criterion | Target accepts the input |
| Failure mode | Retry counter |
The distinguishing feature is that success is observable without any measurement. The device either opens or it does not. That makes password search the easiest category to run and the easiest to defend: a counter and a delay defeat it completely, which is why every serious product has both.
Category two: a cryptographic key
A key is generated by a random process, which means it is drawn from a uniform distribution. Nothing about one candidate makes it more likely than another, so dictionaries are useless and the only structure available is what the algorithm leaks.
For a modern key this category is not searchable by enumeration at all. A 128-bit key is 3.4 × 10^38 candidates; at a billion attempts per second that is ten thousand billion years. The number is so far beyond reach that the only sensible response is to stop treating it as a search problem.
What makes key recovery possible is not a smaller space but a leak. A comparison that returns early leaks the matching prefix. A table lookup that touches cache lines in a secret-dependent order leaks the index. A multiply whose timing depends on the operand leaks bits. Each of those converts one large search into many small ones, and the conversion is where the skill lies.
| Property | Value |
|---|---|
| Chosen by | A random generator |
| Distribution | Uniform |
| Tool | Side channel, not enumeration |
| Success criterion | Recovered key verifies |
| Failure mode | Constant-time implementation |
The commercial consequence is that a request to “brute force the AES key” is not a request that can be fulfilled. The honest answer is that the key has to be obtained by a leak or by reading the memory that holds it, and both of those are different jobs.
Category three: an address
An address space is ordered, finite and usually small. Enumerating it is not guessing at all; it is reading, one location at a time, and it succeeds by covering the space rather than by finding a match.
This category includes reading a serial EEPROM from 0x0000 to the end, walking a flash array in sectors, and scanning a memory-mapped peripheral region for registers that respond. In each case the “search” is a loop whose length is known in advance, and the result is a complete map rather than a single hit.
| Property | Value |
|---|---|
| Chosen by | The memory map |
| Distribution | Ordered, dense |
| Tool | Read command with auto-increment |
| Success criterion | Complete dump obtained |
| Failure mode | Unmapped regions fault or alias |
The failure mode is worth knowing because it produces convincing wrong answers. A read of an unmapped region often returns the last value on the bus, which looks like data. A dump that contains a long run of identical bytes may be an erased region, or may be an aliased unmapped region, and distinguishing them requires knowing the map — which is what the enumeration is supposed to produce.
Category four: a protocol state
A protocol state is the least obvious category and often the most productive. The “space” here is the set of states a state machine can be in, and the goal is to find a sequence of inputs that reaches a state the designer did not intend.
The space is not enumerable by counting, because the number of possible input sequences is unbounded. What makes it tractable is structure: state machines have far fewer reachable states than their input alphabet suggests, and the transitions are usually guarded by simple conditions.
| Property | Value |
|---|---|
| Chosen by | The protocol designer |
| Distribution | Structured, sparse |
| Tool | Model extraction and graph search |
| Success criterion | Reaching an unintended state |
| Failure mode | Rate limiting and timeouts |
The productive methods here are the ones from protocol analysis: send a valid sequence, change one field, observe whether the state advances, and build a transition graph from the observations. A device that reports its state through an LED, a status byte or a response code gives the graph away for free.
Mixed cases and how to split them
Real systems rarely present one category cleanly, and the split is where most of the analytical value lies.
A device that demands a PIN and locks after five failures is two categories at once: a password (category one) and a state machine that counts failures (category four). The password space is small, so the naive conclusion is that the job is a short dictionary run. But the counter is a state in the protocol sense, and reaching a state where attempts are unlimited is a different objective with a different technique — one that does not involve guessing the PIN at all.
The same applies to key provisioning. A device that generates a key at first boot and stores it in flash is category two at rest and category one during provisioning, because the provisioning trigger is often a factory command with a weak or default credential. Attacking the provisioning state is usually easier than attacking the key.
| Apparent category | Often actually | The cheaper object |
|---|---|---|
| Password with a lockout | Password plus protocol state | The lockout state |
| Key in flash | Key plus provisioning path | The provisioning command |
| Address read refused | Address plus permission state | The permission check |
| Encrypted protocol | Protocol state plus a key | The state machine |
The general rule is that a system with more than one secret has a weakest one, and the weakest one is almost never the one the customer is worried about. Establishing the full set before choosing a target is the difference between attacking the designed defence and attacking the implementation around it.
Why the classification decides the quote
The four categories differ in duration by several orders of magnitude, and a quote that assumes the wrong one is wrong by the same factor.
| Category | Realistic duration | Reason it ends |
|---|---|---|
| Password, no counter | Hours | Found |
| Password, with counter | Never | Attempts exhausted |
| Key, with a leak | Days to weeks | Found |
| Key, constant time | Never | No leak to measure |
| Address | Seconds to minutes | Space covered |
| Protocol state | Days | Unintended state reached |
The table is the practical reason for classifying first. Two requests that both say “brute force” can be the second row and the fifth row, and those are a refusal and a coffee break.
What we do with a request
The first question we ask is what the secret is a property of: a person, a generator, a memory map, or a protocol. The answer is usually available from the product description without touching hardware.
Where the answer is a person, the work is a dictionary and the counter is the whole story, which is why the rate measurement described in when brute force works comes before any attempt. Where the answer is a generator, the work is a side channel or a memory read, and the relevant route is where timing leaks or extracting IC flash. Where the answer is a memory map, the work is an enumeration of the kind described in brute force on EEPROM, and where it is a protocol, the work is the graph search in reverse engineering IC firmware.
The service here is the classification and, when the classification says the work is impossible, the refusal. Most of the value of this page is in the second case.