Warning: Missing argument 2 for wpdb::prepare(), called in /home/stromber/public_html/kryptoblog/wp-content/plugins/wp-super-edit/wp-super-edit.core.class.php on line 109 and defined in /home/stromber/public_html/kryptoblog/wp-includes/wp-db.php on line 1222
Krypto » Kryptoblog

Posts Tagged ‘Krypto’

Tekniken bakom Microsofts BitLocker

December 31st, 2008

För ett några månader sedan postade jag om NISTs föreslagna kryptomod XTS. I en kommentar till den postningen satte Blackadder mig på spåret (stort tack!) på Micrsofts diskkryptering BitLocker och dess diffusor Elephant.

Kryptering av ett block med BitLocker.
Bitlockers olika delar med en blocknyckelgenerator, diffosorer och CBC-AES.

Jag har tid efter annan postat om olika artiklar och ibland ondgjort mig över hur dåliga en de artiklar är. Ett sådan exempel var artikeln om fysiskt unika funktioner som ett sätt att skydda FPGA-konstruktioner.

Därför är det kul att kunna peka på en i mitt tycke riktigt bra artikel nämligen Niels Fergusons artikel den tekniska beskrivningen av kryptosystemet i BitLocker.

Det finns flera anledningar till att Fergusons artikel är så bra. Bland annat är den tydlig i sin beskrivning av den hotbild som BitLocker är tänkt att skydda emot och användningsfallen för BitLocker. Utifrån detta följer en ordentlig genomgång av olika befintliga lösningar och varför de på olika sätt inte fungerade utifrån kravbilden. Slutligen en beskrivning av resultatet och vilka avvägningar som gjorts. Dessutom är artikeln ovanligt välskriven och lättläst.

Som läsare blir det enkelt att följa med och artikeln visar även hur säkerhetsmekanismen i ett system som BitLocker designats så att information om hur det är konstruerat (och varför) inte kortsluter säkerheten, utan istället öppnar upp för analys och förtroende för mekanismen. Att Microsoft valt att gå den här vägen är mycket positivt.

Det finns även en läsvärd artikel om BitLocker pÃ¥ gamla hederliga programmeringstidningen Dr Dobb’s webbsida.

Jag hade naturligtvis tänkt att posta om Elephant och BitLocker redan i September, men hösten har varit mer än lovligt upptagen. Förhoppningsvis blir det mer tid för kryptostudier och postningar pÃ¥ Kryptoblog. Vi ses pÃ¥ andra sidan nyÃ¥r – Gott nytt Ã¥r!

Lite SHA-3-status

December 31st, 2008

Aktiviteterna med SHA-3 rullar på även under jul och nyår.

Randall Farmer har publicerat en ny version av Skein som använder SSE2-instruktioner i 32-bitmod för att accelerera algoritmen. Den nya koden når 23 cykler/byte. Jag testade lite snabbt att kompilera och köra koden på min Macbook.

Koden kompilerade utan några som helst problem och med O3optimering fick jag följande timingresultat (2 GHz Intel Core 2 Duo med 4 MByte cache och 2 GByte RAM kompilerad med i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5488)):

#/usr/bin/time ./skein
75.32 real 74.89 user 0.17 sys

Jean-Philippe Aumasson har publicerat en ny, hårdbantad version av BLAKE-32. Den nya koden är på ca 200 rader, ca 6 kByte källkod inkl kommentarer. Denna kod är dock ej avsedd för att nå hög prestanda.

Vad gäller analysstatus har följade kandidater så här långt fallit:


Boole
DCH
EnRUPT
HASH 2X
MCSSHA-3
NKS2D
Ponic
Sgàil
Spectral Hash
Vortex
WaMM
Waterfall

Notera att NIST än så länge inte eliminerat dessa från kandidatlistan, utan det är på maillistan sha-forum och webbsidor som Skeins Engineering Comparison och ECRYPTs SHA-3 Zoo denna information kommer ifrån.

I vissa fall har skaparen av hashfunktionen (Waterfall och WaMM) officiellt dragit tillbaka sin kandidat, men i andra fall (EnRUPT) pågår diskussioner om att försöka hitta modifieringar för att reparera kandidaterna mot upptäckta problem.

Implementation av Keccak i FPGA-teknologi

December 17th, 2008

Jag har precis lagt upp en artikel kallad Implementation of the Keccak Hash Function in FPGA Devices på sidan med artiklar och dokument.

Artikeln beskriver en del försök jag gjort med att implementera en av SHA-3-kandidaterna, Keccak i olika FPGA-kretsar. Som utgångspunkt har jag använt de referensimplementationer i VHDL som skaparna av Keccak har tagit fram.

Att döma av resultatet verkar Keccak vara en hashfunktion som lämpar sig väl att implementera i FPGA:er. Jag gillar att den går att skala så mycket som den gör. Den minimala low_area_copro-implementationen är verkligen mycket liten ocg ger trots det bra prestanda.

Jag hade dock en del strul med referensimplementationerna vilket till största delen beror på hur VHDL-koden är skriven. Om Keccak skulle bli vald till SHA-3 kommer det att behövas en hel del uppstädning för att få koden till att bli en riktigt bra referensimplementation.

Notera att jag inte i det här läget tar ställning till säkerheten hos Keccak, utan detta är enbart ett försök att utvärdera hur effektivt det går att implementera Keccak i FPGA:er.

Jag tar mycket gärna emot kommentarer och tips.

Faran med minnesbaserade hårddiskar

December 15th, 2008

För ett tag sedan bloggade jag om en IDG-artikel som tog upp säkehetsproblemet med minnesbaserade hårddiskar. Då handlade det om huruvida det är svårare eller enklare att komma åt information som är lagrad på hårddisken.

I går kom det ett par inlägg på Cryptography-listan som satte fingret på ett helt annat, och mycket intressant problem: Att hårddiskar används som entropikälla för att driva slumptalsgeneratorer (PRNG) i operativsystem.

James A Donald skrev i ett inlägg om entropikällor för slumptalsgeneratorer:


If one uses a higher resolution counter – sub microsecond – and times multiple disk accesses, one gets true physical randomness, since disk access times are effected by turbulence, which is physically true
random.

Ett inlägg Damien Miller svarade på med:


Until someone runs your software on a SSD instead of a HDD. Oops.

Japp, Oops är helt rätt. Hur många OS använder hårddiskens accesstider som entropikälla, och hur många tänker på att entropikällornas beteende ändras när man byter teknik som det här? Jag har iaf inte tänkt på det innan.

En annan sådan källa som förekommer är tid mellan inkommande frames på Ethernetportar. Min magkänsla säger att trenden mot att skapa virtuella nätverk mellan virtualiserade servrar borde göra att den källan till entropi blir mindre värd att lita på. Över huvud taget borde virtualisering innebära problem för entropikällor då poängen med virtualisering är att ersätta fysisk hårdvara med programimplementationer.

Vad tror du?

NIST publicerar lista på alla SHA-3-kandidater

December 10th, 2008

NIST postade för några minuter sedan till den maillista som finns för SHA-3-tävlingen att det nu finns en sida med alla kandidater man accepterat. NISTs Bill Burr skriver om kandidaterna:


NIST received 64 SHA-3 candidate hash function submissions. Overall, NIST is very pleased with the obvious high quality of many of the submissions, as well as the general range of designs. NIST has accepted 51 first round candidates as meeting our minimum acceptance criteria. They are now posted on the NIST website

Den publicerade listan med kandidater ser ut så här:


Abacus
ARIRANG
AURORA
BLAKE
Blender
Blue Midnight Wish
BOOLE
Cheetah
CHI
CRUNCH
CubeHash
DCH
Dynamic SHA
Dynamic SHA2
ECHO
ECOH
EDON-R
EnRUPT
ESSENCE
FSB
Fugue
Gröstl (New spelling: Grøstl)
Hamsi
JH
Keccak
Khichidi-1
LANE
Lesamnta
Luffa
LUX
MCSSHA-3
MD6
MeshHash
NaSHA
SANDstorm
Sarmal
Sgàil
Shabal
SHAMATA
SHAvite-3
SIMD
Skein
Spectral Hash
StreamHash
SWIFFTX
Tangle
TIB3
Twister
Vortex
WaMM
Waterfall

I listan som NIST publiceras visas bara namnet på en av skaparna av respektive kandidat, men att döma av den listan finns det inget svenskt bidrag. Jag skall gå igenom listan mer i detalj och återkommer.

NIST skriver i sin postning lite mer om planerna för tävlingen:


We will review these first round candidates at the first SHA-3 Candidate Conference on February 25-28, 2009 at Leuven. During the summer of 2009 we plan to select about 15 second round candidates for more focused review at the Second SHA-3 Candidate Conference, tentatively scheduled for August, 2010. Following that second conference we expect to select about 5 third round candidates (or “finalists”). At our third conference we will review the finalists and select a winner shortly thereafter. At each stage we will do our best to explain our choices.

The Federal Register announcement specified minimum acceptability requirements for “complete and proper submissions.” These requirements included provisions for reference and optimized C code implementations, known answer tests, a written specification and required intellectual property statements.

NIST har uppenbarligen haft en del bestyr med att få ordning på kandidaterna, och har en del kommentarer om kod, specifikationer etc. Problem på dessa punkter var anledningen till att en del kandidater ej kom med. NIST skriver:


We asked for reference code and optimized 32 and 64-bit code. Some submissions did not include optimized implementations, so we will use the performance results from the reference implementations in our future deliberations. Some submissions were rejected because C code was not provided. NIST specified a specific API for the C code, and a few submissions did not use that API: these submissions were also rejected. In some cases, we made a number of minor corrections to the submitted code (largely in the include statements) in order to allow it to compile and run, but made no major repairs.

NIST attempted to verify that the submitted C programs gave outputs that corresponded to the submitted known answer test results when compiled and run on our reference platform. In several cases there were discrepancies between the known answer test results NIST got on our reference platform, and the known answer test results provided by the submitters. NIST will notify those submitters, and these discrepancies must be resolved in a timely manner if the submission is to be eligible to become a second round candidate.

We also asked for documentation, including a complete specification of the algorithms, known answer test results, a performance analysis on different platforms and a security analysis. The quality of the submitted documentation varied greatly. For the security and performance analyses, we were very liberal in what we accepted. We had difficulty determining that the algorithm specifications were complete in some cases. In some of these cases necessary information, such as initial values or padding rules, were omitted from otherwise well-written specifications, but we were able to easily determine this information from the code; these specifications were considered acceptable, since independent implementers can find what they need and the specification can be easily fixed. Some written specifications were incomprehensible without a careful examination of the C code; the more extreme cases were rejected. Inevitably, there were cases between the two extremes. There were several submissions which we accepted that required us to rely more on the programming code for clear understanding than we liked.

We expect that the algorithms selected as the SHA-3 finalists will have specifications that will allow independent implementers to program or design hardware that will produce results that match those provided by the submitters for the known answer tests. In the AES competition, Brian Gladman and others provided independent implementations of all the finalists. Marginal, hard to follow specifications may affect whether a submission is selected for the second round.

We reviewed the intellectual property statements for all of the submissions. While there remain minor issues in some of the statements, we believe that all the accepted submissions include IP statements that allow us to continue the evaluation process for those submissions for now. However, any IP statement issues must be fully resolved before a candidate can progress to be a second round candidate.

Slutligen noterar NIST att det pågått och pågår en febril aktivitet med kandidaterna utanför NISTs kontroll och NIST kommenterar SHA-3-Zoo:


Many of the accepted submissions have been posted on the SHA-3 Zoo site for some time, and a number have been analyzed and are claimed to be “broken.” In some cases, the submitters have conceded the break. In other cases, the submitters concede the break, but claim that it can be fixed with trivial changes (e.g. by adding a few rounds). In still other cases, it appears that the breaks are fundamental and cannot be fixed without extensive modifications. NIST does not want to spend time in the upcoming SHA-3 conference on accepted, but broken algorithms, unless the break is disputed, or the fix is truly trivial. On the other hand, there has been considerable discussion about what is considered to be a break, and we expect to continue that discussion in Leuven. We also expect to discuss allowing submitters to use their “tunable parameter” to make changes to their algorithm before the second round candidates are chosen.
We will continue to consider submissions where there is a dispute about whether the submission is in fact broken until we can make a determination about the facts of the case.

VISA-kort med inbyggd kodgenerator

December 7th, 2008

New York Times skriver om en ny typ av VISA-kort som innehåller en generator för engångskoder. Kortet är utrustat med ett numeriskt tangentbord samt en display.

VISAs kort.

När en kod skall genereras används tangentbordet för att mata in den PIN-kod som autenticierar dig mot kortet. Kortet genererar en engångskod, vilken visas på displayen. Den genererade koden används för att elektroniskt autenticiera kortet.

Konstruktionen motsvarar alltså det ex SEB och Swedbank åstadkommer med sina dosor från Vasco, men nu behöver man inte släpa runt på dosan (jag har aldrig upplevt att det är speciellt betungande) då den finns i kortet.

Jag tycker att detta är en mycket smutt lösning. Dock tycker jag att jag sett liknande teknik förut, bland annat från svenska Cypak.

Första SHA-3-konferensen utlyst

December 5th, 2008

NIST har meddelat att den första konferensen om SHA-3-kandidater kommer att arrangeras i anslutning till konferensen Fast Software Encryption (FSE) 2009. Konferensen hålls 22-25 februari i Leuven i Belgien.

Det börjar samtidigt bli allt mer uppenbart att NIST blivit något överväldigad av alla kandidater som dom fått in. Fortfarande har NIST inte ens presenterat en lista över mottagna kandidater och NIST skriver i utlysningen av konferensen att:


It appears that the number of accepted submissions will considerably exceed the number that NIST and the community can analyze thoroughly in a reasonable time period. NIST is considering ways to involve the cryptographic community in quickly reducing the number of submissions to a more manageable number. The process and criteria for this selection will be a major topic of this conference.

Även Bruce Schneier tar upp det stora antalet kandidater i ett inlägg på sin blogg som egentligen handlar om uppdateringar av sin kandidat Skein. I postningen pekar Schneier bland annat på en artikel om kandidaterna och personerna som skapat dessa, bland annat Peter Schmidt-Nielsen, en 15-årig hashfunktionsutvecklare. Peters kandidat Ponic har dock redan knäckts.

Över huvud taget pågår det en febril verksamhet för att knäcka de kandidater som är kända. På den maillista som finns kommer det dagligen flera postningar om attacker, analyser etc. Och återigen känns det inte som om NIST är med i matchen, utan att SHA-3-tävlingen har fått ett eget liv.

Av de nu 36 kända kandidater som finns på SHA-3 Zoo är nio kandidater knäckta och att det finns någon slags kryptanalys av ytterligare 12.

Problem med arc4random i FreeBSD

December 3rd, 2008

Enligt en säkerhetsrapport från FreeBSD-projektet finns det ett problem med slumptalsgeneratorn arc4random.

FreeBSD-logo

Säkerhetsrapporten FreeBSD-SA-08.11.arc4random beskriver problemet så här:


I. Background
arc4random(9) is a generic-purpose random number generator based on the key stream generator of the RC4 cipher. It is expected to be cryptographically strong, and used throughout the FreeBSD kernel for a variety of purposes, some of which rely on its cryptographic strength.

arc4random(9) is periodically reseeded with entropy from the FreeBSD kernel’s Yarrow random number generator, which gathers entropy from a variety of sources including hardware interrupts. During the boot process, additional entropy is provided to the Yarrow random number generator from userland, helping to ensure that adequate entropy is present for cryptographic purposes.

II. Problem Description
When the arc4random(9) random number generator is initialized, there may be inadequate entropy to meet the needs of kernel systems which rely on arc4random(9); and it may take up to 5 minutes before arc4random(9) is reseeded with secure entropy from the Yarrow random number generator.

III. Impact
All security-related kernel subsystems that rely on a quality random number generator are subject to a wide range of possible attacks for the 300 seconds after boot or until 64k of random data is consumed. The list includes:

  • GEOM ELI providers with onetime keys. When a provider is configured in a way so that it gets attached at the same time during boot (e.g. it uses the rc subsystem to initialize) it might be possible for an attacker to recover the encrypted data.
  • GEOM shsec providers. The GEOM shsec subsytem is used to split a shared secret between two providers so that it can be recovered when both of them are present. This is done by writing the random sequence to one of providers while appending the result of the random sequence on the other host to the original data. If the provider was created within the first 300 seconds after booting, it might be possible for an attacker to extract the original data with access to only one of the two providers between which the secret data is split.
  • System processes started early after boot may receive predictable IDs.
  • The 802.11 network stack uses arc4random(9) to generate initial vectors (IV) for WEP encryption when operating in client mode and WEP authentication challenges when operating in hostap mode, which may be insecure.
  • The IPv4, IPv6 and TCP/UDP protocol implementations rely on a quality random number generator to produce unpredictable IP packet identifiers, initial TCP sequence numbers and outgoing port numbers. During the first 300 seconds after booting, it may be easier for an attacker to execute IP session hijacking, OS fingerprinting, idle scanning, or in some cases DNS cache poisoning and blind TCP data injection attacks.
  • The kernel RPC code uses arc4random(9) to retrieve transaction identifiers, which might make RPC clients vulnerable to hijacking

IV. Workaround
No workaround is available for affected systems.

V. Solution
NOTE WELL: Any GEOM shsec providers which were created or written to
during the first 300 seconds after booting should be re-created after
applying this security update.

Perform one of the following:
1) Upgrade your vulnerable system to 6-STABLE, or 7-STABLE, or to the RELENG_7_0, or RELENG_6_3 security branch dated after the correction date.

2) To patch your present system:
The following patches have been verified to apply to FreeBSD 6.3 and 7.0 systems.

a) Download the relevant patch from the location below, and verify the detached PGP signature using your PGP utility.

[FreeBSD 7.x]

  1. fetch http://security.FreeBSD.org/patches/SA-08:11/arc4random.patch
  2. fetch http://security.FreeBSD.org/patches/SA-08:11/arc4random.patch.asc

[FreeBSD 6.x]

  1. fetch http://security.FreeBSD.org/patches/SA-08:11/arc4random6x.patch
  2. fetch http://security.FreeBSD.org/patches/SA-08:11/arc4random6x.patch.asc

b) Apply the patch.

  1. cd /usr/src
  2. patch < /path/to/patch

c) Recompile your kernel as described in
and reboot the system.

Kör du FreeBSD, och speciellt om du använder GEOM och GBDE bör du patcha eller uppgradera ditt system (om du inte redan gjort det).

NIST-dokument om nyckelgenerering från slumptalsgeneratorer

December 3rd, 2008

NIST har släppt ett dokument, NIST sp800-108, Recommendation for Key Derivation Using Pseudorandom Functions som beskriver bra metoder att generera nyckelmaterial (nycklar) baserade på utdata från pseudoslumptalsgeneratorer (PRNG).

Dokumentet beskriver flera funktioner för att generera nycklar baserad på en nyckel som tidigare förhandlats fram mellan två parter, parter som av olika skäl behöver ytterligare nycklar för sin kommunikation. De två PRNG-funktioner dokumentet rekommenderar är HMAC och CMAC.

HMAC
HMAC.

Dessa funktioner används sedan i olika nyckelgenereringsmoder. En av dessa moder är en countermod-liknande konstruktion. En viktig del av dokumentet är de säkerhetsaspekter som tas upp i dokumentets sista kapitel.

Om du har ett behov av att generera nycklar är detta ett dokument väl värt att läsa.

Vad hände med IPETEE?

November 30th, 2008

I somras var det en del uppmärksamhet om ett förslag till opportunistisk kryptering kallad IPETEE - “Transparent end-to-end encryption for the internets ” skapat av nÃ¥gra frÃ¥n The Pirate Bay (TPB). Bland annat var det en del diskussioner mellan Matt Blaze (inlägg ett och inlägg tvÃ¥) och en av skaparna av förslaget (Olle B).

Själva IPETEE-förslaget bodde på en Wiki på webbplatsen tfr.org. Men då jag i samband med att jag kollade status för strömkryptot Salsa 20, vilket skulle användas i IPETEE försökte jag kolla in webbplatsen. Men där möts man av en 404:a. Över huvud taget verkar tfr.org inte må speciellt bra.

Är det någon som vet vad som hände med IPETEE? Blev det helt enkelt nedlagt?