Skip to content

Commit 85805be

Browse files
authored
Merge pull request bitcoin#430 from jonasschnelli/2017/08/bip151_rekey
[bip151] slightly increase robustness of the re-keying
2 parents 30a0580 + 55163e4 commit 85805be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bip-0151.mediawiki

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Encryption initialization must happen before sending any other messages to the r
3939
The symmetric encryption cipher keys will be calculated with ECDH/HKDF by sharing the pubkeys of a ephemeral key. Once the ECDH secret is calculated on each side, the symmetric encryption cipher keys must be derived with HKDF [2] after the following specification:
4040

4141
1. HKDF extraction
42-
<code>PRK = HKDF_EXTRACT(hash=SHA256, salt="bitcoinechd", ikm=ecdh_secret|cipher-type)</code>.
42+
<code>PRK = HKDF_EXTRACT(hash=SHA256, salt="bitcoinecdh", ikm=ecdh_secret|cipher-type)</code>.
4343

4444
2. Derive Key1
4545
<code>K_1 = HKDF_EXPAND(prk=PRK, hash=SHA256, info="BitcoinK1", L=32)</code>
@@ -148,7 +148,7 @@ If more data is present, another message must be deserialized. There is no expli
148148

149149
A responding peer can inform the requesting peer over a re-keying with a <code>encack</code> message containing 33byte of zeros to indicate that all encrypted message following after this <code>encack</code> message will be encrypted with ''the next symmetric cipher key''.
150150

151-
The new symmetric cipher key will be calculated by <code>SHA256(SHA256(old_symetric_cipher_key))</code>.
151+
The new symmetric cipher key will be calculated by <code>SHA256(SHA256(session_id || old_symmetric_cipher_key))</code>.
152152

153153
Re-Keying interval is a peer policy with a minimum timespan of 10 seconds.
154154

0 commit comments

Comments
 (0)