[OTR-users] otr modify toolkit

Bjorn Kuiper bjorn at kuiper.nu
Mon Jun 29 20:03:59 EDT 2015


> On Thu, May 21, 2015 at 07:36:04PM +0200, Bjorn Kuiper wrote:
> > Hi,
> >
> >
> >
> > I'm having some problems using the otr_modify application from the
> > otrlib toolkit.
> >
> >
> >
> > Could somebody explain to me where I can get the mackey that is needed
> > as the first parameter?
> >
> >
> >
> > Assume I send the following text
> >
> >
> >
> > "hi bob, my name is alice"
> >
> >
> >
> > Which is encrypted into the following data message:
> >
> >
> ?OTR:AAMD8E6ZSifXvlYAAAAAAQAAAAEAAADAD2DA/+dQWOE0SbzhRlF9M
> NezfZxG+qNXz
> > GaJ65W
> >
> j3qr/72f1MSx1lSxJ2hZ0HX22rFbO3ctAY97iMNwVoZGW7WRj4Fy3JZWZ8ATxL
> OSzX26DF
> > 9Ft/O1
> >
> h8Ndu5gzVYoUsXAj0Q+UCkMD9jR2Pv6/ykLhx1eHyznpIFDxkExblcdOcFAHZX
> 8iWeIocu
> > h8Ndu5gzVYoUsXAj0Q+CrsF8A
> >
> oRMPTHsB3x8XXergQ6XOzOUQTNjyBSdoV46CFk3qWGJy8OC3HQPQhG4voP
> 1wyvBUJAAAAA
> > AAAAAE
> >
> AAAAZoCjmoJICwz+7CJZ//uMLWbrm9pT4ABiURY39QOGdMud4QQIA3gI1pX
> h+KUIWAAAAAA==.
> >
> >
> >
> > Wouldn't the mackey be the key that I can retrieve using otr_parse,
thus:
> > 8dfd40e19d32e778410200de0235a5787e294216 ?
> 
> No, that's the MAC tag, not the MAC key.
> 
> > Or would it be the mackey that I would retrieve when re-establishing a
> > new DH key and get it from the list of old mackeys?
> 
> Indeed.  There are two ways to get the MAC key.  One is if you know the
> private part of a DH key, in which case you can use otr_sesskeys to get
it.
> The other is if you have a transcripts containing later messages that
contain
> this key as an "old mackey", which you get with otr_parse.
> 
>    - Ian

So consider the attached private key pidgin file, the private key of __bob
would be "2E3342837ACFB215EF502845CB48BB724762B950" whereas the public key
of __alice would be
"009D1F02172287D532DA187202FD752EB372AB8A16130927E9BE1B21453853544872E0126F0
8CB9F5BCB5345E5B83E62058663AD511CA601A59EEA73C8904C4B25915B3B8C3CE39CF108E1E
11F7AA4C258112554CD5A325C3A8613F9365586AAA0904B0FEBEFB6F643B9209D79180EEF319
D5A75EEE800D39C44A26CA672C38567".

Running this through otr_sesskeys results in 
--
We are the high end of this key exchange.

Our public key:
c44ea24c97b2e231d3846f25d7336512f3492869fbd30a9a0051fe9abfcffb0e512bff9df3cc
88ae3c2d3291d5993957a254b422e0bea47897bbf0e37bd02d58c4baf891f99197a611d47891
ba827930a1dbce7fb4b591c833c71913f9489554ebb29a1f4b5b5b7bbbc86c08f5995af4ab90
854a0d422935ceed4cf35eb6c366464a224b6522ae1b450f09c92a3a874f19c05a9e6a755ee0
7f432119d5555db10651a926f2dd595d2fc60ccfe30ec0b5ac3d730b22c2af8fd662510ebf87
6d0a

Session id: b3c7046430ea2e0c1e29bb1b74bab8c7c5e82608

Sending   AES key: 38433fc99476c6dec00905700876740b
Sending   MAC key: bb307c86b269201b33e8f4606f8f541d8a11c3bd
Receiving AES key: a3d04c132c68a9697d1092225304d097
Receiving MAC key: d4def44ed4178c84a693a14516d344b7917b23a2
--

Where our focus is on the receiving MAC key.

We use this MAC key to modify our message that we send to __alice, saying
"hoi alice":
?OTR:AAMDJ9e+VvBOmUoAAAAAAQAAAAEAAADA/QzMtslPdMiwOhStWZG5HQ7h9tdpb9KpM7R57Gv
MHHGDbFH1VDc74L3OHJdRprso5ZLsaQK9Rx3s7ZFIh6ubbDvsm/HPUCoZGwe1fadGV7d/v9+Eyg/
0jnjh0lGVDIT+W6d5Ia0EmHIzS9G6hsAugpK9Pk370JTL0bSaJIyzWYeZamSo4+OwJcusmiKrfWC
15KiqGKWn0v29UYCpjrrgIlTj96Wmgo0yCFg+IEbCpssK0uSRa33kyqQTnpLthBjqAAAAAAAAAAE
AAAAKSrXNbc4fKYnZctVOW6P8z1koqGmSqMqRM+1o18P3AAAAAA==.

Thus running otr_modify as follows
--
$ ./otr_modify.exe d4def44ed4178c84a693a14516d344b7917b23a2 alice bjorn 4
?OTR:AAMDJ9e+VvBOmUoAAAAAAQAAAAEAAADA/QzMtslPdMiwOhStWZG5HQ7h9tdpb9KpM7R57Gv
MHHGDbFH1VDc74L3OHJdRprso5ZLsaQK9Rx3s7ZFIh6ubbDvsm/HPUCoZGwe1fadGV7d/v9+Eyg/
0jnjh0lGVDIT+W6d5Ia0EmHIzS9G6hsAugpK9Pk370JTL0bSaJIyzWYeZamSo4+OwJcusmiKrfWC
15KiqGKWn0v29UYCpjrrgIlTj96Wmgo0yCFg+IEbCpssK0uSRa33kyqQTnpLthBjqAAAAAAAAAAE
AAAAKSrXNbc4fKYnZctVOW6P8z1koqGmSqMqRM+1o18P3AAAAAA==.
MAC does not verify: wrong MAC key?
--

Which fails.

Can you point me to my mistake? Thank you!

Greetings Bjorn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: otr.private_key
Type: application/octet-stream
Size: 1998 bytes
Desc: not available
URL: <http://lists.cypherpunks.ca/pipermail/otr-users/attachments/20150630/498392e3/attachment.obj>


More information about the OTR-users mailing list