I'm using Truecrypt for full-disk encryption of my computer's drives. Is it safe to Sleep or Lock my computer, or would that allow someone to bypass the disk encryption and access the data on the drives as if they weren't encrypted?
Full disk encryption, by necessity, needs the key in RAM to encrypt/decrypt data in real time.
Firewire has a DMA like mode that basically allows one to scan the entire RAM of the system. Full disk keys may be recovered from a target system's RAM if it's connected via Firewire to a host running the right software and the target system has a Firewire driver that supports this. Your system is vulnerable to this if it is locked. I'm not sure if it's possible to Firewire-read your RAM while it is asleep.
If your system is hibernating, all RAM is dumped to a hibernation file before power off. I believe Truecrypt marks pages of its driver somehow to prevent this, but as long as you keep the hibernation file on an encrypted volume you should be safe.
DRAM takes a while to decay after power off. Theoretically it's possible for an adversary to remove the RAM from your system,. possibly spray it with canned air to lower the temperature and lengthen the decay rate, and put it in a system or tool that scans the RAM and extracts the keys from there. It also may be possible to power cycle your system, boot off of a live CD, and recover they keys from RAM that way.
If the RAM is powered off and has decayed sufficiently, it's not possible to get keys from it, and your encrypted data is safe in this situation.
Of course the first and third items are tinfoil-hat level stuff, but to prevent against it you should power your system down completely when you are not using it, and run Memtest86+ or your system diagnostics to clear RAM. At least one security-focused Linux distribution does this before power off, I can't think of the name of it.
Full disk encryption does protect you against someone taking the hard drive out of the system and trying to read it in another system while it is asleep if they don't extract keys from RAM directly, which is an advanced operation.
I posted an answer to a similar question here:
While the contents of the disk are encrypted, the operating system is decrypting the content of the disk on the fly in order to access it. The screen lock does little to protect the contents of the disk while the computer is running.
All the screen lock does is prevent someone from running programs / reading your screen while you're away. As long as the computer is running and the encrypted disk mounted, your data is vulnerable. Granted most thieves would just shut the machine off / reboot it once they had it.
However, if you're paranoid about your data, the inconvenience of powering down/powering up every time you walk away for a while is a small price to pay IMHO.
The fact that most current full disk encryption methods use RAM to store the keys makes them only partly secure while the system is running. DMA access via Firewire or PCI bus is a possibility while the system is running and not quite as tinfoil hat as some might suggest. There was a great talk at Defcon 21 regarding the problem and the work being done to try and mitigate it (the slides for the presentation will probably show up on the archives soon, though).
No. as others pointed out, an adversary with physical access to the machine can do almost anything with data in ram.
When you hibernate a computer, it caches active ram out to your hard disk. since the key is in active ram, you are placing your key in a file on your hdd, that effectively never goes away. There are tools designed to break into Truecrypt volumes, which scrape ram for your key, and if your volume is not mounted, it will fall back to checking your hiberfil.sys on windows to see if it was cached to disk during the last hibernation.
FDE is a problem because your key will always be present in ram, and for that same reason, it will always get copied to hiberfill.sys on suspend/hibernate.
see this thread for examples of practical attacks and a fuller explaination: Cracking truecrypt files in minutes? Or just truecrypt harddrives in minutes?