F
F
fvckingc0d3r2016-07-11 16:15:24
SSH
fvckingc0d3r, 2016-07-11 16:15:24

IV 3des-cbc SSH. How to calculate it correctly?

Hello! At the moment I am implementing the SSH protocol in C++. In this regard, the following question arose on the calculation of keys. According to the RFC, they are calculated as follows:

Initial IV client to server: HASH(K || H || "A" || session_id)
(Here K is encoded as mpint and "A" as byte and session_id as raw
data. "A" means the single character A, ASCII 65).
o Initial IV server to client: HASH(K || H || "B" || session_id)
o Encryption key client to server: HASH(K || H || "C" || session_id)
o Encryption key server to client : HASH(K || H || "D" || session_id)
o Integrity key client to server: HASH(K || H || "E" || session_id)
o Integrity key server to client: HASH(K || H || "F" || session_id)

According to this scheme, I calculate the initial initialization vector. But on the next response from the server, it changes, I don’t understand by what scheme and the message cannot be decrypted. Maybe someone knows the algorithm for its further calculation?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question