ChaCha20-Poly1305@openssh.com

62 views
Skip to first unread message

Paul Nikolaus

unread,
Jun 10, 2019, 9:13:07 AM6/10/19
to PyCryptodome
Dear PycryptoDome Team,

I am currently trying to decrypt an ssh connection which uses chacha20-poly1305 to encrypt the traffic for my Master Thesis.
I managed to decrypt the length and to verify the MAC from the packets.
Unfortunately after https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.chacha20poly1305, for the payload decryption the block counter is set to 1.
I don't see any option on the pycryptodome documentation to change the block counter, which is probably set to 0 per default.
Did I miss something or is there no such option currently in the framework.

Best regards

Paul Nikolaus

Helder Eijs

unread,
Jun 10, 2019, 11:59:46 AM6/10/19
to Paul Nikolaus, PyCryptodome
Hi,

Crypto.Cipher.ChaCha20_Poly1305 (RFC7539) starts at block #1 when
encrypting the payload.

I assume you are not using it and you are rather building the AEAD
yourself, combining ChaCha20 and Poly1305?
In that case, you can take the ChaCha20 cipher and call seek(64): you
will effectively be starting from block #1.

Cheers,

H.E.
> --
> You received this message because you are subscribed to the Google Groups "PyCryptodome" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pycryptodome...@googlegroups.com.
> To post to this group, send email to pycryp...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pycryptodome/9ea94208-c423-443c-8fc9-e28fe95e8fcb%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Paul Nikolaus

unread,
Jun 11, 2019, 1:06:22 AM6/11/19
to PyCryptodome
Thanks a lot! It works!

Another Thing for which you have maybe an amswer. Is that when i decrypt an ssh packet with gcm. Using the pycryptodome Code. I have to incrememt the ivs by 36 or 72. Do you Thing that has to do with the openssh Code or Do you have maybe an explanation why this could Happen?

Best regards

Am Montag, 10. Juni 2019 17:59:46 UTC+2 schrieb Legrandin:
Hi,

Crypto.Cipher.ChaCha20_Poly1305 (RFC7539) starts at block #1 when
encrypting the payload.

I assume you are not using it and you are rather building the AEAD
yourself, combining ChaCha20 and Poly1305?
In that case, you can take the ChaCha20 cipher and call seek(64): you
will effectively be starting from block #1.

Cheers,

H.E.

>
> Dear PycryptoDome Team,
>
> I am currently trying to decrypt an ssh connection which uses chacha20-poly1305 to encrypt the traffic for my Master Thesis.
> I managed to decrypt the length and to verify the MAC from the packets.
> Unfortunately after https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.chacha20poly1305, for the payload decryption the block counter is set to 1.
> I don't see any option on the pycryptodome documentation to change the block counter, which is probably set to 0 per default.
> Did I miss something or is there no such option currently in the framework.
>
> Best regards
>
> Paul Nikolaus
>
> --
> You received this message because you are subscribed to the Google Groups "PyCryptodome" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pycryp...@googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages