Archive for December, 2007

AND Gates in logic

Saturday, December 29th, 2007

As we prepare for the New Year, we wanted to leave you with a piece of logic taken out of an older PIC16C series microcontroller. We want you to guess which micro(s) this gate (well the pair of them) would be found in. After the New Year, we’ll right up on the actual micro(s) and give the answer .

An AND gate in logic is basically a high (logic ’1′) on all inputs to the gate. For our example, we’re discussing the 2 input AND. It should be noted that this is being built from a NAND and that a NAND would require 2 less gates than an AND.

The truth table is all inputs must be a ’1′ to get a ’1′ on the output (Y). If any input is a ’0′, Y = ’0′.

The photo above shows the schematic layout using P and N type FETs. A P-FET is conducting between the source and the drain when a logic ’0′ is presented on its gate. The N-FET is the exact opposite (a ’1′ conducts).

As seen above, there are 2 signals we labeled ‘A’ and ‘B’ routed in the Poly layer of the substrate (under all the metal). This particular circuit is not on the top of the device and had another metal layer above it (Metal 2 or M2). So technically, you are seeing Metal 1 (M1) and lower (Poly, Diffusion).

It’s quickly obvious that this is an AND gate but it could also be a NAND by removing the INVERTER and taking the ‘!Y’ signal instead of ‘Y’.

The red box to the left is the NAND leaving the red box to the right being the inverter creating our AND gate.

The upper green area are PFET’s with the lower green area being NFET’s.

After stripping off M1, we now can clearly see the Poly layer and begin to recognize the circuit.

This is a short article and we will follow up after the New Year begins. This is a single AND gate but was part of a pair. From the pair, this was the right side. We call them a pair because they work together to provide the security feature on some of the PIC16C’s we’re asking you to guess which ones

If you have Photoshop, here is a link to a Photoshop image we created for you that you can control the layer opacity to see the remove the top metal to see how the poly and M1 layers connected virtually.

Happy Holidays and Happy Guessing!

ST201: ST16601 Smartcard Teardown

Monday, December 17th, 2007

ST SmartCards 201 – Introduction to the ST16601 Secure MCU

This piece is going to be split into two articles-Â

• The first being this article is actually a primer on all of the ST16XYZ series smartcards using this type of Mesh technology.Â  They haveÂ overgone a few generations.Â Â We consider this device to be a 3rd generation.
• Â In a seperateÂ article yet to come, we are going to applyÂ what you have read here toÂ a smartcard used by Sun Microsystems, Inc. calledÂ Payflex.Â  From what we have gathered on the internet, theyÂ are used toÂ controlÂ access to Sun Ray Ultra Thin Terminals.Â  Speaking of the payflex cards, they are commonly foundÂ (new and used) on eBay.

The ST16601 originated as far back as 1994.Â  It originallyÂ appeared as a 1.2Â um, 1 metalÂ CMOS process and was laterÂ shrunk to 0.90Â um, 1 metal CMOS to support 2.7v – 5.5v ranges. Â

It appears to be a later generation of the earlier ST16301 processor featuring larger memories (ROM, RAM, EEPROM).

The ST16601Â offers (quick spec is here):

• 6805Â cpu core withÂ a few additional instructions
• Lower instruction cycle counts vs. Motorola 6805.
• Internal Clock can run upto 5 Mhz at 1:1 vs 2:1.
• 6K Bytes of ROM
• 1K Bytes of EEPROM
• 128 Bytes of RAM
• Very high security features including EEPROM flash erase (bulk-erase)

Although it was released in 1994 it was being advertised in thisÂ articleÂ in 1996.Â  Is it possible an ‘A’ version of theÂ ST16601 wasÂ released without a mesh?Â  We know theÂ ST16301 was so anything is possible.

Â

Above:Â  ST16301 1.2um “secure” MCU sporting 160 bytes of RAM, 3K bytes of ROM, and 1K bytes of EEPROM and NO TOP METAL PROTECTION (MESH).

Above:Â  Original 1994 1.2um ST16601B.Â  Notice this part has been covered in a mesh that was basically a humoungous ground plane over the device.Â

Above:Â  Final revision of the ST16601(C?).Â  The part has been shrunk to 0.90um and now has ST’s 2nd generation mesh in place.Â  The newer mesh still in use today consists of fingers connected to ground and a serpentine sense line connected to power (VDD).

Using our delayering techniques, we removed the top metal mesh from the 1997 version of the part.Â  The part numbering systemÂ was changed in 1995 onward to not tell you what partÂ something really is.Â  You haveÂ to be knowledgable about the features present and then playÂ match-up from their website to determine the real partÂ number.

As you can see, this part is clearly an ST16601 part exceptÂ it is now calledÂ a K3COA.Â  We know that theÂ ’3′ represents the entire ST16XYZ series from 1995-1997 but we’ll get into their numbering system when we write theÂ ST101 articleÂ (we skipped it and jumped straight to ST201 to bring you the good stuff sooner!).

Above:Â Â 1000x magnification of the beginning of theÂ second generation mesh used ont he 1995+ parts.Â  This exact mesh is still used today on their latest technology sporting 0.18um and smaller!Â  The difference- theÂ wire size and spacing.

In the above image, green is ground, red is connected to power (VDD).Â  Breaking this could result in loss of ground to a lower layer as wellÂ asÂ the sense itself.Â  The device will not runÂ with a broken mesh.Â

Above you can see Flylogic has successfully broke their mesh and we did it without the use of a Focus Ion-Beam workstation (FIB).Â  In fact, we are the ONLY ONES who can open the ST mesh at our leisure and invasively probe whatever we want.Â  We’ve been sucessful down-to 0.18um.

Using our techniques we call, “magic” (okay, it’s not magic but we’re not telling ), we opened the bus and probed it keeping the chip alive.Â  We didn’t use any kind of expensive SEM or FIB.Â  The equipment used was available back in the 90′s to the average hacker!Â  We didn’t even need a university lab.Â  Everything we used was commonly available for under \$100.00 USD.Â

This is pretty scary when you think that they are certifying these devices under all kinds of certifications around the world.

Â Stay tuned for more articles on ST smartcards.Â  We wanted to show you some old-school devices before showing you current much smaller ones because you have to learn to crawl before you walk!

Infineon SLE4442

Saturday, December 1st, 2007

The SLE4442 has been around for a long time.Â Â Spanning a little more than 10 years in the field, it has only now began to beÂ replaced by theÂ  newer SLE5542Â (We haveÂ analyzed this device too and will writeÂ up an article soon).

It is basically a 256 byte 8 bit wide EEPROM with special write protection.Â  In order to successfully write to the device, you need to know a 3 byte password called the Programmable Security Code (PSC).Â  The code is locked tightly inside the memory area of the device and if you try to guess it, you have 3 tries before being permanently locked out forever (well forever for some, we can always perform magic on the part).

Note:Â  Clicking on all pictures except the diagram will give you a larger ~2 MB 2400 * ~2400 image in a seperate window

The photo above is a picture shows the entire substrate.Â  There was still some dirt on the die but it didn’t effect our interests.Â  The geometry of the device is pretty big (> 2 uM).Â  It has one polysilicon layerÂ and one metal layer fabricated using an NMOS process.

Note:Â  Just because the device is big does not constitute ease of an attack but it does make execution of an attack easier for an attacker without large amount of expense.

The above diagram has been taken from Page 7 of the SLE4442 PDF.Â

A successful attack on this device means an attacker knows the PSC which enables write operations to the device under attackÂ or the abilityÂ to clone the device under attack into fresh new target who can act like the original device.Â  We’ll discuss the PSC in more detail below.

We have pretty much identified all the important areas listed on the Page 7 diagramÂ in theÂ above picture.Â  We can see again a test circuit that has had its enable sawn off during production.Â  We can see the enable line looping back for the die that was placed to the right of this die.Â  Notice the duck?Â  Hrmmmm… Seems to be pointing at 2 test points.Â  We’ll just say that the duck probably knows what he’s looking at

We left out a few areasÂ noted in the block diagram however the most important areas have been highlighted in red.

Â Â

We removed the top metal (the only metal layer) and you can now see the diffusion and poly layers.Â  You can literally take these two pictures above andÂ create a schematic from them if you understand NMOS circuits.

Possible attacks on the device:

• Electrical glitches:Â  Fed through VCC / CLOCK line are possible.Â  The circuit latches are all toggled from the serial clock provided by the user.
• Optical Erasure:Â  UV seems to clear cells of the EEPROM to zero.Â  Masking of the EEPROM except for the 3 PSC bytes would result in a PSC of \$00,\$00,\$00 for that particular device.Â  However note this is not a favorable attack as the device would probably become rejected by the host that this device belongs too.
• OpticalÂ glitches:Â  TheseÂ give strange results.Â  An optical glitch in the right area might produce readback of the PSC code through command \$31 (Read Security Memory).
• Bus attacks:Â  Sitting on the databus will show you the PSC of the device.Â  This method is effective but not easilly accomplish by most.
• PSC Control logic:Â  Find the right signal in this area and you can make the device believe a valid PSC has been previously given allowing readback of the PSC through command \$31.Â  This is our prefered method, just ask the duck .

The security model used on this type of device is one in which the host-environment is trusted.Â  This is a riskyÂ way of thinking but ironically, it has been used a lot (Fedex/Kinko’s payment cards(SLE4442, SLE5542), Telephone cards in use worldwide (ST1335, ST1355), laundry machine smartcards (AT88SC102).

Proof of failure of this trust model has been shown in places such as:

• Phone card emulation in Europe.Â  It became so bad, metal detectors were placed inside the phones smartcard area to deter eavesdropping.
• Fedex/Kinko’s was successfully compromised by a man named Strom Carlson.Â  He demonstrated the abuse of the SLE4442 in use by Kinko’s at the time.Â  You can read an article about it here.