Avlyssna GSM del 2

Detta är del 2 av av en kort guide som beskriver hur du med hjälp av USRP-hårdvara kan läsa av vissa typer av signaler i GSM-protokollet. Del 1 om GSM-avlyssning hittar du här.

Efter installation av GNU Radio paketet som återfinns under de flesta Linux-versioner samt Windows så har en frekvens för kommunikation av signaler från GSM-basstation till mobiltelefoner identifierats med hjälp av verktyget usrp_fft.py:

Här ovan kan vi se en förhöjning på 921.6Mhz, nästa steg är att spara ner lite rådata från denna frekvens med hjälp av gsmsp (se även):

$ samples=`expr 64000000 / 118 ’*’ 10`
$ python usrp_rx_cfile.py –decim=118 –freq=921.6M -N$samples gsmdump.cfile

Om allt går rätt till bör du se en en del text, exempel på lite av den information som gsmsp kan avkoda åt dig från den råa dumpfilen:

0: 49 010010– Pseudo Length: 18
1: 06 0——- Direction: From originating site
1: 06 -000—- 0 TransactionID
1: 06 —-0110 Radio Resouce Management
2: 1b 00011011 RRsystemInfo3C
3: 3b 21423    [0x2b00] Cell identity
5: 42 240      Mobile Country Code
6: f0 21f      Mobile Network Code
8: 00 3        [0x0003] Local Area Code
10: d0 1——- Spare bit (should be 0)
10: d0 -1—— MSs in the cell shall apply IMSI attach/detach procedure
10: d0 –010— Number of blocks: 2
10: d0 —–000 1 basic physical channel for CCCH, not combined with SDCCHs
11: 02 00000— spare bits (should be 0)
11: 02 —–010 4 multi frames period for paging request
12: 28 00101000 T3212 TimeOut value: 40
13: 65 0——- spare bit (should be 0)
13: 65 -1—— Power control indicator is set
13: 65 –10—- MSs shall not use uplink DTX
13: 65 —-0101 Radio Link Timeout: 24
14: 62 011—– Cell Reselect Hyst. :  6 db RXLEV
14: 62 —xxxxx Max Tx power level: 2
15: 4c 0——- No additional cells in SysInfo 7-8
15: 4c -1—— New establishm cause: supported
15: 4c –xxxxxx RXLEV Access Min permitted = -110 + 12dB
16: 79 01—— Max. of retransmiss : 2
16: 79 –1110– slots to spread TX : 32
16: 79 ——0- The cell is barred  : no
16: 79 ——-1 Cell reestabl.i.cell: not allowed
17: 00 —–0– Emergency call EC 10: allowed
17: 00 00000— Acc ctrl cl 11-15: 0 = permitted, 1 = forbidden
17: 00 ——00 Acc ctrl cl  8- 9: 0 = permitted, 1 = forbidden
17: 00 ——-0 Ordinary subscribers (8)
17: 00 ——0- Ordinary subscribers (9)
17: 00 —–0– Emergency call (10): Everyone
17: 00 —-0— Operator Specific (11)
17: 00 —0—- Security service (12)
17: 00 –0—– Public service (13)
17: 00 -0—— Emergency service (14)
17: 00 0——- Network Operator (15)
18: 00 00000000 Acc ctrl cl  0- 7: 0 = permitted, 1 = forbidden
18: 00 00000000 Ordinary subscribers (0-7)

NSA lär dig trafikanalys

Den amerikanska myndigheten NSA har nu deklassificerat ett antal dokument där två är intressanta:

I det första dokumentet hittas exempel på klassisk militär kryptoanalys, och innehåller den grundläggande information som behövs för att lösa Zendian Problemet. Den andra handlar om radio-operatörers beteenden:

Uppföljaren till MD5 är här: MD6

Det har för några år sedan uppdagats att MD5 inte är speciellt säker att använda längre så därför satte Ronald L. Rivest igång ett arbete med att ta fram nästa generations hash-funktion nämligen MD6. Med hjälp av ett team på över 15 personer så har MD6 nu lanserats under konferensen CRYPTO ’08.

Se presentationen här:

people.csail.mit.edu/rivest/Rivest-TheMD6HashFunction.ppt

Enligt följande skriver Hal Finney om MD6:

Ron Rivest presented his (along with a dozen other people’s) new hash,
MD6, yesterday at Crypto. I am not a hash guru although I’ve implemented
SHA and its ilk many times, so I can’t guarantee all my notes are correct.
I will compare it somewhat with SHA as that is what I know.

SHA-1 is a Merkle Damgard hash, meaning that it runs a compression
function that takes as input the chaining value from the previous
compression function block, along with the next block of input, and
compresses that, creating the next chaining value for the next block.

MD6 is a tree hash, so the leaf nodes run the compression function which
takes successive blocks of input and compress it down to a chaining
value. These chaining values are then fed up to a parent node, which
uses the same compression function to produce its own chaining value,
and so on up to the root node. I think the tree branching factor was 4 –
each node has 4 children. There is also an alternative serial mode for
use by memory limited devices, but I don’t recall any details on that.

A unique feature of MD6 is that the input to the compression function is
very large – 512 bytes. SHA-1 takes 64 bytes. MD6 is oriented around 64
bit words, so this input is considered to be 64 words. The MD6 chaining
variable is 1024 bits or 16 words – compare to the hash width for the
SHA family ciphers: 160 for SHA-1, 256 or 512 for SHA-256 and SHA-512.
Per NIST’s spec, the largest hash output for SHA-3 is 512 bits, so
MD6 intentionally uses a double width chaining variable internally,
and truncates it for output.

The compression function of MD6 is particularly unusual, combining
simple steps with a large number of rounds. In SHA-1 the first thing you
do is to take the 16 32-bit input words and expand them into an 80-word
key array, each word in the expanded input being a function of certain
previous words. Then you run an unbalanced Feistel using the expanded
inputs.

MD6 starts off with something similar, using a somewhat more complex
expansion algorithm, and going on far longer. To my surprise, this is
the whole compression function! The last 16 words of this process are the
output chaining value. There is no Feistel network or any other mechanism.

In more detail, the 64 (64-bit) input words are prefixed by two sets
of about a dozen words – sorry, I don’t remember exactly how big these
were. One set is a constant value, and the other set includes a variety
of ”environmental” information about the circumstances of this instance
of the compression function. This includes global information like how
wide the hash is that will finally be derived by truncating the final
chaining value; the location of this compression function block in the
hash tree, including in particular whether we are the last (root) node;
and other such data. One notable value here is an optional per-hash key,
for creating a keyed hash, of up to 8 words (512 bits). These prepended
blocks bring the full input size up to about 87 or 89 words – again I
apologize, I am working strictly from memory here.

Now this input begins to be extended. Each additional word is a function
of about 5 of the previous 89 words. They did a search to choose the
best 5 offsets in order to maximize diffusion. The combining function
is quite simple though, composed solely of xors, ands, one right shift
and one left shift. Rivest mentioned that this made it reversible –
a desirable feature as it guarantees that no entropy is lost. At first
I was unclear how doing x = x ^ (x >> 5) for example is reversible,
for example, but then I got it. The shift amounts change each step,
again optimized by a computer search for good mixing.

But the really important point here is that there are a huge number
of such steps. The function is expressed in rounds of 16 steps
each. MD6-256 uses 104 rounds; MD6-512 uses 168. Multiply times 16 and
you are performing this extend step on the order of 2000 times. Again,
the last 16 words are the output of the compression function.

Rivest gave a lot of performance information. Because of the tree
structure, the function is highly parallellizable, and scales almost
linearly with the number of CPU cores available. With 1 core, it is not
super fast: MD6-256 on a 64-bit CPU is 77 MB/sec; MD6-512 is 49 MB/sec.
For comparison, SHA-512 is 202 MB/sec on the same setup. They need about
3 cores to match the speed of SHA-512.

He also presented a number of cryptanalytic results. There is provable
security against differential cryptanalysis, by virtue of the large number
of rounds; also security against side channels. A SAT solver and another
technique could only do something with about 11 rounds, versus the 100+
rounds in the function. The tree structure is also shown to preserve
strong properties of the compression function.

Overall it seemed very impressive. The distinctive features are the tree
structure, very wide input blocks, and the enormous number of rounds.
The cryptanalysis results were favorable. However Adi Shamir stood up
and expressed concern that his new Cube attack might apply. Rivest seemed
confident that the degree of MD6 would be several thousand, which should
be safe from Shamir’s attack, but time will tell.

Apologies again to the enormous number of authors if I have any serious
errors above. And thanks to Ron Rivest for publicizing this hash design
several months before the due date (October 31), potentially giving an
advantage to his competitotrs. He emphasized that his goal is to produce
the best possible outcome for the whole process.

Hal Finney

Introduktion till kryptoanalys

Intresserad av kryptoanalys? Triop AB utför konsultuppdrag inom detta område. Läs mer här >

ScienceBlogs.com har en intressant artikel skriven av Mark C. Chu-Carroll som går igenom grundläggande kryptoanalys. Om du är intresserad av att dekryptera lättare krypton så rekommenderas denna artikel.

To understand why serious encryption algorithms are so complex, and why it’s so important to be careful with the critical secrets that make an encryption system work, it’s useful to understand something about how people break encryption systems. The study of this is called cryptanalysis, and it’s an amazingly fascinating field of applied mathematics.

Krypto från Google: Keyczar

Google har nyligen släppt ett bibliotek för att lätt hantera kryptografiska funktioner såsom nyckelhantering,

kryptering och dekryptering för Java samt Python.

Exempel på hur Keyczar används för att kryptera:

	Crypter crypter = new Crypter("/path/to/your/keys");
	String ciphertext = crypter.encrypt("Secret message");

Lätt va?

Läs mer på Google Security bloggen eller på keyczar.org

OpenID/Debian och DNS

Ben Laurie från Google samt Dr. Richard Clayton från Cambridge University har identifierat att om två nyligen upptäckta sårbarheter kombineras så är det möjligt för en attackerare att göra man-in-the-middle attacker.

Detta är dock inget lätt problem att lösa betonar forskarna eftersom CRL:er används mycket sällan i dessa fall.

Läs mer om denna sårbarhet: securityfocus.com/archive/1/495258/30/0/

Vi har tidigare skrivit om Debians slumptalsproblem:

Kryptering med iPhone

Flera företag frågar efter kryptering i iPhone men någon sådan finns ännu inte. Många företag väljer därför att inte köpa iPhone förrän Apple släppt stöd för kryptering.

Det utvecklingskit (SDK) för iPhone tillåter kryptering men dock inte för allt innehåll i telefonen.

”[Apple] had better open up the SDK for full device encryption if they want to be taken seriously as a business device,” Gold said. ”It’s not optional. I could never see a large enterprise that’s security conscious deploying this device. It’s just too risky.

Läs artikeln ”iPhone encryption is a must for the security-conscious enterprise” här.

Decentraliserat krypterat filsystem

Tahoe, Least Authority Filesystem är ett filsystem som är utvecklat av en grupp programmerare som återfinns på AllMyData.org

Filsystemet är decentraliserat och krypterat och fungerar då således även om en nod försvinner, så här beskriver de själva Tahoe:

Tahoe är ett säkert, decentraliserat och feltolerant filsystem. Hela källkoden finns tillgänglig under en fri licens, Open Source-licens. Detta filsystem är krypterat och kan spridas över flera noder på ett sådant sätt att det förblir tillgängligt även när någon av noderna inte är tillgänglig, har en funktionsstörning eller blivit utsatt för datorintrång. Det är en sida sammanfattning förklarar de unika egenskaperna hos detta filsystem.

Föredrag om Debians OpenSSL-problem

Säkerhetsforskarna Jacob Appelbaum, Dino Dai Zovi samt Karsten Nohl höll nyligen ett föredrag på konferensen HOPE som gick av stapeln i New York. Deras föredrag handlade om OpenSSL-buggen som upptäcktes i Linux-distributionen Debian för några månader sedan.

Exempelvis: Genom att betala 49KR för att hyra 20 st virtuella servrar hos Amazon Simple Scalable Storage (S3) samt Elastic Compute Cloud (EC2) så är det möjligt att dekryptera SSL-trafik där någon av de 524,288 felaktiga nycklarna använts.

Se deras föredrag här: trailofbits.files.wordpress.com/2008/07/hope-08-openssl.pdf

John the Ripper

En ny version av den omåttligt populära programmvaran John the Ripper av Solar Designer har nu kommit i version 1.7.3.1 och räknas som ”development version”.

Fokus på denna release har varit att förbättra x86-64 stödet. Det går nu att testa två blowfish hashar samtidigt:

Most notably, two Blowfish-based crypt(3) hashes may now be computed in
parallel for much better performance on x86-64 CPUs (on Intel Core 2 and
AMD CPUs tested, the speedup was 50% to 65%)

Läs mer på JtR:s hemsida: http://www.openwall.com/john/