8 ms·
Home Made TPM2.0 Module
- londons_explore 5y agoIs it possible to make your own TPM 2.0 chip? Or at least hardware that emulates the chip? Or are there root secret keys or something that requires certification and very expensive membership to a professional body and NDA agreements to access?
- mcwhy 5y agoThat's the whole point of a TPM/Pluton/etc, remote attestation and corporate control over people.
- Nextgrid 5y agoI don't believe so - QEMU and proprietary hypervisors can emulate TPMs just fine.
- Avamander 5y agoOnly if you want someone special to trust your hardware, then it requires effort. Otherwise not.
- zxcvgm 5y agoIt depends on how the TPM is being used by the OS and its apps. If it’s purely being used for the crypto key storage and crypto operations, then you can probably use something like the MS reference implementation [0]. If the OS requires attestation and endorsement, there is a manufacturer key pair that is embedded into the chip that you can use to attest and verify that the TPM you are interacting with is indeed from a particular manufacturer. That aspect would not be doable for an emulated DIY TPM. [0] https://github.com/microsoft/ms-tpm-20-ref https://github.com/microsoft/ms-tpm-20-ref
- CuriousCosmic 5y agohttps://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/tpm-key-attestation#BKMK_DeploymentOverview https://docs.microsoft.com/en-us/windows-server/identity/ad-... This link has some useful details on attestation. For a lot of software you should be able to still use a custom TPM since you could use the EKPub based attestation which is per-device. This would allow you to bake your custom key into the device prior to installation and then whitelist it. I'm by no means an expert but since this is mostly handled at the OS level, provided you control the infra you should be able to roll your own custom TPM and still support attestation & endorsement. So if you are dealing with this on your own personal hardware or in your company (and you have IT's blessing), you should be able to do it but it won't work out of the box.
- Terry_Roll 5y agoSoftware emulation https://github.com/stefanberger/swtpm https://github.com/stefanberger/swtpm with bugs https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=tpm https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=tpm https://tpm.fail/ https://tpm.fail/ https://github.com/VernamLab/TPM-Fail https://github.com/VernamLab/TPM-Fail The Bob Rudis bit explains TPM shouldnt be relied on. https://www.forbes.com/sites/daveywinder/2021/10/16/critical-windows-11-warning-as-14-security-flaws-confirmed-7-days-after-launch/ https://www.forbes.com/sites/daveywinder/2021/10/16/critical...
- cryptonector 5y agofTPMs can be relied on. dTPMs can't be, but mainly because of bootstrapping issues that keep the BMC/BIOS from using encrypted and audit sessions to protect against passive and active on-bus attacks. EDIT: Regarding side-channel attacks, presumably fTPMs that have such vulnerabilities can be fixed. dTPMs can also get firmware updates, but I'm not sure that every dTPM side-channel vulnerability is fixable -- it might depend on the chip's hardware capabilities, though the STM one in the TPM-FAIL attack was fixed.
- Terry_Roll 5y ago> fTPMs can be relied on. dTPMs can't be, but mainly because of bootstrapping issues that keep the BMC/BIOS from using encrypted and audit sessions to protect against passive and active on-bus attacks. Microsoft seems to disagree with you. https://docs.microsoft.com/en-us/windows/iot-core/secure-your-device/tpm https://docs.microsoft.com/en-us/windows/iot-core/secure-you... Firmware TPM (fTPM) requires special Processor/SoC support that is not currently implemented on Raspberry Pi 2 or 3. MinnowBoard Max needs firmware version 0.80 or higher. DragonBoard410c provides fTPM capabilities out of the box enabled by default. Discrete TPM (dTPM) is considered the utmost trustworthy solution by all means Software TPM (sTPM) is also referred to as TPM Simulator. It is platform-independent, supported on Windows IoT Core. sTPM is intended for development purposes only and does not provide any real security benefits. Chips are just as vulnerable, but its currently harder and not impossible to hack them.
- dark-star 5y agoI guess you could build a simple "stub" TPM using an arduino nano that just speaks enough of the TPM protocol to make Windows happy. It would have to store some bits of binary data somewhere, and maybe have to implement some basic cryptogrphic routines, but I guess it could be possible?
- bem94 5y agoIt's possible, but it is _a lot_ of work! You'd basically be building a cryptographic module (industry standard term, with a lot of specs and requirements to go a long with it), which is no small undertaking in terms of correctness, never mind security. The "basic" cryptographic routines aren't easy either. You're talking ECC and some other symmetric primitives. Secure & efficient ECC implementation is an entire discipline on it's own. I have reservations about the phrase "don't roll your own cryptography" for lots of reasons, but this would be taking rolling your own to the extreme. With all the associated risks. Absolutely possible and a very cool project, but yeah, it's hard to understate the complexity / requirements of a full cryptographic module on top of the cryptographic primitives it needs to support. I actually really like that this person took an existing commercial TPM and could integrate it into their own PCB this way, I think that's a good compromise between building your own TPM with an Arduino, and having to pay lots of money for an out-of-the-box TPM.
- joerichey 5y agoOne reasonable way to do this could involve running the reference TPM2 simulator [0] on the Arduino. It's just a C library that already implements all the cryptographic routines and TPM2 commands. In fact, this is basically how TPM vendors implement their chips. They just generally have: - A lot more hardening against physical attacks - Cryptographic libraries optimized for their low-resource hardware - (sometimes) a vendor certificate for a primary TPM key, aka an "EK cert" Certainly a TPM running on an Arduino wouldn't have the physical hardware properties of a "real" TPM. But you could probably get it into a state with similar software properties. [0] https://github.com/microsoft/ms-tpm-20-ref https://github.com/microsoft/ms-tpm-20-ref
- strstr 5y agoSuperficially, you should be able to make a fully compliant TPM2 on your own like this (unless I’m missing something). The one gap would be that your EK Cert would have to be self signed.
- joerichey 5y agoI don't think that Windows 11 requires any sort of EK cert at all. If they did, it would require them to restrict the TPMs to a list of "approved" vendors. In this case, they bought the actual TPM2 part of the chip from Infinion, so it might already have an EK Cert on it.
- strstr 5y agoWell, that’s what I get for skimming poorly. They did just slap an off the shelf infineon chip in, so yeah, real EKcert from a legit vendor. I skimmed and had some wishful thinking that they just made a cheap off the shelf chip do the job of a TPM2 by slamming in an existing TPM2 implementation.
- Nextgrid 5y ago> I skimmed and had some wishful thinking that they just made a cheap off the shelf chip do the job of a TPM2 by slamming in an existing TPM2 implementation. Is there any evidence that it wouldn't be possible - does Windows have a list of approved EK certificate authorities it expects? The only reason I could think for this would be DRM, but I wouldn't expect this to be a requirement merely to install the OS (the un-approved TPM would still be good for any non-DRM uses, and would be useful in VMs where the TPM is already emulated by the hypervisor).
- cryptonector 5y agoYou can also run your own CA for your home-made TPMs' EKpubs.
- EMIRELADERO 5y agoGood article, however there's a small part that's incorrect: > Although this technology is not new (it was introduced in Windows 10 and Windows Server 2016) TPM support was introduced to Windows as early as Windows 7
- temac 5y agoI'm not sure for TPM2 though.
- CuriousCosmic 5y agoWin 8 specifically with support backported to Win 7.
- Nextgrid 5y agoAre you sure? I remember trying to use BitLocker way before Windows 8 was a thing and it complaining that I didn't have a TPM.
- logicallee 5y agoExcuse my ignorance, but what is a TPM Module? I've never heard of it, what does it do?
- aemreunal 5y agoThis is easily Google'able [1], but here you go: https://support.microsoft.com/en-us/topic/what-is-tpm-705f241d-025d-4470-80c5-4feeb24fa1ee https://support.microsoft.com/en-us/topic/what-is-tpm-705f24... [1]: https://googlethatforyou.com?q=TPM%20Module https://googlethatforyou.com?q=TPM%20Module
- TheSpiceIsLife 5y agoI think the reason for asking the question here, rather than Letting Me Google That For Me, is that that it can lead to interesting conversation, especially since many HN conversations seem to have one or more subject matter experts drop in and explain something.
- car_analogy 5y agoAnother reason is that many of the explanations are little more than industry advertisements, that obfuscate the function of a TPM behind euphemistic or circuitous language.
- yosamino 5y agoIt's a "Trusted Platform Module". The high level summary is that it's a chip that sits inside your computer that is designed to only allow only signed code to run. The computer's manufacturer loads it with a special certificate, so when the computer tries to boot, the bootloader has to include a signature signed with that initial certificate. This bootloader can in turn contain the next certificate to verify the operating system is signed correctly, the operating system in turn contains certificates that verify that user applications are signed correctly. In theory this is a sound idea, in practice things and implementations are a lot more messy.
- 5y ago
- jeroenhd 5y agoVery interesting. My motherboard has a TPM header but MSI sold at most 100 TPMs for it and then changed the spec (LPC to I2C if I recall correctly), never producing them again. Because TPM pinouts differ per manufacturer despite using the same physical connector (because of course they do) it's not quite so easy to take a widely available TPM and use it, even if it speaks the same protocol. This might be a good solution for this. I can also see more opportunities for TPM customisation. For example, with a few leads you could lead the header to a connector outside the case and use the TPM containing the LUKS/Bitlocker key as a portable device safety guarantee; a hacky Yubikey for disk encryption, if you will. Depending on the OS you may even get away with swapping out the TPM between boots, giving you a different set of credentials. TPMs can also be used for some more obscure stuff. With the right library you can use them for things like storing certificate authorities or providing SSH authorization through private keys. Getting proper TPMs into the hands of the people can make for some very interesting experiments. I'm no master solderer so I probably won't solder my own TPM chip. Still, this is a very cool project!
- EMIRELADERO 5y ago> TPMs can also be used for some more obscure stuff. One cool example is the Intel Education Theft Deterrent solution, used in school laptops handed out by some governments. They added a lock function to the BIOS code which checks the (hardware) TPM for signed data. During normal operation, the computer receives a "boot certificate" through an always-on OS agent application from a server physically located in school grounds and accessible only through their intranet. This signed certificate contains, among other things, a boot count (how many reboots until the PC gets locked) and an expiration date (how much time until it gets locked). The idea is that thiefs will not risk taking the computers because they would be unoperable within a few days/reboots, since the data is stored in the TPM and the lock code is in the BIOS itself. This turned out to be a disaster however, as most technical people just modded the BIOS to strip out the system altogether and made easily available tutorials on how to use an EEPROM flasher to load the patched binary. The end result is that, due to bad IT personnel in schools among other factors, legitimate users got their laptops locked all the time while thiefs easily flashed the patch and got them working in minutes.
- tambre 5y agoAnyone know of TPMs supporting Ed25519? I've yet to even find any such chips so far.
- daneel_w 5y agoRelated: a lot of AMD CPUs these days come with "fTPM", which is AMD's built-in TPM solution, voiding the need for an external module. Intel has something similar that I forgot the name of, though I don't know if they've released it into the mainstream yet.
- jhanschoo 5y agoIndeed, the blog post is an interesting read, but the premise is mistaken. Windows 11 is satisfied with TPM that is based in an AMD or Intel chip (arguably, that is even more secure than a discrete chip). https://support.microsoft.com/en-us/windows/enable-tpm-2-0-on-your-pc-1fd5a332-360d-4f46-a1e7-ae6b0c90645c https://support.microsoft.com/en-us/windows/enable-tpm-2-0-o...
- jethack 5y agoEven for Intel, it's been around since 2016 (Skylake). But support depends on system/motherboard.
- jasomill 5y agoDespite not appearing on the CPU (i7-5557U, Broadwell) datasheet, my NUC5i7RYH supports TPM 2.0 after enabling "Intel Platform Trust Technology" in the BIOS, so at least in some cases, this goes back further than Skylake.
- TheGoddessInari 5y agoSevere system stuttering while utilizing AMD fTPM has been one of the top complaints about Windows 11 up until now.
- daneel_w 5y agoI read that the problem manifested only intermittently, which of course can be annoying enough. Supposedly AMD will be issuing a BIOS/UEFI update in May.
- cryptonector 5y ago
- Veliladon 5y agoHe has an H370 which means at least an 8th gen Intel or newer. There's TPM built into the CPU since Skylake and the motherboard should have an option to enable it if it supports regular TPM (usually there's a discrete TPM/fTPM option). It's a nice DIY but completely unnecessary.
- joveian 5y agoYep, I have an older 6th+7th gen Intel processor Gigabyte MB (GA-Z270XP-SLI) and it has the option (Intel Platform Trust Technologies under Peripherals).
- NelsonMinar 5y agoCool hardware hack but not necessary for most computers to run Windows 11. Most BIOS have a software emulation of TPM that Windows is happy to use.
- jhanschoo 5y agoSmall correction: the TPM you're talking about is actually provided by the processor; the BIOS merely exposes an interface to it.
- deknos 5y agoat this point it feels more important to have an working tpm emulator like swtpm in all major linux distributions as a package so we can play freely with it until we all understand it. that said: cool project.