Monday, January 27, 2014

Generate 8192 bytes RSA key - Arch Linux

GNU Privacy Guard (GnuPG or GPG) is a GPL Licensed alternative to the PGP suite of cryptographic software. GnuPG is compliant with RFC 4880, which is the current IETF standards track specification of OpenPGP. Current versions of PGP (and Veridis' Filecrypt) are interoperable with GnuPG and other OpenPGP-compliant systems. 

Well since lately i've been digging information about encrypting i decided to start and make my own 8192 bytes RSA key.

I'm using arch linux

First of all:

Make a directory with

$mkdir gnu

change to the new directory

$cd gnu

download those 3 files and save them on plain text with no extension with the same name that site gives them, place them on folder gnu

https://projects.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/gnupg

download the gnupg 2.0.22.tar.bz2

$wget ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-2.0.22.tar.bz2
we have to decompress the .tar.bz2

$tar -jxvf gnupg-2.0.22.tar.bz2

now go on newly decompressed folder and find folder named g10
now look for file named keygen.c and change all 4096 for 8192, save the file and go back to gnu
erase your old gnupg-2.0.22.tar.bz2 and now tar the folder with modified source with

$tar -jcvf gnupg-2.0.22.tar.bz2 gnupg-2.0.22

after that we are gonna compile the new sources

$makepkg --skipchecksums --skipinteg --skippgpcheck

let it compile and install as usual with

#pacman -U gnupg-2.0.22.tar.xz

and now just generate your new key with

$gpg --gen-key

Screenshot

If you have problem generating entropy for your key generation use this command on 3-4 terminals:

$ls -R /

Also remember you can use haveged:

https://wiki.archlinux.org/index.php/Haveged

Note: in theory this works for any size of bytes, i'll try with 16834 bytes later on.

Sources that were useful on my process:

http://www.jroller.com/robertburrelldonkin/entry/gnupg_8192bit_rsa_keys

http://www.simplehelp.net/2008/12/15/how-to-create-and-extract-zip-tar-targz-and-tarbz2-files-in-linux/

https://wiki.archlinux.org/index.php/GnuPG

https://projects.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/gnupg


No comments:

Post a Comment