Apple has refused to hand text messages over to the US government because it says it can't! They have been encrypted by default. So Apple are the good guys for a change.
This is an increasingly fraught area of technology where governments all over the world want access to text messages, emails and phone conversations so they can convict the bad guys. But we know they have no scruples and will use these powers to hassle anybody they deem to be a threat, which can sometimes include you and me.
Apple encrypts iPhone messages as a matter of course and has added encryption to it's operating system, Yosemite OSX 10.10. This is automatically ticked as On unless you untick it when installing the software or when starting up a new computer.
This means your data cannot be accessed by anyone else without your master password so don't forget that or you too will be unable to get to it...