Category Archives: Crypto

Come crearsi il proprio Cloud cifrato con Tomb e SSHFS

Questo HowTo va letto con la consapevolezza che il concetto di cloud (avere i propri file sparsi per la rete) va nella direzione opposta alla sicurezza. Nonostante questo HowTo renda i tentativi di “farsi gli affari nostri” molto difficili, evitare di spargere in giro i nostri dati è sicuramente la soluzione migliore.

Da un po di tempo ero alla ricerca di una soluzione che mi permettesse di avere a disposizione alcuni dei miei file tra diversi PC senza però dovermi affidare all’uso di servizi commmerciali come DropBox o UbuntuONE.

Innanzitutto per una limitazione tecnica di queste soluzioni:
entrambi i servizi si basano sulla sincronizzazione di una cartella locale del PC su un server remoto (senza gestione dei delta) e questo se si parla di un file “contenitore” cifrato si traduce in una sua completa ri-sincronizzazione ad ogni seppur minima modifica degli elementi contenuti al suo interno (potete immaginare quanto sia scomoda una soluzione del genere se il file “contenitore” cifrato è grande qualche GigaByte).
Di conseguenza utilizzare in maniera sicura questi servizi diventa molto scomdo e non resta quindi che scartare l’ipotesi di una cifratura controllata da noi ed affidarsi all’onestà dei gestori.
Come si dice: fidarsi è bene ma non fidarsi è molto meglio, soprattutto se ad essere in ballo sono i nostri dati personali, la nostra privacy o la nostra sicurezza.

A supporto di una soluzione cloud sicura “fatta in casa” (di cui abbiamo il completo controllo) possiamo utilizzare programmi completamente open-sources e free.
Oltre ad un server remoto da utilizzare come storage dei nostri dati, avremmo quindi bisogno di:

  1. Tomb
  2. openssh
  3. sshfs

Tomb permette di creare dei file contenitori cifrati con AES-256, inoltre contiene interessanti feature per la gestione della chiave segreta come:

  • la possibilità di salvarla in una pendrive usb,
  • la possibilità di proteggerla attraverso la tecnica della steganografia all’interno di un’immagine]

A queto punto, dopo aver installato sul nostro PC tomb e sshfs, passiamo alla creazione della tomba sul nostro PC.
NB: anche se “scomodo” (soprattuto per file di grandi dimensioni) è importate creare la tomba sul nostro PC e successivamente spostarla sul server (soprattutto se il server che pensiamo di utilizzare è condiviso e non ha la partizione swap cifrata).

Il comando per la creazione della tomba è il seguente:

$ tomb-open
Invalid number of options.
[*] Tomb – simple commandline tool for encrypted storage
. version 1.2 (Nov/2011) by Jaromil @ dyne.org

[*] Guided creation of a new Tomb

A Tomb is a special folder that keeps files safe using a password:
it makes use of strong encryption and helps you keep the keys on a
separate USB storage for safer transports.

Inside a Tomb you can store private informations without fear that
other people possessing it will discover your secrets, unless they
have your USB key and your password.

If you choose to proceed now, we’ll guide you through the creation
of a new Tomb.

If you will, I’ll be your Crypto Undertaker.

Do you want to proceed, Master? (y/n) y

[*] Please type in the name for your new tomb file:
> test

[*] How big you want the Tomb to be?
. Type a size number in Megabytes:
> 500

A questo punto inserire la propria password e successivamente scegliere la passphrase della tomba.
Terminata la creazione della tomba, la carichiamo sul server utilizzando scp in questo modo:

scp -P PORT /home/user/test.tomb user@IP.IP.IP.IP:/home/user/cloud

Al termine dell’operazione, montiamo la cartella remota attraverso sshfs in questo modo:

sshfs -o allow_root user@IP.IP.IP.IP:/home/user/cloud /home/user/cloud

Se non dovesse funzionare controllare che all’interno del file di confurazione /etc/fuse.conf sia decommentata la seguente entry:

# Allow non-root users to specify the ‘allow_other’ or ‘allow_root’
# mount options.
#
user_allow_other

L’utilizzo di sshfs ci garantisce il transito dei dati tra il nostro server e noi avvenga in maniera cifrata.

A questo punto apriamo la tomba in questo modo:

$ tomb –ignore-swap open /home/user/cloud/test.tomb -k /home/user/test.tomb.key

La tomba si monta automaticamente dentro /mount/test.tomb/.
Tenete presente che la tomba inizia a sincronizzare gli elementi al suo interno al momento della chiusura, ovvero quando si lancia il seguente comando:

$ tomb close

Considerate che l’esecuzione del comando non sarà immediata e dipenderà dalla dimensione dei file caricati e dalla velocità in upload della vostra connessione. Mettetevi comodi ed aspettate.

Twitter It!

TorChat: messenger application

Giusto per segnalare l’esistenza di questo progetto, anche se non ho ancora avuto modo di provarlo e testarlo.

TorChat è una chat msn-like basata su TOR, che garantisce la cifratura (il traffico tor viaggia cifrato end-to-end) e l’autenticazione della conversazione,  oltre che l’anonimato della propra posizione.

TorChat is a peer to peer instant messenger with a completely decentralized design, built on top of Tor’s location hidden services, giving you extremely strong anonymity while being very easy to use without the need to install or configure anything.

TorChat just runs from an USB drive on any Windows PC. (It can run on Linux and Mac too, in fact it was developed on Linux with cross platform usability in mind from the very first moment on, but the installation on other platforms than Windows is a bit more complicated at the moment)

Riporto qualche stralcio dal sito ufficiale del progetto:

Encryption

All TorChat traffic is encrypted end-to-end.

There are some misunderstandings floating around regarding Tor and encryption. Whenever I mention Tor and encryption in the same sentence the immediate reflex response of many people is: “But Tor provides no encryption!” This statement is true for most applications but not for all. The most commonly known usage of Tor is to use it as an anonymizer for traffic between the anonymous user and a publicly available service in the Internet and while the traffic will travel encrypted through the Tor network it MUST at some point leave the Tor network and enter the unencrypted internet to reach its final destination. This is the origin of the above mentioned “Tor provides no encryption” and it is undoubtedly true for this most widely known and practiced application of Tor and users should understand it.

However, there exists another and less commonly known mode of operation in which two Tor clients can initiate a fully encrypted peer-to-peer connection between each other that will not leave the Tor network at any point! This is what TorChat is using. Both clients build a normal 3 node circuit from each end to some random tor node in the middle to “meet” there and connect their circuits with each other. Upon connection another layer of encryption is established reaching through from one client to the other, building one uninterrupted encrypted tunnel through all 6 nodes between the two end points. This means all TorChat traffic is end2end encrypted. There are no exit nodes involved in this mode, at no point other than your and your buddies own computer will the traffic ever leave the Tor network.

This less known Tor mode is called Tor hidden services, you can read more about it on the above link. It effectively allows true hidden peer-to-peer networks, there are just not many softwares that make any use of its peer-to-peer capability, most use it more in a traditional client-server manner, TorChat is one of the few (and at the moment I don’t know of any other).

Authentication

TorChat buddies authenticate themselves by proving that they are reachable though their .onion address.

The Tor hidden service protocol by itself has no built-in authentication mechanism for incoming connections but it can guarantee that when you initiate an outgoing connection to a given .onion address you can never end up at the wrong counterpart, the one who answers the connection is the one who is in possession of the private key belonging to this address (the private_key file in the hidden_service folder).

Therefore TorChat will not trust any incoming connection and instead immediately try to open an outgoing connection to call back any incoming buddy on the address he pretends to be. A random cookie will then be sent out by both clients on their (trusted) outgoing connection that must be correctly answered on the incoming connection. Only after the answer is found to be correct the incoming connection can be trusted, the status of the buddy will be displayed as on-line and incoming messages from this buddy will be accepted.

It is essential that you don’t lose the private_key file belonging to your ID because the one who finds it will be able to pretend to be you. Using a tool like TrueCrypt is a good idea when you intend to use TorChat on a portable USB drive as these devices can easily be lost or stolen.

Twitter It!

Kriptonite – Ristampa dal basso

Kriptonite è uno di quei libri che non sono mai riuscito a tenere per mano. Forse già non si trovavano copie in vendita quando ho scoperto la sua esistenza.

Per chi come me ha letto la versione in PDF, ma continua comunque a preferire le versioni cartacee dei libri, c’è un’opportunità oggi grazie a Produzioni dal Basso.

E’ possibile finanziare “dal basso” la ristampa di questo libro prenotandone una copia:

Twitter It!

[Video] Schegge di Kriptonite

Dopo aver presentato il seminario qui, embeddo anche il video, cosicché tutti e tutte possiate ascoltare il Verbo :P

Chi fosse interessato agli altri video prodotti durante l’hackmeeting può trovarne alcuni nella pagina dedicata del progetto arkiwi.org

Twitter It!

Schegge di Kriptonite

Inizia oggi hackmeeting e si avvicina il seminario più atteso (almeno da me): Schegge di Kriptonite

Questo il testo di presentazione del seminario sul sito di hackmeeting:

1998 – annus mirabilis. Nel mese di maggio appare brevemente sugli scaffali delle librerie il libro “Kriptonite – fuga dal controllo globale” (http://isole.ecn.org/kriptonite/).

In giugno proprio a Firenze un “kill -HUP hackit98”, cioe’ la fine del primo hackmeeting, chiude una festa ed apre un’epoca. C’e chi dalla somma e dalla sinergia di questi due eventi e’ rimasto folgorato, c’e chi ha lottato per anni, chi ci prova ancora adesso. Ma non ha funzionato, e non ha funzionato in molti modi diversi e per molte diverse ragioni. Questo e’ un tentativo di mettere insieme il passato per trarne innanzitutto una lezione su cosa abbiamo sbagliato. Se ci riusciremo, protremmo anche trovare una possibilita’ per ritentare.

E questo il link all’articolo di Calamari pubblicato oggi su Punto Informatico: Kriptonite d’oro (Prologo: Joe&Jim)

Twitter It!

TOR – Website History Movie

A visual history of Tor’s website through code commits

Twitter It!

RSA finally comes clean: SecurID is compromised

Articolo originale pubblicato da Peter Bright su arstechnica.com

RSA Security is to replace virtually every one of the 40 million SecurID tokens currently in use as a result of the hacking attack the company disclosed back in March. The EMC subsidiary issued a letter to customers acknowledging that SecurID failed to protect defense contractor Lockheed Martin, which last month reported a hack attempt.

SecurID tokens are used in two-factor authentication systems. Each user account is linked to a token, and each token generates a pseudo-random number that changes periodically, typically every 30 or 60 seconds. To log in, the user enters a username, password, and the number shown on their token. The authentication server knows what number a particular token should be showing, and so uses this number to prove that the user is in possession of their token.

The exact sequence of numbers that a token generates is determined by a secret RSA-developed algorthm, and a seed value used to initialize the token. Each token has a different seed, and it’s this seed that is linked to each user account. If the algorithm and seed are disclosed, the token itself becomes worthless; the numbers can be calculated in just the same way that the authentication server calculates them.

This admission puts paid to RSA’s initial claims that the hack would not allow any “direct attack” on SecurID tokens; wholesale replacement of the tokens can only mean that the tokens currently in the wild do not offer the security that they are supposed to. Sources close to RSA tell Ars that the March breach did indeed result in seeds being compromised. The algorithm is already public knowledge. read more »

Twitter It!