Archive for the ‘Break IC’ Category
The Smartcard Arms Race: Five Generations of Countermeasures
No other class of chip has been attacked as consistently, as publicly, or for as long, as the smartcard. The reason is structural: the card is physically in the hands of the person who wants to defeat it, it has no power source of its own, and it must reveal its answers to a reader that the attacker controls. Every defensive technique in modern embedded security was developed, tested, and broken on a card first.
The history is worth studying because it is a ladder. Each rung is a countermeasure, and each rung was climbed by an attack that then forced the next rung. The pattern repeats with enough regularity that it predicts where the current generation is vulnerable.
Generation one: secrecy of the algorithm
The first generation relied on the algorithm being unknown. A proprietary cipher implemented in a proprietary way, with the specification held by the issuer, was considered sufficient because an attacker who did not know the algorithm could not compute anything useful.
This generation lasted until the tooling for reading a die became affordable. Once the mask ROM could be imaged, the algorithm was a pattern on silicon, and recovered algorithms could be published. The lesson that survived is that an algorithm embedded in a device the attacker holds is not secret, regardless of how few people were told.
Cost of a break at this generation: one decapsulation and a microscope.
Generation two: storage protection and passwords
The second generation moved the defence from the algorithm to the data. The card refused to release its keys unless a password was supplied, and the password was compared in the card’s own logic.
This lasted until it became apparent that the comparison itself could be observed, and until the retry counter turned out to be a few bytes of EEPROM that could be reset by disturbing the supply at the right moment. A counter is a defence only if the state survives the attacker’s ability to cut power; on a card whose power is supplied by the attacker through two contacts, cutting power is trivial.
| Defence | What it assumed | What broke it |
|---|---|---|
| Password check | Attacker cannot observe the comparison | Timing and power analysis |
| Retry counter | Attacker cannot remove power | Power cut at the counter write |
| Locked memory | Lock cannot be removed | Glitch on the lock check |
Generation three: randomness in time
The third generation attacked the observability rather than the logic. If the leak is in the timing, then random delays and randomised clock should destroy the measurement.
Random delays do raise the required sample count, and that is a real cost. But averaging reduces random noise by the square root of the sample count, so a defence that multiplies the required samples by a hundred increases the attacker’s work by a hundred, which is a week rather than a year. The economics of the defence were wrong even though the mechanism worked as designed.
The lasting lesson is one that applies to any product, not just cards: a defence whose strength is a constant factor is a defence against amateurs only. Copy protection that adds a hundred to the attacker’s workload is defeated by anyone with patience, and patience is the one resource attackers have in abundance.
Generation four: environmental sensors
The fourth generation added sensors. Voltage detectors, frequency detectors, light detectors and temperature detectors watch for the conditions that fault injection requires, and the card resets or destroys its secrets when a condition is out of range.
This forced a shift in technique rather than ending the attack. A sensor is a comparator, and a comparator has a threshold, and a disturbance that stays just inside every threshold is still a disturbance. The result was a period in which attacks were characterised by careful shaping of the glitch to be invisible to each detector simultaneously — a multi-dimensional constraint problem rather than a single waveform.
The sensors also created a new failure mode, which is worth noting because it affects legitimate users: a card operating at the edge of its supply tolerance in a poorly designed reader can trigger its own protection and become unusable. Devices that destroy secrets on out-of-range conditions must be specified with margins that real readers satisfy, and many were not.
Generation five: shielding, self-destruction, and true randomness
The current generation combines a metal shield over the die with a tamper mesh that shorts the supply when cut, a light sensor under the shield, and a hardware random number generator whose output is not derived from any predictable source.
The mesh is the significant change, because it turns a physical attack into a destructive one: opening the package to reach the die breaks the mesh, and breaking the mesh destroys the state. The attack therefore has to be conducted without breaking the mesh, which means either from the front through the die’s own substrate, or by finding an electrical path that bypasses it.
| Generation | Primary defence | Break cost | Era |
|---|---|---|---|
| One | Algorithm secrecy | Hours of microscope work | 1980s |
| Two | Password and lock bits | Days | 1990s |
| Three | Randomised timing | Weeks | Late 1990s |
| Four | Environmental sensors | Months | 2000s |
| Five | Shield, mesh, true RNG | Years, or not at all | 2010s onward |
Why the newest generation is not the target
The economics of the arms race are decided by something other than the newest card. An attacker who wants to clone cards does not need to defeat the current generation; he needs to defeat the weakest generation still accepted by the system.
Card systems have long lifecycles. A scheme deployed in 2005 is still accepted in 2026 on some networks, and the cards issued in 2005 are generation three. The population of deployed cards is therefore a mixture, and the attacker’s problem reduces to finding a cohort whose defence is several rungs down the ladder and whose credentials are still valid.
That is why issuers who upgrade their newest cards while leaving old ones accepted have not improved their security at all. The security of a system is the security of its weakest accepted credential, and this is as true for a payment network as it is for a firmware update scheme.
The same ladder in ordinary products
The five generations map onto ordinary embedded products with uncomfortable accuracy.
A device whose protection is a password in the firmware is generation two. A device that adds random delays to its authentication is generation three. A device with a voltage detector that resets on out-of-range supply is generation four. Almost nothing in the consumer and industrial market reaches generation five, because a shield and a mesh cost more than the microcontroller.
This is not a criticism. It is a statement about what an assessment should expect, and about how much work a recovery job will take. A generation-two device is a side-channel job measured in days; a generation-four device may be a physical job measured in months; a generation-five device is usually declined.
Where an assessment fits
The service at this layer is a generation assessment: identify which rung a given product occupies, state what a break at that rung costs, and say whether the answer is economic. That assessment is made from the board and the firmware, not from the marketing material, and it takes a day.
The techniques that climb the lower rungs are the ones described in where timing leaks and glitch attacks as a search problem. The reason the ladder exists at all, and the specific conditions that made cards the first place it was climbed, is the subject of why side channels were born in set-top boxes. Where the rung is high enough that no economical route exists, the honest deliverable is that finding, and the alternative for the customer is usually a functional clone assembled from behaviour rather than a key recovery, as described in recovering an IC program.
Pay TV Smartcards: Why Side Channels Were Born in Set-Top Boxes
The academic literature on side-channel attacks is full of smartcards, and the reason usually given is that smartcards are simple and well documented. That explanation is incomplete. Microcontrollers were also simple and well documented, and nobody built a research programme around them in the same decade.
What the set-top box offered was something else: a target that could be attacked continuously, in the attacker’s own home, with an immediate and unambiguous indication of success. Anyone who has done hardware work knows what that is worth. It is the difference between an experiment and a guess.
The three conditions
An attack campaign accelerates when three conditions hold, and the set-top box satisfied all three in a way no other consumer product did.
Physical access was unlimited. The card belonged to the subscriber, sat in a slot in the subscriber’s living room, and could be removed, replaced, powered from a bench supply, and put back without anyone noticing. There was no tamper evidence requirement in the field, and no remote attestation to detect that the card had been out of the box.
Time was unlimited. A smartcard does not expire on a schedule tied to an attack; the subscription runs for a month at a time, and the card is used several hours a day. An attacker could run a thousand experiments in the evening and watch television with the same card afterwards.
The success signal was binary and immediate. Either the picture decrypted or it did not. No measurement, no analysis, no interpretation of a log file — the television showed the answer. That is a fitness function with a one-second latency, and it is the single most valuable thing an attack campaign can have.
| Condition | Set-top box | Typical embedded target |
|---|---|---|
| Physical access | Unlimited, undetected | Often none after deployment |
| Time on target | Hours per day | Minutes during servicing |
| Success signal | Picture decrypts | None, or a distant server |
| Cost of failure | Replace the card | Brick the product |
The fourth row is the one that made the field so productive. A failed experiment cost a card, and cards were cheap and replaceable. Compare a modern automotive ECU, where a failed glitch may destroy a unit that costs more than the campaign, and the difference in experiment rate is two orders of magnitude.
What ECM and EMM actually carry
The conditional access system has two message streams, and confusing them is the most common analytical error in this area.
An ECM, the entitlement control message, carries the information needed to derive the control word that decrypts the current scramble. The control word changes on a short cycle — often every ten seconds or so — and the ECM carries it encrypted under a key that the card holds. The ECM is broadcast to everyone; only the card can use it.
An EMM, the entitlement management message, carries subscriber management: which services this card is entitled to, for how long, and what has changed. It is addressed to a specific card, and it is where a subscription upgrade or cancellation arrives.
| Stream | Audience | Content | Change rate |
|---|---|---|---|
| ECM | All cards | Encrypted control word | Seconds |
| EMM | One card | Entitlements, keys | Days to months |
The distinction matters because the two streams have completely different attack surfaces. The ECM is a high-rate stream processed by a routine that runs every few seconds, so any fault in that routine is easy to trigger and easy to observe. The EMM is a low-rate stream processed occasionally, so a fault there is hard to time and its effect appears hours later.
An attack on the ECM routine produces a card that decrypts the current channel. An attack on the EMM handler produces a card that believes it is entitled to services it never bought. The second is more valuable and much harder, and the asymmetry explains why the historical record is dominated by the first.
The feedback loop is the accelerator
The deeper lesson from this era is about loop latency, and it generalises to every recovery job.
An attack is a search, and the speed of a search is set by how fast the result of one attempt arrives. With a one-second feedback loop an operator can run tens of thousands of attempts in a day. With a feedback loop measured in hours — because the result only appears when the device is reinstalled in its product and driven through a full cycle — the same operator runs a dozen attempts a day.
The ratio is three orders of magnitude, and it explains most of the difference between a technique that works in a laboratory and a technique that works in the field.
| Feedback latency | Attempts per day | Campaign shape |
|---|---|---|
| Under a second | 10,000+ | Sweep the whole parameter space |
| Minutes | Hundreds | Targeted search with priors |
| Hours | Dozens | Each attempt must be planned |
| Days | One or two | Not a search; a hypothesis test |
The practical implication for anyone assessing a target is that building a fast observation channel is often worth more than improving the attack itself. A device whose response can be read in ten milliseconds is a device whose parameter space can be mapped. A device whose response requires a full power cycle and a manual inspection is a device where only well-founded hypotheses are worth testing.
Why the card and not the box
The obvious question about this era is why the attack concentrated on the card. The set-top box was also in the subscriber’s home, also had power applied for years, and also contained secrets.
Three reasons made the card the better target, and they are instructive beyond this industry.
The card was the security boundary and the box was not. The box performed descrambling, but the key that made descrambling possible came from the card. Attacking the box yielded a box that worked until the operator changed the key distribution scheme; attacking the card yielded the key material itself, which worked against every box in the field.
The card was cheap and swappable. A failed attempt on a box cost the price of a box, which was a significant consumer appliance. A failed attempt on a card cost the price of a card, which was a few dollars, and the card could be replaced without the subscriber noticing a service interruption.
The card was a standard form factor. Every card used the same contact layout, the same voltage classes and the same protocol, so a rig built for one card worked on the next, and on the next operator’s cards. Nothing about the box had that property.
| Property | Card | Set-top box |
|---|---|---|
| Holds the key material | Yes | Only during a session |
| Replacement cost | A few dollars | A consumer appliance |
| Standardised interface | Yes | Vendor-specific |
| Swap unnoticed by subscriber | Yes | No |
The standardised interface is the reason this era produced so much published work. An attack developed on one operator’s card transferred immediately to another’s, so results compounded across the industry rather than staying inside one company.
What the era left behind
The techniques did not stay in the industry, and neither did the defensive patterns.
On the offensive side, the era produced the tooling that is now standard: programmable glitch generators with sub-nanosecond resolution, high-sample-rate acquisition with hardware triggering, and the practice of mapping a parameter space rather than trying one setting. Every one of those is now applied to microcontrollers, to automotive parts and to secure elements, with no television involved.
On the defensive side, the era produced the five-generation ladder described in the smartcard arms race, and it produced one conclusion that has been repeatedly relearned: a security boundary that does not account for physical possession is not a security boundary. Every scheme that assumed the attacker could not hold the device was broken, and every scheme that survived assumed he could.
That conclusion is the reason modern secure elements are specified in terms of what an attacker with the device in hand can do, rather than in terms of what an attacker on the network can do. It sounds obvious now. It was not obvious in 1995, and the industry paid for the education in cards.
Why the technique survived the product
Pay television as a business has changed beyond recognition, but the techniques developed against it did not stay there. They moved to any device with a card, a token, a dongle, or a removable security element — which is to say, to most of the systems that still rely on a separable secret.
The structural reasons those systems are still attractive are the same three conditions. A dongle is in the user’s hands. A token has no remote attestation. A card slot accepts anything shaped like a card. The cryptography inside may be thirty years newer, but the physical situation is unchanged, and the physical situation is what determines the experiment rate.
What this means for assessment work
Two practical conclusions follow, and they are both about what to measure first.
The first is to establish the feedback latency of the actual product rather than of the bench setup. A card in a reader answers in milliseconds; the same card in a product may only be exercised when the product boots, which is every few hours. The attack that is easy on the bench may be impractical in the product, and the difference is not the silicon.
The second is to establish which stream a target routine processes. In any system with a broadcast component and an addressed component, the broadcast path is high-rate and shallow, and the addressed path is low-rate and deep. The high-rate path is where faults are found; the low-rate path is where the value is.
The five generations of countermeasures that this era produced are set out in the smartcard arms race. The measurement budget that decides whether a timing route is viable at all is in before a timing attack, and the fault-injection search that the fast feedback loop makes possible is in glitch attacks as a search problem. Where the secret turns out not to be in the removable element at all, the four possible locations are in where the secret key lives.
The service we provide for this class of product is an assessment of the loop: how fast the product can be exercised, what it reveals per exercise, and whether that rate supports a search at all. It is a less exciting deliverable than a break, and it is the one that determines whether a break is a fortnight or a fantasy.
modem- or network-card adapt to PC condition
Anyone who has ever tried to add a modem- or network-card to a PC knows that such an undertaking may produce unwanted results and can take more time than expected. To achieve cost savings from high volume production, the add-in board is designed to be logically compatible to a large variety of motherboards from various vendors. This flexibility makes it necessary to configure the board for its operating environment before it is ready to function. To perform the configuration one needs two pieces of information: sufficient knowledge of the system that the board is expected to reside in and knowledge of the board itself. Once the suitable settings are determined one needs to set jumpers or flip switches on the board. This completes the tricky part of the hardware installation.
Break MCU ATMEGA2560PV Code
We can break MCU ATMEGA2560PV code, please view the MCU ATMEGA2560PV features for your reference:
Timer 2 is a 16 bit Timer/Counter that can operate as either a timer or an event counter. The type of operation is selected by bit C/T2 in the SFR T2CON (shown in Table 2). Timer 2 has three operating modes: capture, auto-reload (up or down counting), and baud rate generator.
The modes are selected by bits in T2CON, as shown in Table 8. Timer 2 consists of two 8-bit registers, TH2 and TL2. In the Timer function, the TL2 register is incremented every machine cycle. Since a machine cycle consists of 12 oscillator periods, the count rate is 1/12 of the oscillator frequency if Break MCU ATMEGA2560PV Code.
In the Counter function, the register is incremented in response to a 1-to-0 transition at its corresponding external input pin, T2. In this function, the external input is sampled during S5P2 of every machine cycle. When the samples show a high in one cycle and a low in the next cycle, the count is incremented.
The new count value appears in the register during S3P1 of the cycle following the one in which the transition was detected. Since two machine cycles (24 oscillator periods) are required to recognize a 1-to-0 transition, the maximum count rate is 1/24 of the oscillator frequency after Break MCU ATMEGA2560PV Code.
To ensure that a given level is sampled at least once before it changes, the level should be held for at least one full machine cycle. In the capture mode, two options are selected by bit EXEN2 in T2CON. If EXEN2 = 0, Timer 2 is a 16 bit timer or counter which upon overflow sets bit TF2 in T2CON.
This bit can then be used to generate an interrupt. If EXEN2 = 1, Timer 2 performs the same operation, but a l to-0 transition at external input T2EX also causes the current value in TH2 and TL2 to be captured into RCAP2H and RCAP2L, respectively if break MCU code.
In addition, the transition at T2EX causes bit EXF2 in T2CON to be set. The EXF2 bit, like TF2, can generate an interrupt after Break MCU ATMEGA2560PV Code.
Finding the Flash on a Board: Three Ways to Watch Boot
The first task on an unfamiliar board is not reading anything. It is working out which of the packages holds the code. A modern board carries a microcontroller, a memory device, a power management chip, a radio, and possibly a second memory device for data, all in packages that can be the same size and the same pin count.
The reliable way to distinguish them is to watch what happens at power-up. Only the code storage is read first, in bulk, before anything else happens.
Method one: a logic analyser on the likely pins
The direct approach is to attach a logic analyser to the pins that a serial flash would use and trigger on the release of reset.
Serial flash uses a small command set on four wires: clock, chip select, and two data lines for the single-lane mode, four for the quad mode. At boot the controller asserts chip select, clocks out a read command, sends a twenty-four or thirty-two bit address, and then clocks in a continuous stream of data.
| Signal | Behaviour at boot | Why it identifies the device |
|---|---|---|
| Chip select | Goes low, stays low for milliseconds | Long assertion means bulk read |
| Clock | Bursts at a fixed frequency | Only a memory read is this regular |
| Data out | Command then address then stream | The command byte is 0x03, 0x0B, or 0xEB |
| Data in | Silent during the read | Distinguishes master from slave |
The third row is the identification. A device that receives a command byte and an address and then emits a long stream is a memory. A device that emits short irregular bursts is a peripheral. The distinction is visible in one capture.
The practical constraint is probing. Fine-pitch packages need a fixture or a set of soldered whiskers, and the clock line at fifty megahertz needs a probe with low capacitance. A capture taken with a long ground lead will show ringing that looks like data and is not.
Method two: passive sniffing
The second method does not drive anything. A sniffer taps the four lines in parallel with the existing devices and records what passes between them.
The advantage is that the board does not need to be modified and the boot proceeds normally, which matters when the device is a customer’s only unit. The disadvantage is loading: every probe adds capacitance to a bus that was designed for two devices, and a marginal bus will fail to boot once sniffed.
| Property | Logic analyser | Passive sniffer |
|---|---|---|
| Connection | Probe or fixture | Tap, often a socket |
| Bus loading | Low with good probing | Higher, accumulates |
| Board modification | Usually none | Sometimes a soldered tap |
| Risk of preventing boot | Low | Moderate on fast buses |
| Setup time | Minutes | Tens of minutes |
The loading problem is worth planning for. If the device fails to boot with the sniffer attached, the fix is a shorter tap and a higher-impedance probe rather than a different method, and a board that boots at half the clock rate is often enough to identify the part.
Method three: boundary scan
The third method works when the pins cannot be reached, which is the case on boards with the memory in a package under a shield or on the far side of a dense assembly.
If the microcontroller supports boundary scan and the board exposes the test access port, the pin states of every ball can be read and driven from the scan chain. The boot sequence can be observed without a physical probe on the memory at all, because the controller’s own outputs are visible from inside.
| Requirement | Why it matters |
|---|---|
| Test access port accessible | Otherwise the chain cannot be reached |
| BSDL file for the controller | Describes which cell maps to which ball |
| Memory on a scanned net | Otherwise there is nothing to observe |
| Chain not disabled by fuse | Production parts often disable it |
The fourth row is the usual blocker. Boundary scan is a development feature, and a device that shipped with the port fused off offers no access. Checking for the port costs a few minutes and saves an afternoon of probing.
Reading the capture
A boot read has a shape, and recognising it is faster than decoding it.
The sequence begins with chip select falling. Within a few clock cycles the command byte appears on the data line, most significant bit first. For a standard read the command is 0x03, for a fast read 0x0B, for a quad read 0xEB or 0x6B. Then comes the address, usually 0x000000 on the first access, followed by a continuous stream that ends only when chip select rises.
| Byte | Value | Meaning |
|---|---|---|
| 1 | 0x03 | Read, single lane |
| 1 | 0x0B | Fast read, one dummy byte |
| 1 | 0xEB | Quad read, mode bits then dummy cycles |
| 2 to 4 | 0x00 0x00 0x00 | Boot vector fetch |
| 5 onward | Data | The first instructions or the vector table |
The address in the third row is the giveaway. A first read from address zero that lasts for hundreds of bytes is a boot fetch. A read from a scattered address for eight bytes is a register access in some other device.
A second read often follows at an offset a few kilobytes in, which is the boot loader checking an application header. The gap between the first and second read is usually the boot loader’s own size, and it is a free measurement of where the application begins.
When none of the three works
Four situations defeat board-level discovery, and each has a different answer.
The first is a microcontroller with internal flash. There is no external bus to watch, and the code never crosses a pin. The part is identified from its package marking and its pinout instead, and the work moves to the internal array — the situation covered in MCU attack.
The second is an encrypted bus. The traffic is visible and the command bytes are visible, but the data is ciphertext, so the capture identifies the part without yielding contents. That limit is the one in bus encryption.
| Situation | Discovery | Extraction |
|---|---|---|
| Internal flash | Marking and pinout | Device-level, not board-level |
| Encrypted bus | Capture works | Capture is worthless |
| Non-standard boot mode | Difficult to trigger | Needs a mode pin analysis |
| Memory under a shield | Boundary scan or X-ray | Destructive or scan-based |
The third is a device that boots from a source other than the obvious memory — a second chip, a socket, or an interface that loads code from outside. The capture shows no boot read at all, which is itself informative.
The fourth is a memory in a package that cannot be probed, where X-ray gives the connection map and boundary scan gives the logic, and the two together substitute for a probe.
Confirming the identification
Once a candidate is found, the confirmation is a single command. Serial flash responds to 0x9F with a manufacturer byte, a device byte, and a capacity byte, and the three together identify the part family and its size.
| Response | Field | Use |
|---|---|---|
| Byte 1 | Manufacturer | Narrows to a vendor |
| Byte 2 | Device type | Memory density and interface |
| Byte 3 | Capacity | Size in bytes, as a power of two |
| Byte 4 to 20 | Vendor specific | Often a unique identifier |
Reading that response requires the device to be accessible, either through the board’s own controller or with a clip on the package. Where the clip is possible, the identification takes a minute and the capacity tells you what a full read should contain — a useful check that the reader is configured correctly.
From discovery to extraction
Discovery produces three facts: which package, which interface, and how large. Those three determine the extraction route.
A device that is accessible and unencrypted is read directly. A device that is accessible and encrypted needs a route that goes through the controller. A device that is not accessible needs the array imaged rather than read.
| Discovery result | Extraction route |
|---|---|
| External, unencrypted, accessible | Direct read with a clip |
| External, encrypted, accessible | Read through the controller |
| External, inaccessible | Destructive or scan-based |
| Internal to the MCU | Device-level extraction |
The route ranking by cost is the one in three physical routes into flash, and the read margin questions that decide whether a direct read will be reliable on an aged part are in floating gate margins.
What the service does
We identify the memory device on an unfamiliar board as a standalone step, and report the three facts that determine everything after it.
| Deliverable | Content |
|---|---|
| Device identification | Manufacturer, type, capacity, from the identifier response |
| Interface | Lane count, clock rate, command set in use |
| Boot map | Which addresses are read at power-up, in what order |
| Extraction route | Which of the four routes applies, with cost |
The boot map is often the most useful output even when the customer already knew which chip held the code, because it shows where the boot loader ends and the application begins, which is the first question any later analysis asks. Where the board-level search itself is part of a wider investigation, the equivalent work for an on-chip array is in discover IC firmware.
Break ATmega1280 encrypted flash memory
A request to break ATmega1280 encrypted flash memory begins with the fact that ATmega1280 carries 128 KB of in-system programmable flash and 8 KB of SRAM and runs at 16 MHz in a 100-lead TQFP body. The work starts with the lock byte and the fuse bytes, because a megaAVR guards its arrays with lock bits rather than a numeric readout level.
Break Chip ATmega1280 Flash memory normally is in the status of reading protective model, through our Microcontroller unlocking technique, flash memory and eeprom memory from ATmega1280 MCU can be readout
break ATmega1280 encrypted flash memory: reading the protection before the array
A classic megaAVR protects its memory with a lock-bit byte rather than a graded level. LB1 and LB2 are the memory lock bits: with both unprogrammed the flash, EEPROM and fuse bytes are readable over the programming interface, programming either one blocks further writes and verification, and programming both closes read-back so an external tool sees only blank words for the arrays. BLB0 and BLB1 are separate boot lock bits that govern what the boot section and the application section may do with SPM writes and LPM reads, so a firmware-assisted dump is either enabled or walled off independently of the main lock bits. The fuse bytes sit beside the lock byte: CKSEL and SUT choose the clock, BOOTSZ and BOOTRST size and place the boot section, EESAVE decides whether a chip erase keeps the EEPROM, SPIEN enables serial programming and RSTDISBL repurposes the reset pin. The lock and fuse bytes stay readable while the arrays do not, which is why the first move on the bench is always a read of those bytes and never an erase.
how the ATmega1280 memory is laid out
On the ATmega1280 the 128 KB program array is written a page at a time and erased as a whole, with a boot section whose size is set by the BOOTSZ fuses. Beside it sits 8 KB of SRAM and 4 KB of data EEPROM, the latter being an independent array that a chip erase clears unless EESAVE was programmed. The only operation that clears the lock bits is a chip erase, and that same operation wipes the flash and, unless EESAVE is set, the EEPROM. The protection therefore comes down only at the exact moment the firmware disappears, and the 100-lead TQFP body changes nothing about that arithmetic because the array size is fixed by the ordering code rather than by the lead frame.
| ATmega1280 recovery geometry | Value |
|---|---|
| Program flash | 128 KB, page-programmable, boot section by BOOTSZ |
| Data EEPROM | 4 KB, cleared by chip erase unless EESAVE |
| SRAM | 8 KB |
| Core and clock | AVR RISC at 16 MHz |
| Protection | lock bits LB1/LB2 and BLB0/BLB1, fuse bytes |
| Package | 100-lead TQFP, 100 pins |
the ATmega1280 interface once protection is set
The part is reached over the in-system serial programming interface driven by the reset, clock and data pins, and the same wires carry the read of the fuse and lock bytes. What fails under a set lock byte is the array read: a programmer asking for flash or EEPROM receives blank words while the part still runs its firmware normally and returns its configuration bytes cleanly. The practical routes are a clean read while the lock byte is open, a firmware-assisted dump where the boot lock bits allow it, or a chip erase the customer must approve in writing.
choosing the route for break ATmega1280 encrypted flash memory
Read the fuse and lock bytes first, then decide, because that result settles whether any firmware can be recovered at all. An open lock byte means a clean read over the programming interface and the heximal can be pulled directly, while a part with LB1 and LB2 both programmed leaves only the destructive erase as a route to a blank device. The ATmega1280 is the 128 KB of flash device in a 100-lead TQFP body, so the capacity marking and the package settle the array size before anything is priced. The 100-pin body and the external memory interface are the traits that separate this member from the 64-pin siblings. What survives the lock: the fuse and lock bytes themselves, the device signature and the calibration byte, the peripheral registers while the part runs, and the EEPROM if EESAVE was programmed before any erase.
comparing ATmega1280 with its family
When a board arrives marked only with a partial code, the megaAVR family is the place to look, because its members share the same lock byte, the same fuse layout and the same erase coupling while differing in flash, SRAM, EEPROM, pin count and on-chip peripherals. Neighbouring members span 16 KB to 256 KB of flash with SRAM from 1 KB to 16 KB, and the low-voltage V grades trade clock speed for a wider supply range without changing the lock byte.
Our notes on break avr mcu attiny84 protected source code, break chip atmega162l firmware, break chip atmega48pa firmware and break chip atmega48pa heximal use the same bench sequence, and break chip atmega8a binary records the variant with the wider supply range.
what the customer receives from a break ATmega1280 encrypted flash memory job
For a board that arrived as a break ATmega1280 encrypted flash memory request, the deliverable is a confirmed capacity, a lock-byte state and a priced route agreed in writing before any destructive step, and our engineers read the fuse and lock bytes first.
Break ATmega1280V secured EEPROM program
A request to break ATmega1280V secured EEPROM program begins with the fact that ATmega1280V carries 128 KB of in-system programmable flash and 8 KB of SRAM and runs at 8 MHz in a 100-lead TQFP body. The work starts with the lock byte and the fuse bytes, because a megaAVR guards its arrays with lock bits rather than a numeric readout level.
Break MCU ATmega1280V Eeprom memory for its data, and flash memory for its program, then extract files from both Microcontroller memories, disable the fuse bit by Microprocessor cracking
the first read in a break ATmega1280V secured EEPROM program job
A classic megaAVR protects its memory with a lock-bit byte rather than a graded level. LB1 and LB2 are the memory lock bits: with both unprogrammed the flash, EEPROM and fuse bytes are readable over the programming interface, programming either one blocks further writes and verification, and programming both closes read-back so an external tool sees only blank words for the arrays. The fuse bytes sit beside the lock byte: CKSEL and SUT choose the clock, BOOTSZ and BOOTRST size and place the boot section, EESAVE decides whether a chip erase keeps the EEPROM, SPIEN enables serial programming and RSTDISBL repurposes the reset pin. The lock and fuse bytes stay readable while the arrays do not, which is why the first move on the bench is always a read of those bytes and never an erase.
ATmega1280V program and data arrays and the erase coupling
On the ATmega1280V the 128 KB program array is written a page at a time and erased as a whole, with a boot section whose size is set by the BOOTSZ fuses. Beside it sits 8 KB of SRAM and 4 KB of data EEPROM, the latter being an independent array that a chip erase clears unless EESAVE was programmed. The only operation that clears the lock bits is a chip erase, and that same operation wipes the flash and, unless EESAVE is set, the EEPROM. The protection therefore comes down only at the exact moment the firmware disappears, and the 100-lead TQFP body changes nothing about that arithmetic because the array size is fixed by the ordering code rather than by the lead frame.
| ATmega1280V recovery geometry | Value |
|---|---|
| Program flash | 128 KB, page-programmable, boot section by BOOTSZ |
| Data EEPROM | 4 KB, cleared by chip erase unless EESAVE |
| SRAM | 8 KB |
| Core and clock | AVR RISC at 8 MHz |
| Protection | lock bits LB1/LB2 and BLB0/BLB1, fuse bytes |
| Package | 100-lead TQFP, 100 pins |
the ATmega1280V interface once protection is set
The part is reached over the in-system serial programming interface driven by the reset, clock and data pins, and the same wires carry the read of the fuse and lock bytes. What fails under a set lock byte is the array read: a programmer asking for flash or EEPROM receives blank words while the part still runs its firmware normally and returns its configuration bytes cleanly. The practical routes are a clean read while the lock byte is open, a firmware-assisted dump where the boot lock bits allow it, or a chip erase the customer must approve in writing.
a decision tree for break ATmega1280V secured EEPROM program
Read the fuse and lock bytes first, then decide, because that result settles whether any firmware can be recovered at all. An open lock byte means a clean read over the programming interface and the heximal can be pulled directly, while a part with LB1 and LB2 both programmed leaves only the destructive erase as a route to a blank device. The ATmega1280V is the 128 KB of flash device in a 100-lead TQFP body, so the capacity marking and the package settle the array size before anything is priced. The 100-pin body and the external memory interface are the traits that separate this member from the 64-pin siblings. What survives the lock: the fuse and lock bytes themselves, the device signature and the calibration byte, the peripheral registers while the part runs, and the EEPROM if EESAVE was programmed before any erase.
sibling parts of the ATmega1280V
When a board arrives marked only with a partial code, the megaAVR family is the place to look, because its members share the same lock byte, the same fuse layout and the same erase coupling while differing in flash, SRAM, EEPROM, pin count and on-chip peripherals. Neighbouring members span 16 KB to 256 KB of flash with SRAM from 1 KB to 16 KB, and the low-voltage V grades trade clock speed for a wider supply range without changing the lock byte.
Comparable recoveries are documented in break atmega32u2 au microcontroller flash memory, break atmega64l secured microcontroller flash memory, break atmega8 encrypted mcu fuse bit, break atmel avr mcu atmega8535l heximal and break avr atmega64a binary, each starting from the configuration read.
closing out a break ATmega1280V secured EEPROM program request
For a board that arrived as a break ATmega1280V secured EEPROM program request, the deliverable is a confirmed capacity, a lock-byte state and a priced route agreed in writing before any destructive step, and our engineers read the fuse and lock bytes first.
Unlocking a Block Erases It: The Binding You Cannot Break
The most common request we receive about a locked flash is a contradiction, and it arrives in good faith. The customer wants the block protection removed and the contents kept. On the majority of devices that have block protection at all, these two things cannot both happen, because removing the protection is the erase.
That is not a policy or a licensing decision. It is how the cell array is wired.
Why the lock cannot be changed in place
A protection bit has to live somewhere, and on a flash device the only memory that survives a power cycle is the flash itself. So the lock state is stored in the array, in a location the programming interface treats specially.
Changing a bit inside a flash array requires an erase first. A program operation can only move a cell from the erased state to the programmed state; it cannot move it back. To take a programmed lock bit and clear it, the containing block must be erased, and the block that contains the lock bits is by design either the same block that holds the code or a dedicated configuration block that the erase command reaches through the same path.
| Implementation | Where the lock lives | What clearing it costs |
|---|---|---|
| Security fuse plus chip erase | A dedicated fuse row | Full chip erase by definition |
| Protection register in a config block | The config block itself | Erase of the config block, and often of everything |
| Debug-level field | A one-way counter | Descending a level triggers mass erase |
| Per-sector lock bits | Sector headers | Erase of each sector whose bit changes |
Every row ends in an erase. The variation is only in how much is lost.
Three implementations of the same binding
The first implementation is the oldest and the bluntest. A security fuse is programmed once the firmware is final, and the only documented way to clear it is a full chip erase, which the vendor’s programming tool performs as a single command. The fuse does not get cleared separately; the erase clears it as a side effect, then the erase clears everything else.
The second is the debug level. A device ships with a debug port open at level zero. Setting level one closes the port but leaves the flash readable through the core. Setting level two closes both. Returning from level two to level one is documented as triggering a mass erase, on the reasoning that a party who could close the port must be the same party who can afford to lose the contents.
| Transition | Erase triggered | Data kept |
|---|---|---|
| Level 0 to 1 | No | Yes |
| Level 1 to 2 | No | Yes |
| Level 2 to 1 | Yes, mass | No |
| Level 2 to 0 | Yes, mass | No |
The third is per-sector locking on parallel NOR devices. Here the lock bits genuinely are per sector, and in a few families they can be set and cleared with a command sequence rather than an erase. But those parts are the exception, they are usually the older ones, and even they require the device to be in a state where the command sequence is accepted — which on a production board means the write-protect pin is already asserted and cannot be released without the same authority the lock was meant to deny.
What the datasheets say, and where
The binding is always documented, and it is always in a footnote rather than in the feature list. Search the datasheet for the word “erase” inside the section on protection, not the section on memory organisation.
Typical wording is that clearing the protection “requires a device erase” or that the operation “will erase all memory contents”. Both phrases mean the same thing, and both are easy to miss because the feature list on page one says only that the device offers block protection.
| Document location | Phrase to look for | Meaning |
|---|---|---|
| Protection register description | “erased to clear” | The bits are cells; erase is the only clear |
| Debug chapter | “mass erase is performed” | Level change destroys contents |
| Programming manual | “chip erase before unlock” | Order is fixed, not a recommendation |
| Errata | “unexpected erase” | The binding bit them in silicon |
The errata entry is the one that surprises people. A small number of parts trigger the erase on a path the datasheet did not describe, usually a reset during a protection command, and the result is a device that was unlocked and empty when the engineer expected it to be unlocked and full.
Why the request keeps arriving
The request is reasonable from the customer’s point of view, because the marketing material describes protection as a lock rather than as a fuse. A lock implies a key. A fuse implies destruction. The distinction matters enormously when the goal is to read a device in order to repair it rather than to copy it.
We spend a disproportionate amount of the first conversation on this point, because a customer who expects data preservation will authorise a procedure that cannot deliver it, and then judge the result as a failure of technique. The honest framing is that the block protection worked exactly as designed.
The narrow cases where data does survive
There are three, and none of them is common.
The first is a device with two independent protection layers, where the outer layer is a register that resets on power cycle and the inner layer is the fuse. Clearing the register costs nothing, and if the code was only protected by the register, the data is intact. This is a design mistake rather than a feature, and it is worth testing for, because it costs one power cycle to check.
The second is a device where the locked region is a small parameter block and the code sits in unlocked sectors. Erasing the parameter block to clear its lock leaves the code readable. The customer loses calibration and keeps the program.
The third is a device whose lock is enforced by the boot loader rather than by the array. The array has no protection at all; the loader simply refuses to expose it. That is not a block lock in the hardware sense and it falls to the routes described in three physical routes into flash rather than to an unlock procedure.
What to do instead
When the binding is real, the planning question becomes which of three outcomes is acceptable.
If the contents are still wanted, the only route is to read them while the lock is in place, which means attacking the read path rather than the lock. That is the block-level protection question: which blocks the design left open, and whether the open ones are enough.
If the contents are not wanted and the goal is a working device, the unlock is trivial: perform the erase, accept the loss, and program a known image, which is the rebuild problem covered in three sources for rebuilding flash.
If neither is acceptable, the device is a candidate for destructive reading, where the lock is irrelevant because the array is imaged directly rather than read through the interface.
| Goal | Route | Contents after |
|---|---|---|
| Read the code | Attack the read path | Intact |
| Working device | Erase, then program | Replaced |
| Code from a dead unit | Image the array | Intact, device lost |
Half-erased states
One final note, because it changes the arithmetic. An erase that is interrupted does not always complete. A device that lost power midway through a mass erase can end up with some blocks cleared and others untouched, and the untouched ones may still be readable — a state examined in interrupted erase.
This is not a reliable unlock method. It is, however, a reason to attempt a read before declaring a device empty, because “the erase ran” and “the erase finished” are different statements and only the second one guarantees that nothing is left.
What the service does
We identify which of the four lock implementations the device uses, and state plainly what clearing it will cost before any work begins.
| Deliverable | Content |
|---|---|
| Lock classification | Which of the four mechanisms is present |
| Data consequence | What the documented unlock destroys |
| Alternative route | Whether the read path can be attacked instead |
| Recommendation | Read-in-place, rebuild, or destructive imaging |
The classification is usually answerable from the datasheet and a bench measurement, and it takes less time than the conversation about expectations. Where the answer is that the data cannot survive an unlock, we say so at that point rather than after the device has been erased.
Three Physical Routes Into Flash, Ranked by Cost
Three routes reach a flash array when the ordinary interfaces will not. They are not alternatives on a price list; they are ordered by equipment threshold and by whether the device is expected back.
The ordering is stable across device types, which makes it useful as a planning tool: the first route is almost always worth attempting before the second is purchased.
Route one: through a debug or DMA path
The cheapest physical route is the one that is not physical at all. It is a debug or DMA path that the design left available despite the read protection.
The mechanism varies. A debug unit that can perform memory transfers on behalf of the core, a DMA controller that can be programmed to read flash into a buffer that is then transmitted, a peripheral that has bus-master capability — all of them move data without going through the read-protection check, because the check is applied to the read command rather than to every bus transaction.
| Mechanism | Requires | Data path |
|---|---|---|
| Debug memory transfer | A live debug port | Direct to the debugger |
| DMA to a serial peripheral | A way to start a transfer | Through the peripheral |
| Bus-master peripheral | Control of the peripheral | Through the peripheral |
| Core executing a loader | Any code execution | Indirect |
The fourth row is the general case and the most powerful: if any code can be made to run, that code can read the flash, because the core is not subject to the read-protection check that the external interface is.
Route two: fault injection
The second route is to make the device accept a read it would normally refuse, by corrupting the decision rather than by bypassing the check.
The equipment is a glitch rig: a programmable pulse generator, a means of injecting into the supply or the clock, and a trigger. The cost is in the five figures, the duration is weeks, and the device usually survives.
| Parameter | Typical requirement | Why it costs |
|---|---|---|
| Pulse resolution | Sub-nanosecond | Fast electronics |
| Trigger accuracy | A few nanoseconds | Characterisation |
| Fixture | Device-specific | Custom hardware |
| Campaign duration | Weeks | Parameter space |
The fourth row is the one that dominates the schedule. The search space described in glitch attacks as a search problem is thousands of points, and each attempt costs a device reboot.
Route three: reading the array directly
The third route removes the package and reads the array with an instrument. The device does not survive, and the reading must be complete on the first attempt.
The equipment is a decapsulation station, a microscope with a suitable camera, and the analysis software to convert an image into bit values. The duration is weeks to months depending on the array size and the feature size.
| Element | Requirement | Cost driver |
|---|---|---|
| Decapsulation | Wet or plasma, selective | Per device, and skill |
| Imaging | Resolution below the feature size | Optics and camera |
| Positioning | Sub-micron stage | Mechanics |
| Analysis | Bit extraction from the image | Software and time |
The first row is where devices are lost. A decapsulation that goes slightly too far removes the layer that carries the state, and the array becomes unreadable at the same moment it becomes visible.
Ranking by the deciding property
Cost is not the only axis. Two routes may cost the same and differ entirely in whether the customer gets the device back.
| Route | Equipment threshold | Duration | Device survives |
|---|---|---|---|
| Debug or DMA | Existing tools | A day to a week | Yes |
| Fault injection | Five figures | Two to six weeks | Yes, usually |
| Direct array read | Six figures | Four to twelve weeks | No |
The fourth column is the one that decides the route in most real engagements. A customer with one unit of a discontinued product cannot accept a destructive route, and a customer with a failed unit has nothing to lose.
| Customer situation | Acceptable route |
|---|---|
| One working unit, must be returned | Route one, then two |
| One working unit, no return needed | Any route |
| Many units | The cheapest route that works |
| Dead unit, array intact | Route three |
What makes route three fail
The direct read fails for four reasons, and knowing them prevents an expensive attempt.
The array may be covered by a layer that cannot be removed without destroying it: a shield, a conformal coating, or a mould compound that bonds to the passivation.
| Failure cause | Detectable before | Recovery |
|---|---|---|
| Shield or coating | Inspection, X-ray | None |
| Feature size below the optics | Part number and process | Higher magnification |
| Encrypted array | Entropy of any electrical read | None |
| Damaged during decapsulation | No | None |
The third row is the one worth checking first. If the device decrypts in the fetch path, a perfect image of the array yields ciphertext and the whole route is pointless; the test for that is the entropy measurement in instruction-fetch decryption.
Choosing between one and two
Routes one and two are both non-destructive and they are frequently considered together. The choice is made by what the device will accept.
Route one requires an interface that responds. If the device answers a debug request at all, even with a refusal, there is a path to explore.
| Observation | Route indicated |
|---|---|
| Debug port responds | One |
| Debug port silent, device runs | Two |
| Debug port silent, device dead | Three |
| Read command refused, timing varies | Two |
The second row is the common case on a modern protected part: the port is disabled and the device runs normally. That is the situation fault injection exists for, and it is why the technique is worth its cost.
What the service does
We assess the three routes against the specific device and report the cost of each, including the probability of success where it can be estimated.
| Assessment output | Content |
|---|---|
| Route one feasibility | Whether any interface responds |
| Route two feasibility | Whether a glitch window is reachable |
| Route three feasibility | Whether the die can be opened and imaged |
| Recommended route | The cheapest route with a non-trivial success chance |
The recommendation is not always the cheapest. A route with a ten percent success chance and a month of work is more expensive in expectation than the next route up, and the report says so.
The interface assessment that route one depends on is in read MCU code, and the block-level protection that determines whether route one is even needed is in block-level protection. Where route three is the answer and the array turns out to be encrypted, the limit is the one in bus encryption.
Tampering Needs Rewritable Memory: Why OTP Ends the Conversation
A request to change a device’s behaviour is a request to change the bytes it executes. Whether that is possible is decided by the storage technology before any consideration of protection, because a technology that cannot be rewritten cannot be modified no matter how accessible it is.
This is the first question to settle, and it splits requests into two groups that need different answers.
The storage question
Four storage technologies appear in programmable devices, and only two of them can be rewritten.
| Technology | Rewritable | Modification possible |
|---|---|---|
| Flash | Yes, thousands of cycles | Yes |
| EEPROM | Yes, millions of cycles | Yes |
| OTP fuse or antifuse | No | Only in one direction |
| Mask ROM | No | No |
The first two rows are the cases where modification is a technical exercise. The last two are the cases where it is impossible in the ordinary sense, and the work becomes either a replacement or an exploitation of something outside the storage.
Why OTP is not entirely absolute
OTP is one-time in the sense that a bit can be moved from its unprogrammed state to its programmed state once. That is a direction, not an absolute.
On most OTP technologies the unprogrammed state reads as one and programming moves it to zero. A bit that is already zero cannot be moved back. So a modification is possible only if it consists of changing ones to zeros in a location that is still programmable.
| Change | Possible in OTP | Why |
|---|---|---|
| 1 to 0 at a programmable location | Yes | The remaining budget |
| 0 to 1 anywhere | No | Irreversible |
| A branch opcode rewritten | Only if the new encoding is a subset | Encoding dependent |
| A constant reduced | Possibly, by clearing bits | Value dependent |
| A constant increased | No | Requires setting bits |
The third row is the interesting one and it is occasionally exploitable. Some instruction encodings allow a conditional branch to be changed into an unconditional one by clearing a bit, because the condition field is a small number of bits and the unconditional encoding is a special case of it. Where that is true, a single bit clears a check on a device that was supposedly unmodifiable.
The fourth row is the same idea in data: a limit that is a power of two minus one can be reduced by clearing bits, which is why the choice of a limit value matters on a one-time device.
Mask ROM
Mask ROM has no programmable state at all. The pattern is fixed at fabrication.
A mask ROM device cannot be modified by any means that operates on the device’s contents. What can be done is to replace the device with an equivalent that behaves differently, which is the reconstruction work described in recovering an IC program, or to change the system around it so that the unmodified behaviour is no longer the limiting factor.
| Approach | Modifies the device | Effort |
|---|---|---|
| Emulator in place of the device | No, substitutes | Days to weeks |
| Replacement with new logic | No | Weeks |
| System-level workaround | No | Variable |
| Modification of the ROM | Not possible | — |
The third row is worth considering before the first two, because it is frequently cheaper. A device whose behaviour is fixed can often be accommodated by changing the board, the host or the surrounding logic, and that is an engineering solution rather than a reverse engineering one.
What modification requires beyond rewritable storage
Rewritable storage is necessary and not sufficient. Three further conditions have to hold.
The image has to be understood well enough to locate the change, which is the boundary and function work in MCU break. The integrity mechanism has to be satisfiable, which is the recomputation problem in patching IC code. And the device has to be re-programmable in the field or on the bench, which requires access to the programming interface.
| Condition | If absent |
|---|---|
| Rewritable storage | Not possible |
| Located change point | The patch cannot be placed |
| Satisfiable integrity check | The device refuses the image |
| Programming access | The patch cannot be written |
The fourth row is the one that is overlooked in a design that is otherwise modifiable. A device whose flash is rewritable but whose programming interface is locked has storage that can change and no way to change it.
The two directions of a modification request
Requests arrive in two forms, and they have different difficulty.
Removing a restriction is the common case, and it is usually a branch. The change is small, its location is findable, and its effect is immediate.
Adding a feature is the harder case, because it requires code that was never written. The space for it has to be found, which is the placement problem in minimal firmware injection.
| Request | Change | Difficulty |
|---|---|---|
| Skip a check | One branch | Low |
| Change a limit | One constant | Low |
| Enable an unused feature | A branch plus configuration | Medium |
| Add a new behaviour | New code plus a hook | High |
| Change an algorithm | Many locations | High |
What to tell a customer before quoting
The storage question is answerable from a part number in ten minutes, and it prevents the most wasteful category of engagement.
| Storage | Answer to a modification request |
|---|---|
| Flash or EEPROM | Feasible; cost depends on the change |
| OTP with remaining budget | Possibly feasible; depends on the specific change |
| OTP fully programmed | Not feasible by modification |
| Mask ROM | Not feasible; consider substitution or system change |
The second row is the one that requires care, because “possibly” is not a useful answer to a customer who needs a decision. The way to resolve it is to check the specific change against the encoding: a branch that can be made unconditional by clearing a bit is feasible, and a constant that has to increase is not.
What the service covers
For a modification request we establish the storage technology, the remaining programmable budget if the technology is one-time, the location of the change, and the integrity mechanism. The quotation follows from those four, and it is either a patch or a refusal with an alternative.
| Finding | Deliverable |
|---|---|
| Flash, no integrity check | A patched image |
| Flash with a CRC | A patched image and a recomputed value |
| OTP with a bit-clearing patch available | A patched image, tested |
| Mask ROM | A statement, plus a substitution or system route |
The alternative for a device that cannot be modified is the substitution route in behavioural reconstruction, which is more expensive and does not require the device to change. The protection that would have to be defeated on a rewritable device is a separate question, and it is set out in three protection layers.