Translation

(itstool) path: sect1/programlisting
/*
ULISCAN.c ---blocksize of 8

1 Oct 98
1 Dec 98
21 Dec 98 uliscan.c derived from ueli8.c

This version has // comments removed for Sun cc

This implements Ueli M Maurer's "Universal Statistical Test for Random
Bit Generators" using L=8

Accepts a filename on the command line; writes its results, with other
info, to stdout.

Handles input file exhaustion gracefully.

Ref: J. Cryptology v 5 no 2, 1992 pp 89-105
also on the web somewhere, which is where I found it.

-David Honig
honig@sprynet.com

Usage:
ULISCAN filename
outputs to stdout
*/

#define L 8
#define V (1<<L)
#define Q (10*V)
#define K (100 *Q)
#define MAXSAMP (Q + K)

#include <stdio.h>
#include <math.h>

int main(argc, argv)
int argc;
char **argv;
{
FILE *fptr;
int i,j;
int b, c;
int table[V];
double sum = 0.0;
int iproduct = 1;
int run;

extern double log(/* double x */);

printf("Uliscan 21 Dec 98 \nL=%d %d %d \n", L, V, MAXSAMP);

if (argc < 2) {
printf("Usage: Uliscan filename\n");
exit(-1);
} else {
printf("Measuring file %s\n", argv[1]);
}

fptr = fopen(argv[1],"rb");

if (fptr == NULL) {
printf("Can't find %s\n", argv[1]);
exit(-1);
}

for (i = 0; i < V; i++) {
table[i] = 0;
}

for (i = 0; i < Q; i++) {
b = fgetc(fptr);
table[b] = i;
}

printf("Init done\n");

printf("Expected value for L=8 is 7.1836656\n");

run = 1;

while (run) {
sum = 0.0;
iproduct = 1;

if (run)
for (i = Q; run && i < Q + K; i++) {
j = i;
b = fgetc(fptr);

if (b < 0)
run = 0;

if (run) {
if (table[b] > j)
j += K;

sum += log((double)(j-table[b]));

table[b] = i;
}
}

if (!run)
printf("Premature end of file; read %d blocks.\n", i - Q);

sum = (sum/((double)(i - Q))) / log(2.0);
printf("%4.4f ", sum);

for (i = 0; i < (int)(sum*8.0 + 0.50); i++)
printf("-");

printf("\n");

/* refill initial table */
if (0) {
for (i = 0; i < Q; i++) {
b = fgetc(fptr);
if (b < 0) {
run = 0;
} else {
table[b] = i;
}
}
}
}
}
2280/22800
Context English Norwegian Bokmål State
In the <quote>secure</quote> window, run the <trademark class="registered">UNIX</trademark> command <citerefentry><refentrytitle>yes</refentrytitle><manvolnum>1</manvolnum></citerefentry>, which will stream the <literal>y</literal> character. After a while, stop this. Switch to the insecure window, and repeat. After a while, stop.
I det <quote>sikre</quote> vinduet, kjør <trademark class="registered">UNIX</trademark> command <citerefentry><refentrytitle>yes</refentrytitle><manvolnum>1</manvolnum></citerefentry>, som vil streame <literal>y</literal> tegnet. Stopp dette etter en stund. Bytt til det usikre vinduet, og gjenta. Etter en stund, stopp.
Now run <link linkend="code">MUST</link> on the captured packets. You should see something like the following. The important thing to note is that the secure connection has 93% (6.7) of the expected value (7.18), and the <quote>normal</quote> connection has 29% (2.1) of the expected value.
Kjør nå <link linkend="code">MUST</link> på de fangede pakker. Du bør se noe som det følgende. Det viktige å merke seg er at den sikre tilkoblingen har 93% (6,7) av den forventede verdien (7.18), og <quote>normal</quote> tilkoblingen har 29% (2.1) av den forventede verdien.
<prompt>%</prompt> <userinput>tcpdump -c 4000 -s 10000 -w <replaceable>ipsecdemo.bin</replaceable></userinput>
<prompt>%</prompt> <userinput>uliscan <replaceable>ipsecdemo.bin</replaceable></userinput>

Uliscan 21 Dec 98
L=8 256 258560
Measuring file ipsecdemo.bin
Init done
Expected value for L=8 is 7.1836656
6.9396 --------------------------------------------------------
6.6177 -----------------------------------------------------
6.4100 ---------------------------------------------------
2.1101 -----------------
2.0838 -----------------
2.0983 -----------------
<prompt>%</prompt> <userinput>tcpdump -c 4000 -s 10000 -w <replaceable>ipsecdemo.bin</replaceable></userinput>
<prompt>%</prompt> <userinput>uliscan <replaceable>ipsecdemo.bin</replaceable></userinput>

Uliscan 21 Dec 98
L=8 256 258560
Measuring file ipsecdemo.bin
Init done
Expected value for L=8 is 7.1836656
6.9396 --------------------------------------------------------
6.6177 -----------------------------------------------------
6.4100 ---------------------------------------------------
2.1101 -----------------
2.0838 -----------------
2.0983 -----------------
Caveat
Forbeholdet
This experiment shows that IPsec <emphasis>does</emphasis> seem to be distributing the payload data <emphasis>uniformly</emphasis>, as encryption should. However, the experiment described here <emphasis>cannot</emphasis> detect many possible flaws in a system (none of which do I have any evidence for). These include poor key generation or exchange, data or keys being visible to others, use of weak algorithms, kernel subversion, etc. Study the source; know the code.
Dette eksperimentet viser at IPsec <emphasis>does</emphasis> ser ut til å distribuere nyttelastdataene <emphasis>uniformert</emphasis>, som kryptering burde. Imidlertid <emphasis>kan ikke</emphasis> eksperimentet som er beskrevet her, oppdage mange mulige feil i et system (hvorav ingen har jeg bevis for). Disse inkluderer dårlig nøkkelgenerering eller utveksling, data eller nøkler er synlige for andre, bruk av svake algoritmer, kjerneundersøkelse, etc. Studer kilden; kjenner koden.
IPsec---Definition
IPsec---Definisjon
Internet Protocol security extensions to IPv4; required for IPv6. A protocol for negotiating encryption and authentication at the IP (host-to-host) level. SSL secures only one application socket; <application>SSH</application> secures only a login; <application>PGP</application> secures only a specified file or message. IPsec encrypts everything between two hosts.
Internet Protocol sikkerhetsutvidelser til IPv4; påkrevd for IPv6. En protokoll for forhandling av kryptering og autentisering på IP-nivå (vert-til-vert) -nivå. SSL sikrer bare én applikasjonsuttak; <application>SSH</application> sikrer bare innlogging; <application>PGP</application> sikrer bare en spesifisert fil eller melding. IPsec krypterer alt mellom to verter.
Installing IPsec
Installere IPsec
Most of the modern versions of FreeBSD have IPsec support in their base source. So you will need to include the <option>IPSEC</option> option in your kernel config and, after kernel rebuild and reinstall, configure IPsec connections using <citerefentry><refentrytitle>setkey</refentrytitle><manvolnum>8</manvolnum></citerefentry> command.
De fleste av de moderne versjonene av FreeBSD har IPsec-støtte i basekilden. Så du må inkludere alternativet <option>IPSEC</option> i kjernekonfigurasjonen din, og etter at kernen er gjenoppbygd og installert på nytt, konfigurerer du IPsec-tilkoblinger ved å bruke <citerefentry><refentrytitle>setkey</refentrytitle><manvolnum>8</manvolnum></citerefentry> kommandoen.
A comprehensive guide on running IPsec on FreeBSD is provided in <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/ipsec.html">FreeBSD Handbook</link>.
En omfattende guide for å kjøre IPsec på FreeBSD finnes i <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/ipsec.html">FreeBSD Handbook</link>.
src/sys/i386/conf/KERNELNAME
src/sys/i386/conf/KERNELNAME
This needs to be present in the kernel config file in order to capture network data with <citerefentry><refentrytitle>tcpdump</refentrytitle><manvolnum>1</manvolnum></citerefentry>. Be sure to run <citerefentry><refentrytitle>config</refentrytitle><manvolnum>8</manvolnum></citerefentry> after adding this, and rebuild and reinstall.
Dette må være til stede i kjernekonfigurasjonsfilen for å fange nettverksdata med <citerefentry><refentrytitle>tcpdump</refentrytitle><manvolnum>1</manvolnum></citerefentry>. Sørg for å kjøre <citerefentry><refentrytitle>config</refentrytitle><manvolnum>8</manvolnum></citerefentry> etter å ha lagt til dette, og gjenoppbygg og installer på nytt.
device bpf
device bpf
Maurer's Universal Statistical Test (for block size=8 bits)
Maurer's Universal Statistical Test (for block size=8 bits)
You can find the same code at <link xlink:href="https://web.archive.org/web/20031204230654/http://www.geocities.com:80/SiliconValley/Code/4704/uliscanc.txt"> this link</link>.
Du kan finne den samme koden her <link xlink:href="https://web.archive.org/web/20031204230654/http://www.geocities.com:80/SiliconValley/Code/4704/uliscanc.txt"> this link</link>.
/*
ULISCAN.c ---blocksize of 8

1 Oct 98
1 Dec 98
21 Dec 98 uliscan.c derived from ueli8.c

This version has // comments removed for Sun cc

This implements Ueli M Maurer's "Universal Statistical Test for Random
Bit Generators" using L=8

Accepts a filename on the command line; writes its results, with other
info, to stdout.

Handles input file exhaustion gracefully.

Ref: J. Cryptology v 5 no 2, 1992 pp 89-105
also on the web somewhere, which is where I found it.

-David Honig
honig@sprynet.com

Usage:
ULISCAN filename
outputs to stdout
*/

#define L 8
#define V (1&lt;&lt;L)
#define Q (10*V)
#define K (100 *Q)
#define MAXSAMP (Q + K)

#include &lt;stdio.h&gt;
#include &lt;math.h&gt;

int main(argc, argv)
int argc;
char **argv;
{
FILE *fptr;
int i,j;
int b, c;
int table[V];
double sum = 0.0;
int iproduct = 1;
int run;

extern double log(/* double x */);

printf("Uliscan 21 Dec 98 \nL=%d %d %d \n", L, V, MAXSAMP);

if (argc &lt; 2) {
printf("Usage: Uliscan filename\n");
exit(-1);
} else {
printf("Measuring file %s\n", argv[1]);
}

fptr = fopen(argv[1],"rb");

if (fptr == NULL) {
printf("Can't find %s\n", argv[1]);
exit(-1);
}

for (i = 0; i &lt; V; i++) {
table[i] = 0;
}

for (i = 0; i &lt; Q; i++) {
b = fgetc(fptr);
table[b] = i;
}

printf("Init done\n");

printf("Expected value for L=8 is 7.1836656\n");

run = 1;

while (run) {
sum = 0.0;
iproduct = 1;

if (run)
for (i = Q; run &amp;&amp; i &lt; Q + K; i++) {
j = i;
b = fgetc(fptr);

if (b &lt; 0)
run = 0;

if (run) {
if (table[b] &gt; j)
j += K;

sum += log((double)(j-table[b]));

table[b] = i;
}
}

if (!run)
printf("Premature end of file; read %d blocks.\n", i - Q);

sum = (sum/((double)(i - Q))) / log(2.0);
printf("%4.4f ", sum);

for (i = 0; i &lt; (int)(sum*8.0 + 0.50); i++)
printf("-");

printf("\n");

/* refill initial table */
if (0) {
for (i = 0; i &lt; Q; i++) {
b = fgetc(fptr);
if (b &lt; 0) {
run = 0;
} else {
table[b] = i;
}
}
}
}
}
/*
ULISCAN.c ---blocksize of 8

1 Oct 98
1 Dec 98
21 Dec 98 uliscan.c derived from ueli8.c

This version has // comments removed for Sun cc

This implements Ueli M Maurer's "Universal Statistical Test for Random
Bit Generators" using L=8

Accepts a filename on the command line; writes its results, with other
info, to stdout.

Handles input file exhaustion gracefully.

Ref: J. Cryptology v 5 no 2, 1992 pp 89-105
also on the web somewhere, which is where I found it.

-David Honig
honig@sprynet.com

Usage:
ULISCAN filename
outputs to stdout
*/

#define L 8
#define V (1&lt;&lt;L)
#define Q (10*V)
#define K (100 *Q)
#define MAXSAMP (Q + K)

#include &lt;stdio.h&gt;
#include &lt;math.h&gt;

int main(argc, argv)
int argc;
char **argv;
{
FILE *fptr;
int i,j;
int b, c;
int table[V];
double sum = 0.0;
int iproduct = 1;
int run;

extern double log(/* double x */);

printf("Uliscan 21 Dec 98 \nL=%d %d %d \n", L, V, MAXSAMP);

if (argc &lt; 2) {
printf("Usage: Uliscan filename\n");
exit(-1);
} else {
printf("Measuring file %s\n", argv[1]);
}

fptr = fopen(argv[1],"rb");

if (fptr == NULL) {
printf("Can't find %s\n", argv[1]);
exit(-1);
}

for (i = 0; i &lt; V; i++) {
table[i] = 0;
}

for (i = 0; i &lt; Q; i++) {
b = fgetc(fptr);
table[b] = i;
}

printf("Init done\n");

printf("Expected value for L=8 is 7.1836656\n");

run = 1;

while (run) {
sum = 0.0;
iproduct = 1;

if (run)
for (i = Q; run &amp;&amp; i &lt; Q + K; i++) {
j = i;
b = fgetc(fptr);

if (b &lt; 0)
run = 0;

if (run) {
if (table[b] &gt; j)
j += K;

sum += log((double)(j-table[b]));

table[b] = i;
}
}

if (!run)
printf("Premature end of file; read %d blocks.\n", i - Q);

sum = (sum/((double)(i - Q))) / log(2.0);
printf("%4.4f ", sum);

for (i = 0; i &lt; (int)(sum*8.0 + 0.50); i++)
printf("-");

printf("\n");

/* refill initial table */
if (0) {
for (i = 0; i &lt; Q; i++) {
b = fgetc(fptr);
if (b &lt; 0) {
run = 0;
} else {
table[b] = i;
}
}
}
}
}

Loading…

No matching activity found.

Browse all component changes

Things to check

Unchanged translation

Source and translation are identical

Reset

Glossary

English Norwegian Bokmål
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: sect1/programlisting
Labels
No labels currently set.
Flags
no-wrap
Source string location
article.translate.xml:213
Source string age
11 months ago
Translation file
articles/nb_NO/ipsec-must.po, string 44