Security notes / Unsorted

From Helpful
Jump to: navigation, search
Security related stuff.

Practical


Theory / unsorted



how to do a login system badly
how to do encryption badly
encrypted connections
data-at-rest encryption
This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, or tell me)


TPM

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, or tell me)


What is it?

The TPM (Trusted Platform Module) is the hardware support of a larger design (Trusted Computing), and that hardware part allows certain secrecies that are otherwise hard to guarantee.


Separate ...or not

Part of its job is 'encryption and key stuff'.

Part of its job is just to be separate -- except when it isn't.


Physically, TPM started as a clearly separate extra chip/module, that might be built into laptops (fairly common in business laptops), and for PC motherboards started as a plug-in module that was quite optional (years later, at least Windows 11 is pushing hard on the concept, being designed to not even run without it(verify)).


These days, you also find TPM is integrated into CPUs (Intel calls it PTT, AMD calls it fTPM). This is functionally similar to a separate TPM - it has its own storage, it can't be altered, only talked to via the same specific protocol.

Upsides

  • saves having to deal with one more component
  • and helps against some physical attacks

Downsides is that

  • it is now harder to upgrade the CPU (not a thing in laptops, but surely so in desktops)
  • it's possible that some attacks might be possible due to being integrated. Yes, it's isolated by a communication channel - that was part of the point - but I wouldn't be surprised if there are side-channel attacks due to being on the same silicon.


What does it do?

The TPM is a different things to different people/needs.

Used well, it makes attack surface smaller, and certain attacks much harder to do remotely.

Used poorly it changes little. And there is also the concept of blind trust leading to riskier behaviour.


More technically, it e.g.

  • helps store some keys,
  • can creates derived keys without revealing the original,
  • can do certain encryption/decryption for you


A little more practically

it being separate hardware makes it harder to steal certain keys
it being separate hardware means there are some cases where you can use a key it stored without every transporting it out.
Keys can not only be used in there, but they can also marked as "never allow these keys to be copied out" - which effectively tie certain keys to specific TPM hardware permanently
this great for a select few uses, and alleviates certain physical attacks, because now only a single piece of hardware can do a thing
complete show stoppers for others
and risky for some others yet
For example, you can force an encrypted drive to only work on the computer you encrypted it on. Note that if you ever lose that TPM, you can never read that data again.
you can prevent running boot code that wasn't previously approved
as protection against malware that alters the boot
again, with footnotes. Like - who does the approving?



On secure boot

"Can't detect TPM device"

Means the BIOS knows that you can plug in a TPM module, and is looking for it (configured to do so, or always does), and doesn't find one.

So tell it not to look for one (if you can), plug one in, or ignore this message. It's often under a header named something like 'Trusted Computing'

Some BIOSes will always look for it(verify), in which case you can just ignore the message.

More acronyms

What does TPM not protect?

TPM versus TPM2

Use and criticism, strengths and weaknesses

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, or tell me)

TPM related errors

See also

Nonce

Challenge/response

ZKP

JSON Web Signature, Encryption, Tokens

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, or tell me)

GSSAPI notes

GSSAPI is a IETF standard to make it easier for various software to do various strong auth, e.g. Kerberos.

It also allows various other auth schemes to be plugged into it.


Which also makes it potentially interesting for SSO setups within an organisation.


(not unlike SASL, which can include GSSAPI)


It's used by things like OpenSSH,

publickey
gssapi-keyex
gssapi-with-mic
password


NaCl

NaCl as in libsodium

Google NaCl