"Heslem jakéhokoliv dobrého bezpečnostního inženýra je: "Bezpečnost není
produkt, ale proces."
Je to více než navržení silné kryptografie do systému, je to navržení
celého systému tak,
že všechny stupně bezpečnosti,včetně kryptografie spolupracují dohromady."
-- Bruce Schneier, autor "Applied Cryptography".
Kryptografie
Obsah
Proč integrujeme kryptografii?
OpenSSH
Pseudo Random Number generátory (PRNG): ARC4, ...
Kryptografické hash funkce: MD5, SHA1, ...
Kryptografické transformace: DES, Blowfish, ...
Podpora kryptografického hardware
Hledáme kryptografické odborníky z celého světa
Další informace
Proč integrujeme kryptografii?
Třemi slovy: Protože my můžeme.
OpenBSD projekt sídlí v Kanadě.
Export Control List of Canada
neomezuje export kryptografického software a je dokonce více
otevřený pro export volně dostupného kryptografického software.
Marc Plumb provedl
výzkum
k otestování kryptografických zákonů.
Z toho důvodu OpenBSD projekt použil kryptografii na několika místech
v operačním systému.
Požadujeme,aby kryptografický software,který používáme byl
volně dostupný a s dobrou licencí.
Nepoužíváme kryptografii s odpornými patenty.Také požadujeme, že tento
software je ze zemí
s použitelnou exportní licencí, protože nechceme porušovat zákony
jakékoliv země.
Komponenty kryptografického software,který aktuálně používáme byly
napsány v Argentině,
Austrálii, Kanadě, Německu, Řecku, Norsku a Švédsku.
Když vytváříme release nebo snapshot, tak sestavujeme jejich binární
verze ve svobodných
zemích abychom zajistili, že zdroje a binárky, které poskytujeme
uživatelům jsou bez poskvrny.
V minulosti byly naše vydané binární buildy udělány v Kanadě, Švédsku
a Německu.
OpenBSD je vydáván s Kerberos V. Kód který používáme je exportovatelný
Heimdal ze Švédska.
Naše X11 zdroje byly rozšířeny tak, aby mohli také používat Kerberos.
OpenBSD byl první operační systém distribuovaný s IPsec stackem.
Poskytujeme IPsec od vydání
OpenBSD 2.1 v roce 1997. Náš plně do kernelu integrovaný IPsec stack
s hardware akcelerací
použitou na několika kartách a naším vlastním ISAKMP daemonem
je používán jako jeden
z počítačů v testu IPsec conformance u
VPNC.
Dnešní kryptografie je důležitou částí zvýšení bezpečnosti operačního systému.Kryptografie
použitá
v OpenBSD může být použita pro mnoho různých služeb popsaných dále.
OpenSSH
Od verze 2.6 , OpenBSD obsahuje
OpenSSH, zcela bezplatnou a
patenty nezanešenou verzi ssh.
OpenSSH je
kompatibilní s ssh verze 1 a má mnoho přidaných vlastností,
-
všechny komponenty s nějákým omezením (například patentovým,podívejte
se na
ssl(8))
byly vyňaty
ze zdrojového kódu; jakékoliv licencovaní nebo patentované komponenty
užívajících externí knihovny
-
byl aktualizován aby podporoval ssh protokol verze 1.5
-
obsahuje pripadnou podporu pro Kerberos autentikaci a ticket passing
-
podpora one-time password autentizace pomoc??
skey(1)
Zhruba řečeno jsme vzali volně vydanou verzi ssh a OpenBSD-fikovali
jsme ji.Asi o rok později jsme OpenSSH rozšířili o podporu SSH
protokolu verze 2.Výsledkem je podpora všech 3 hlavních
protokolů pro SSH: 1.3, 1.5, 2.0
Pseudo Random Number generátory
Pseudo Random Number generátory (PRNG) jsou aplikace s proudy čísel,
které mají důležité vlastnosti
pro systémovou bezpečnost:
- Může být nemožné pro útočníka uhádnout výstup z PRNG dokonce i
se znalostí předchozích výstupů
- Generovaná čísla nemají mít opakující se části, což znamená, že
PRNG může mít velmi dlouhou délku cyklu
PRNG je normálně pouze algoritmus, kde stejné počáteční hodnoty
poskytují stejné sekvence výstupu.
Na víceuživatelském operačním systému je mnoho zdrojů, které
dovolují naplnit PRNG náhodnými daty.
OpenBSD jádro využívá přerušení od myši, zpoždění při přenosu
síťových dat, pauz mezi stisknutím kláves
a I/O informace z disku k vyplnění počátečního zásobníku.Náhodná
čísla z PRNG jsou k dispozici pro
rutiny jádra a jsou exportovány přes zařízení k uživatelským
programům.Takže náhodná čísla z PRNG
jsou používána v následujících oblastech:
- Dynamické přidělování sin_port v bind(2)
- PID čísla procesů
- IP datagramy;čísla ID
- RPC přenosy;čísla ID (XID)
- NFS RPC přenosy;čísla ID (XID)
- DNS Query;čísla ID
- Generování čísel inodů, čtěte getfh(2) a fsirand(8)
- Přerušení časovače v traceroute(8)
- Silnější dočasná jména pro mktemp(3) a mkstemp(3)
- Přidaná náhodnost do TCP ISS hodnoty pro ochranu proti
tzv. spoofing útokům
- Náhodná výplň v IPsec esp_old paketech
- Ke generování salts pro různé algoritmy hesel
- Pro generování S/Key výzev
- V isakmpd(8)
k vytvoření důkazu o výměně klíčů.
Kryptografické hašovací funkce
Hašovací funkce provede kompresi vstupních dat na řetězec
konstantní délky.Pro kryptografickou hašovací funkci je
nemožné najít:
- dva vstupy,které mají stejný výstup (odolné proti kolizím)
- jiný vstup,pro již definovaný vstup,který by měl stejný
výstup (2nd preimage resistant)
V OpenBSD jsou použity MD5, SHA1 a RIPEMD-160 pro kryptografické hašovací funkce,
např.:
- V S/Key(1)
pro one-time-password
- V IPsec(4)
a
isakmpd(8)
pro ověření přenosu dat v paketech a kontrolu jejich integrity
- Pro FreeBSD-styl MD5 hesel (není standardně povoleno), více v
login.conf(5)
- V libssl pro digitální podepisování zpráv
Kryptografické transformace
Kryptografické transformace jsou použity pro šifrování a dešifrování dat.
Tyto jsou běžně používány
se šifrovacím klíčem pro šifrování dat a dešifrovacím klíčem pro
dešifrování dat.Bezpečnost krypto-
grafické transformace má záviset pouze na klíčích.
OpenBSD poskytuje transformace jako DES, 3DES, Blowfish a Cast pro jádro
a uživatelské programy,jež jsou používány na mnoha místech jako:
- V libc pro tvorbu
Blowfish
hesel. Podívejte se také na USENIX dokument
o tomto tématu
- V
IPsec(4)
pro poskytnutí utajení pro síťovou vrstvu
- V isakmpd(8)
k ochraně výměny klíčů při vyjednávání spojení
- V AFS k ochraně zpráv putujících přes síť,umožňující utajení přístupu
ke vzdálenému systému
- V libssl k umožnění aplikacím komunikovat defakto přes standardní
kryptograficky zabezpečený SSL protokol
Podpora kryptografického hardware
OpenBSD od verze 2.7 začalo podporovat vybraný kryptografický hardware
jako například akcelerátory a random number generátory.
-
IPsec crypto dequeue
Our IPsec stack has been modified so that cryptographic functions get
done out-of-line. Most simple software IPsec stacks need to do
cryptography when processing each packet. This results in synchronous
performance. To use hardware properly and speedily one needs to separate
these two components, as we have done. Actually, doing this gains some
performance even for the software case.
-
Hifn 7751
Cards using the Hifn 7751 can be used as a symmetric cryptographic
accelerator, i.e., the
Soekris VPN1201 or VPN1211
(to buy)
or
PowerCrypt.
Current performance using a single Hifn 7751 on each end of a tunnel
is 64Mbit/sec for 3DES/SHA1 ESP, nearly a 600% improvement over
using a P3/550 CPU. Further improvements are under way to resolve a
few more issues, but as of April 13, 2000 the code is considered
stable. We wrote our own driver for supporting this chip, rather
than using the (USA-written)
PowerCrypt driver, as well
our driver links in properly to the IPsec stack.
The 7751 is now considered slow by industry standards and many vendors
have faster chips (even Hifn now has a faster but more expensive
chip). Peak performance with 3DES SHA1 ESP is around 64Mbit/sec.
After 2.9 shipped, support was added for the Hifn 7951 chip, a
simplified version of the 7751 which adds a public key accelerator
(unsupported) and a random number generator (supported). Cards
were donated by Soekris Engineering.
After 3.0 shipped, support was added for the Hifn 7811 chip, a
faster version of the 7751 (around 130Mbit/s) with a random number
generator. A card was donated by GTGI.
After 3.2 shipped, support was added for the LZS compression algorithm
used by ipcomp(4).
After 3.4 shipped, support was added for the 7955 and 7956 chips.
In addition to all the features of the previous 7951 chip, these add AES.
Hifn was initially a difficult company to deal with (threatening to sue
us over our non-USA reverse engineering of their crypto unlock algorithm),
but more recently they have been very helpful in providing boards and
support.
-
Hifn 6500
This device is an asymmetric crypto unit. It has support for RSA, DSA,
and DH algorithms, as well as other major big number functions. It also
contains a very high performance random number generator. We have one
device, full documentation, and sample code. As of OpenBSD 3.1,
both the random number generator and big number unit are working.
-
Hifn 7814/7851/7854
This device is a packet processor and asymmetric crypto unit. It has
support for RSA, DSA, and DH algorithms, as well as other major big number
functions and also has a random number generator. Currently, only the
big number engine and the random number generator are supported (no
packet transforms).
-
Broadcom BCM5801/BCM5802/BCM5805/BCM5820/BCM5821/BCM5822/5823/5825/5860/5861/5862
(or beta chip Bluesteelnet 5501/5601)
Just after the OpenBSD 2.7 release, we succeeded at adding preliminary
support for these early release parts provided to us by the vendor,
specifically starting with the test chip 5501.
These devices provide the highest performance symmetric cryptography
we have seen.
Bluesteelnet was bought by Broadcom and started making real parts.
Their new BCM5805 is similar, except that they also add an asymmetric
engine for running DSA, RSA, and other such algorithms. With approximate
performance starting at more than four times as fast as the Hifn,
hopefully this chip will become more common soon.
The Broadcom/Bluesteelnet people have been great to deal with. They gave
us complete documentation and sample code for their chips and a
sufficient number of cards to test with.
Post 2.8, this driver was also modified to generate random numbers on
the BCM5805 and similar versions, and feed that data into the kernel
entropy pool.
Post 2.9, support was added for the BCM5820, which is mostly just a
faster (64bit, higher clock speed) version of the BCM5805. Untested
support for the BCM5821 was also added post 3.0.
As of 3.1, the big num engine is supported, and RSA/DH/DSA operations
can be accelerated.
Support for the BCM5801, BCM5802, BCM5821 and BCM5822 was added before
OpenBSD 3.2 (the untested BCM5821 support in 3.1 was broken because of
some undocumented interrupt handling requirements).
Partial support for BCM5823 was added for 3.4.
Support for the BCM5825, BCM5860, BCM5861, and BCM5862 including support
for AES with the BCM5823 or newer was added after 4.5.
-
Securealink PCC-ISES
The
PCC-ISES is a new chipset from the Netherlands. We have received
sample hardware and documentation, and work on a driver is in progress.
At the moment, the driver is capable of feeding random numbers into
the kernel entropy pool.
-
SafeNet SafeXcel 1141/1741
After 3.4 shipped, support was for added for these two chips (found on various
SafeNet
crypto cards. Supports DES, Triple-DES, AES, MD5, and SHA-1 symmetric crypto
operations, RNG, public key operations, and full IPsec packet processing.
- SafeNet SafeXcel 1840
We have received documentation and sample hardware for the
SafeNet 1840
crypto chip. Work to support at least the RNG and symmetric cryptography of
these devices has started.
- SafeNet SafeXcel 2141
We have received documentation and sample hardware for the
SafeNet 2141
crypto chip. Work to support at least the symmetric cryptography of
these devices has started.
-
3com 3cr990
3com gave us a driver to support the ethernet component of this chipset,
and based on that, we have written our own ethernet driver. This driver
has now been integrated once we were able to get a free license on the
microcode. Due to poor documentation and lack of cooperation (partly
because of the high turnover rates at 3Com), the IPsec functions of the
chip are not supported.... so this turned out to be a less than completely
useful exercise.
- Intel IPsec card
Much like Intel does for all their networking division components, and
completely unlike most other vendors, Intel steadfastly refuses to provide
us with documentation. We have talked to about five technical people who
are involved in the development of those products. They all want us to
have documentation. They commend us on what we have done. But their hands
are tied by management who does not perceive a benefit to themselves for
providing documentation. Forget about Intel. (If you want to buy gigabit
ethernet hardware, we recommend anything else... for the same reason:
most drivers we have for Intel networking hardware were written without
documentation).
-
Intel 82802AB/82802AC Firmware Hub RNG
The 82802 FWH chip (found on i810, i820, i840, i850, and i860 motherboards)
contains a random number generator (RNG). High-performance IPsec
requires more random number entropy. As of April 10, 2000, we support
the RNG. We will add support for other RNGs found on crypto chips.
- VIA C3 RNG
The newer VIA C3 CPU contains a random number generator as an instruction.
As of 3.3 this random number generator is used
inside the kernel to feed the entropy pool.
- VIA C3 AES instructions
VIA C3 CPUs with a step 8 or later Nehemiah core contains an AES
implementation accessible via simple instructions. As of 3.4 the kernel supports them to be used in an
IPsec context and exported by /dev/crypto. As of 3.5 performances have been greatly improved
and OpenSSL now uses the new instruction directly when available
without the need to enter the kernel, resulting in vastly
improved speed (AES-128 measured at 780MByte/sec) for applications
using OpenSSL to perform AES encryption.
- OpenSSL
Years ago, we had a grand scheme to support crypto cards that can do
RSA/DH/DSA automatically via OpenSSL calls. As of OpenBSD 3.2, that
support works, and any card that is supported with such functionality
will automatically use the hardware, including OpenSSH and httpd in
SSL mode. No application changes are required.
Pokud chcete pomoci s psaním ovladačů,
přijďte a pomozte nám.
Hledáme kryptografické odborníky z celého světa
Samozřejmě,že náš projekt potřebuje lidi k práci na těchto systémech.Pokud
je nějáký ne-americký odborník,který souhlasí s výše popsaným,má zájem o
zapojení do projektu a poskytnout pomoc s kryptografií v OpenBSD,tak ať
nás prosím kontaktuje.
Další informace
Mnoho dokumentů bylo napsáno členy OpenBSD týmu o kryptografických změnách,
které udělali v OpenBSD.Postscript verze těchto dokumentů jsou k dispozici
níže.
- A Future-Adaptable Password Scheme.
Usenix 1999,
by Niels Provos,
David Mazieres.
paper and
slides.
- Cryptography in OpenBSD: An Overview.
Usenix 1999,
by Theo de Raadt,
Niklas Hallqvist,
Artur Grabowski,
Angelos D. Keromytis,
Niels Provos.
paper and
slides.
- Implementing Internet Key Exchange (IKE).
Usenix 2000,
by Niklas Hallqvist and
Angelos D. Keromytis.
paper and
slides.
- Encrypting Virtual Memory.
Usenix Security 2000,
Niels Provos.
paper and
slides.
- The Design of the OpenBSD Cryptographic Framework.
Usenix 2003, by
Angelos D. Keromytis,
Jason L. Wright, and
Theo de Raadt.
paper.
- Cryptography As an Operating System Service: A Case Study.
ACM Transactions on Computer Systems,
February 2006, by
Angelos D. Keromytis,
Jason L. Wright, and
Theo de Raadt.
paper.
www@openbsd.org
$OpenBSD: crypto.html,v 1.34 2011/03/13 07:16:15 ajacoutot Exp $