Where do operating systems (e.g. Windows) save their passwords? Do they store them in plain text? Do they use hardware modules such as TPM? Are these methods generally considered secure?
Windows stores its passwords in what is called the Security Accounts Manager database, or SAM database. This is a file that exists in the registry and access to it is tightly controlled whilst windows is running; however, local administrators who can run processes as
As for the hashes used, they are either the LM or NTLM hash. Various attempts have been made to break NTLM; however, LM is known to be broken, so Vista does not use it by default although earlier versions of Windows do. Microsoft also apparently encrypt the database to make it harder to analyse offline.
The key to password security on operating systems is reducing their chance of intercept, so it is also worth studying who and what can access this. In terms of Windows, LSASS, or Local Security Authority Subsystem Service is responsible for verifying and creating user credentials. Thus, any attempt to hook or replace LSASS is an attempt to grab password input.
In terms of the Login screen it used to be possible to redesign it using GINA DLLS - many people did this to support fingerprint authentication, for example. However, custom GINAs are amongst many things quite hard to write and pose a possible security risk, so Microsoft rebuild that in Vista: see the credential provider framework which removes the custom code 1 level away from the GUI objects, which is much safer (Vista did contain improvements, for all people's criticism).
Now, Linux. It's probably better to start with the architecture of Linux authentication - most modern linux distributions use pluggable authentication modules which can be configured for various databases, remote, local etc. These can be configured to be optional, or mandatory, or "one of many options" if you like. The default pam module validates users whose meta data exists in
So as you can see, what you can use for your hashing algorithm on Linux is entirely optional. The security of the
Both operating systems essentially hash passwords using a variety of techniques (crypt() in default DES mode I think was one of the first to repeatedly apply a hash to make checking hashes slower) - this is critical, as encrypted passwords could be trivially reversed by finding the encryption key. Clearly, in both cases, the security of the entry of the passwords depends on your ability to penetrate highly privileged areas; thereafter, the passwords are hashed and must be cracked using hash reverse techniques such as rainbow tables, which the hash design is built to counter.