Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Top Posters

Who's Online (0)

Powered by Vanilla. Made with Bootstrap.
Securing your data
  • [Intro]
    Well we all need to secure our 'secret' data. Whether it be that new exploit you've been working on or that 'special' picture of that ex girlfriend you don't want anybody to see. Well what do you do? You can hide the file, but that isn't always effective. It's pretty easy to find a hidden folder/file. So what else can you do? Well in this guide I'll be going through the steps on how to encrypt your secret files with a handy program called GPG. I'll be using a *nix box for this guide(NOTE: I'm quite sure windows has a port of gpg called gpg4win or something of that nature. Google it, or you can download the actual gpg program for windows). http://www.gnupg.org/download/

    [Getting started]
    Well its time to get it started. First, open up your terminal and type the following command:
    sudo aptitude install gpgsm gpgv

    This will install the GPG signature verification and S/MIME versions. Now that you've got that installed, lets continue.

    [Creating a key]
    The next step in encrypting your secret data is to create a key. I'll run you through the process step by step now.
    First, type this in your terminal:
    gpg --gen-key

    This will bring you to a screen where you will select your encryption type. Select 1 as the default(Or change it to whatever you want). Now to choose your RSA key size. Just type 2048 for the default or change the key size to whatever your preference is. Now you can make the key expire after a certain time, but we'll just hit 0 so it never expires. Now just verify by hitting [y] then enter. Now you need to input some info. You can put fake name/email or you can enter some real info. First, type your 'Real' name. Then it will ask for your E-Mail. Just input that. Then it will ask for a comment. This comment can be anything about this specific key but we'll just type "Encryption" for the comment. Now it will echo back your information to see if you're correct. Just hit [O] and continue. Now it will ask for your desired keyphrase. We will need to type the keyphrase to decrypt the file each time. So make it any password you're familiar with. After that, your key should start being created. The OS will need some random bytes to make the key stronger, so just move the mouse, do random things, or continue with what your doing. After 248 or so bytes later, your key will be created :)

    [Public key]
    This step is optional, but good for making your key public(NOTE: Just the key is public, this doesn't mean anybody can get into your files, they still need the passphrase. Just use the following command:
    gpg --armor --output pubkey.txt --export 'Your Name'

    pubkey.txt can be any text document you want. This holds your public key.

    [Encrypting your data]
    Now you've got your key ready. Great. But now what? Well shut up and listen pl0x. Lets say I have a sensitive document called "Bank_Records.docx" that I want to encrypt. Easy. Lets type the following command:
    gpg -e -r Name Bank_Records.docx

    Now -e stands for encrypt. -r stands for recipient. Just change "Name" with the name you used for the keyring(It can just be the first name). You'll get the output file "Bank_Records.docx.gpg". This is your encrypted file :D Do what you want with it.(Kevin Mitnick and other great hackers used to encrypt their files and send them to an offshore FTP server for extra security. If you're doing something really illegal, I suggest you do the same)

    [Decrypting]
    Now what happens if we want to decrypt our secret file? Simple. Just use the following command:
    gpg --output Bank_Records.docx --decrypt Bank_Recods.docx.gpg

    Now your file is decrypted :D

    [Extra]
    What if you want to send your encrypted file to a friend, for them to decrypt with your passphrase. Well they'll need your key of course. That's the purpose of exporting your PGP key into a text file. You can send your friend an encrypted file, along with the key to decrypt the file with your passphrase. Simple as that. That's why I love GPG. It's simple and effective. Great for encrypting your secret files ;)


    --Chroniccommand
  • Xin
    Posts: 3,251
    Nice tutorial :), i think is probably easier using Truecrypt to secure an entire portion of your harddrive, its a shame that truecrypt has been finally cracked :( hopefully it will be patched.
    Xin
  • said:


    Nice tutorial :), i think is probably easier using Truecrypt to secure an entire portion of your harddrive, its a shame that truecrypt has been finally cracked :( hopefully it will be patched.



    Truecrypt can actually be cracked by the govt pretty easy. It's pretty good but I prefer gpg.
  • Great Tutorial Bro Thanks :)
  • Xin
    Posts: 3,251
    said:


    said:


    Nice tutorial :), i think is probably easier using Truecrypt to secure an entire portion of your harddrive, its a shame that truecrypt has been finally cracked :( hopefully it will be patched.



    Truecrypt can actually be cracked by the govt pretty easy. It's pretty good but I prefer gpg.


    There was a news article a month back where the FEDs couldnt crack it so they pressed charges on anyone using it as they didnt like it, but a private company found an exploit while the PC is in sleep mode a .dll can be cracked for truecrypt
    Xin