Download Emmett Dulaney - All IT eBooks

Transcript
414
Encrypting and Signing Files with GnuPG
/bin/ping6
/bin/umount
/opt/kde3/bin/fileshareset
/opt/kde3/bin/artswrapper
/opt/kde3/bin/kcheckpass
. . . lines deleted . . .
Many of the programs have the setuid permission because they need it,
but check the complete list and make sure that there are no strange setuid
programs (for example, setuid programs in a user’s home directory).
For example, if you type ls -l /bin/su, you see the following permission
settings:
-rwsr-xr-x 1 root root 25756 Aug 19 17:06 /bin/su
The s in the owner’s permission setting (-rws) tells you that the setuid
permission is set for the /bin/su file, which is the executable file for the su
command that you can use to become root or another user.
Encrypting and Signing Files with GnuPG
Linux comes with the GNU Privacy Guard (GnuPG, or simply GPG) encryption
and authentication utility. With GPG, you can create your public and private
key pair, encrypt files using your key, and also digitally sign a message to
authenticate that it’s really from you. If you send a digitally signed message
to someone who has your public key, the recipient can verify that it was you
who signed the message.
Understanding public key encryption
The basic idea behind public key encryption is to use a pair of keys —
one private and the other public — that are related but can’t be used to
guess one from the other. Anything encrypted with the private key can
be decrypted only with the corresponding public key, and vice versa. The
public key is for distribution to other people while you keep the private key
in a safe place.
You can use public key encryption to communicate securely with others;
Figure 2-1 illustrates the basic idea. Suppose Alice wants to send secure
messages to Bob. Each of them generates public key and private key pairs,
after which they exchange their public keys. Then, when Alice wants to send
a message to Bob, she simply encrypts the message using Bob’s public key
and sends the encrypted message to him. Now the message is secure from
eavesdropping because only Bob’s private key can decrypt the message —
and only Bob has that key. When Bob receives the message, he uses his private key to decrypt the message and read it.