Re: explain to an idiot why gpg output slates towards 0xd5
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


sci.crypt archive

Re: explain to an idiot why gpg output slates towards 0xd5

From: Jean-Luc Cooke <jlcooke@engsoc.org>
Date: Tue Dec 20 2005 - 18:24:48 CET

Try this on for size folks:
 - UTF-16

What's the escape sequence (in let's say Redhat) for interpreting a
text (.txt) file as UTF-16? Or Unicode?

Does the output from:
  dd if=/dev/urandom of=mytest.txt bs=1k count=16384
  ls -l mytest.txt
  wc -b mytest.txt
  wc -c mytest.txt

Produce the same value?

JLC

Tim Smith <reply_in_group@mouse-potato.com> wrote:
> In article <1134882255.745950.295640@g47g2000cwa.googlegroups.com>,
> tomstdenis@gmail.com wrote:
> > The following source was used to test gpg from cygwin and it passes the
> > eyeball test.
> >
> > ---
> > #include <stdio.h>
> >
> > int t[256];
> >
> > int main(void)
> > {
> > int x, y, z, ch;
> >
> > while ((ch = fgetc(stdin)) != EOF) {
> > ++t[ch];
> > }
> >
> > for (ch = 0; ch < 10; ch++) {
> > z = 0;
> > for (x = 0; x < 256; x++) {
> > if (t[x] > z) { y = x; z = t[x]; }
> > }
> > printf("most freq: %02x\n", y);
> > t[y] = 0;
> > }
> > return 0;
> > }

> Get new eyeballs.

> $ cc toms_program.c
> $ dd if=/dev/urandom of=in bs=1024 count=16384
> 16384+0 records in
> 16384+0 records out
> $ gpg -c in
> ...used passphrase 'foo'...
> $./a.out < in.gpg
> most freq: ed
> most freq: e9
> most freq: 55
> most freq: be
> most freq: 69
> most freq: ce
> most freq: b3
> most freq: 7f
> most freq: a6
> most freq: 92
> $ dd if=in.gpg bs=1024 skip=1024 of=middle count=14336
> 14336+0 records in
> 14336+0 records out
> $./a.out < middle
> most freq: ed
> most freq: 69
> most freq: 24
> most freq: 55
> most freq: 36
> most freq: 7b
> most freq: c8
> most freq: 7f
> most freq: e9
> most freq: be

> Same results using 1 meg and 32 meg input files from /dev/urandom.

> Note that ed is the most frequent, even when discarding the first and
> last megabyte of the gpg output, so the theory that someone else offered
> that it is due to bias in the file header is not correct.

> --
> --Tim Smith

-- 
Received on Fri Dec 23 20:11:15 2005