🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.privacy.anon-server
Article #270225

Re: Ping Zax

#270225
From: elvis-85503
Date: Mon, 29 Sep 2014 13:06
112 lines
3934 bytes
On 2014-09-03, Zax <admin@mixmin.net> wrote:
>
> On 03 Sep 2014 18:57:25 GMT, elvis-85503@notatla.org.uk wrote in
> Message-Id: <slrnm0ep4l.k5j.elvis-85503@notatla.org.uk>:
>
>>> At the moment, I'm not.  There's a quirk in the way mix-3.0.2 uses
>>> AES-CFB initialization vectors.  This makes it hard for a 3rd party
>>> Mixmaster client, using something other than openssl crypto, to
>>> generate messages in a manner that the Mixmaster server can consistently
>>> decrypt.
>>>
>>> I'm pondering on the best way to overcome this issue without breaking
>>> backward compatibility.
>>
>> This is caused by a short cut of mine that didn't plan for implementations
>> not using openssl.
>>
>> I've got an idea but this time I want to discuss it with you before
>> shipping code.
>
> Hi Elvis,
>
> I look forward to hearing your ideas.  Maybe we should keep discussions
> on one of the various mailing lists so others have the opportunity to
> input?  I'm happy with any preference you may have.

After consulting Applied Cryptography to remind myself what CFB mode
is I came up with this C program plus Makefile to produce CFB behaviour
doing the chaining myself rather than in AES_cfb128_encrypt().

If you do something like this it should be compatible with Mixmaster.
Initialise the IV once and just keep using it as it changes.


all: cfbtest ecbtest
        echo ===== cfbtest =====
        ./cfbtest
        echo ===== ecbtest =====
        ./ecbtest

cfbtest: cfbtest.c Makefile
        gcc -o cfbtest cfbtest.c  -DCFBAUTO -I  /opt/crypto/include  -L /opt/crypto/lib -l crypto

ecbtest: cfbtest.c Makefile
        gcc -o ecbtest cfbtest.c            -I  /opt/crypto/include  -L /opt/crypto/lib -l crypto

clean:
        rm -f cfbtest ecbtest


#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <openssl/aes.h>
#include <openssl/evp.h>

int main()
{

unsigned char *data=malloc(27);
unsigned char *iv=malloc(16);
unsigned char *p;
int length=0;
int n;

for (p=iv; (p-iv)<16; p++) {
    *p=(p-iv);
    printf("%02x ", *p);
}
printf("\n");

for (p=data; (p-data)<26; p++) {
    *p='A'+(p-data);
    printf("%c", *p);
    length++;
}
printf("\n");

AES_KEY ks;
AES_set_encrypt_key("reallysecret", 128, &ks);

#ifdef CFBAUTO
    AES_cfb128_encrypt(data, data, length, &ks, iv, &n, AES_ENCRYPT);
#else
    /* producing CFB mode manually - the IV is encrypted and XORed with plaintext */
        int i,j;
        for(j=0; j<length; j+=16) {
            AES_encrypt(iv, iv, &ks);
            for (i=0; i<16; i++) {
                if ((i+j) >= length) break;
                data[i+j] ^= iv[i];
                iv[i] = data[i+j];
            }
        }

#endif

printf("cyphertext: ");
for (p=data; (p-data)<26; p++) {
    printf("%02x ", *p);
    length++;
}
printf("\n");

printf("iv: ");
for (p=iv; (p-iv)<16; p++) {
    printf("%02x ", *p);
}
printf("\n");

exit(0);
}
Technical Details
Message-ID: <slrnm2imav.c7s.elvis-85503@notatla.org.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <slrnlv6uk4.hi.admin@snorky.mixmin.net> <4c188b5c5fd593431234008698910ea8@hoi-polloi.org> <slrnm0cjma.hi.admin@snorky.mixmin.net> <slrnm0ep4l.k5j.elvis-85503@notatla.org.uk> <slrnm0f948.hi.admin@snorky.mixmin.net>

Show Full Headers
Complete Article Headers
Message-ID: <slrnm2imav.c7s.elvis-85503@notatla.org.uk>
Subject: Re: Ping Zax
Date: Mon, 29 Sep 2014 13:06:39 +0000
From: elvis-85503@notatla.org.uk
References: <slrnlv6uk4.hi.admin@snorky.mixmin.net> <4c188b5c5fd593431234008698910ea8@hoi-polloi.org> <slrnm0cjma.hi.admin@snorky.mixmin.net> <slrnm0ep4l.k5j.elvis-85503@notatla.org.uk> <slrnm0f948.hi.admin@snorky.mixmin.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Lines: 112
Nntp-Posting-Host: 91e1bb2e.blocknews.net
X-Complaints-To: abuse@blocknews.net
Newsgroups: alt.privacy.anon-server
X-Received-Bytes: 3872
X-No-Archive: yes
X-Noarchive: yes
User-Agent: slrn/1.0.1 (Linux)
X-Trace: DXC=gkgD3hn?kjcLnVk8D^@^DkGTXUl?iR^Pl<X<c6\A078bP78gKNgOJ3bG3Y6l5GlWonjDD]g:oiAgo6kR:IhX>_2fXG<len>Ea;h