Maxime Chambreuil

Monday July 2, 2007

How do I use GPG ?

Max @ 22:17 | Filed under: Documentation, Security

Here are the basics command after installing gnupg :Generate his public and private key :

$ gpg --gen-key

Publish his public key :

$ gpg --keyserver wwwkeys.pgp.net –send-key [your email]

Retrieve public keys :

$ gpg --keyserver wwwkeys.pgp.net –search-keys [email]
$ gpg –keyserver wwwkeys.pgp.net –recv-keys [hexadecimal code of the key]
$ gpg –sign-key [email]

List all your keys :

$ gpg --list-keys

Update/Modify key :

$ gpg --edit-key [email]

Delete key :

$ gpg --delete-secret-keys [email]
$ gpg –delete-key [email]

Store his public key in a file :

$ gpg --export --armor [email] > publickey.asc

Verify a signature :

$ gpg --verify signature.asc

How can I protect a part of a website ?

Max @ 22:14 | Filed under: Documentation, Security

You have to create an .htaccess file in the directory you want to protect. Here is an example of the syntax :

AuthUserFile /home/*/*/protected/.htpasswd
AuthGroupFile /dev/null
AuthName ByPassword
AuthType Basic
<Limit GET POST>
require valid-user
</Limit>

Then you just have to use the htpasswd command of the Apache Web Server to create a base of users and encrypted passwords :

# htpasswd -c .htpasswd user

Powered by WordPress