Skyscraper

Mostrando entradas con la etiqueta windows. Mostrar todas las entradas
Mostrando entradas con la etiqueta windows. Mostrar todas las entradas

miércoles, 6 de noviembre de 2013

Listing & Managing Keys (Using GPG To Encrypt And Sign Your Data Part II)

After the creation of the private and public keys, GPG allows the listing of both public and private rings
using "gpg --list-keys" and "gpg --list-secret-keys" as shown in the next image:



Sometimes the need to exchange keys appears,  GPG has it's tools for exporting and importing keys.

To export a key from the public ring to a plain text file use the option --output, the option --armor creates
a readable ASCII output, "god@spam.com" is the user id associated to the key.


To export a key from the private ring to a plain text file use the option --output, the option --armor creates
a readable ASCII output, "god@spam.com" is the userid associated to the key.


To import keys to the public or private rings just use "gpg --import" the program will add it to the correct ring by the header of the key.

Key imported to the public ring withe the user id jesus@spam.com (It was generated with GPG For Windows) as shown in the next image:


Key imported to the private ring withe the user id jesus@spam.com (It was generated with GPG For Windows) as shown in the next image:


The next entry shows how to encrypt and decrypt with GPG: http://davidalexandermejia.blogspot.com/2014/04/encrypt-decrypt-using-gpg-to-encrypt.html

viernes, 31 de mayo de 2013

Generating Keys (Using GPG To Encrypt And Sign Your Data Part I)

GPG is a GNU solution that can be used when we need to implement the PKI (Public Key Infrastructure) without the costs of something like PGP.

GPG is a multiplatform solution that can be used with Windows (Command Line) or Linux, this example is under a Linux platform.

There is an option --gen-key that can generate four kind of keys, for our purpose (1) RSA and RSA or (2) DSA and Elgamal are useful. In the next image (1) RSA and RSA was chosen.


The program asks for the key length (between 1024 and 4096 bits) and the expiration time, a year or two is a common caducity time.

In the example the keys have 2048 bits and 2 years of time before the key expires.


The program asks for a name, email address to identify the owner of the key and an optional comment.  In the example the userid and the email address are the same (god@spam.com) after that the program shows the options to change the name (N), commen (C) or email (E) or Okay (O) for commit the changes or (Q) for quit the program.


After choosing the (O)kay the program asks for a passphrase to protect the private key, depending of the length of the key the program will need some  time to generate the random numbers.


The keys and their signatures are created after the program find the randon numbers, finally it saves the keys in the private and the public rings of the gpg program.

The next entry shows how to list and manage the keys: http://davidalexandermejia.blogspot.com/2013/11/showing-managing-keys-using-gpg-to.html

lunes, 26 de septiembre de 2011

Recovering a CentOS Grub After a Windows Installation

As you well know, the ways that windows uses always rewrite the MBR of the hard drive, I believe that Microsoft do this deliberately. Yesterday I installed a Windows XP in my laptop to do some compatibility test, but after two or three boots I discovered that my Grub is gone.  So I cannot boot CentOS, but not all is lost.

Below I will describe the steps to reinstall the Grub loader in the MBR:

First, boot with the CentOS DVD to access the rescue mode typing "linux rescue" in the command line.


Linux will boot in rescue mode and ask about the read only mode or continue with the rescue mode making changes in the filesystems.  Here is mandatory to select "Continue"


Now, we have a linux command line and the original system mounted under /mnt/sysimage, we need to change the root system with the chroot command to edit and reinstall grub.  In the image I use fdisk, chroot and ls.  The file grub.conf contains all grub texts and target filesystems.


With a simple vi, I added the entry for Windows XP.  In my case Windows resides in /dev/hda1 or (hd0,0)


Save the changes and execute /sbin/grub-install hd0 to install grub in the MBR of the hard disk.


Finally exit the command line or just reboot the system.  After the next boot grub appear (with the changes) as in the next image:



I think the solution also applies to Windows Vista, Windows 7 and I wish that Windows 8 respect the MBR and leave Grub in peace.