-
Notifications
You must be signed in to change notification settings - Fork 856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved AES GCM encryption, changed IV length to 12 bytes. #2962
Merged
maxsharabayko
merged 7 commits into
Haivision:master
from
maxsharabayko:develop/improve-aes-gcm-iv
Jul 30, 2024
Merged
Improved AES GCM encryption, changed IV length to 12 bytes. #2962
maxsharabayko
merged 7 commits into
Haivision:master
from
maxsharabayko:develop/improve-aes-gcm-iv
Jul 30, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
maxsharabayko
added
Type: Maintenance
Work required to maintain or clean up the code
[core]
Area: Changes in SRT library core
labels
Jun 20, 2024
maxsharabayko
force-pushed
the
develop/improve-aes-gcm-iv
branch
from
June 20, 2024 11:19
631e98a
to
9ab6a5d
Compare
TO FIX
(SRT v1.5.3)
srt-xtransmit generate "srt://127.0.0.1:4200?passphrase=abcdefghijk&cryptomode=2" --sendrate 1Mbps --duration 5s -v
(SRT PR 2962)
srt-xtransmit receive "srt://:4200?passphrase=abcdefghijk&cryptomode=2" -v |
Testing ResultsSingle Socket ConnectionCaller/listener combination of tests has the following pattern: (receiver)
srt-xtransmit receive "srt://ip:port?cryptomode=2&passphrase=abcdefghijk" --enable-metrics -v
(sender)
srt-xtransmit generate "srt://ip:port?cryptomode=2&passphrase=abcdefghijk" --sendrate 10Mbps --duration 10s --enable-metrics -v where Rendezvous combination of tests has the following pattern: (receiver)
srt-xtransmit receive "srt://ip:port?mode=rendezvous&bind=:localport&cryptomode=2&passphrase=abcdefghijk" --enable-metrics -v
(sender)
srt-xtransmit generate "srt://ip:port?mode=rendezvous&bind=:localport&cryptomode=2&passphrase=abcdefghijk" --sendrate 10Mbps --duration 10s --enable-metrics -v v1.5.4 to v1.5.3
v1.5.4 to v1.5.4
Group Connectionsrt-xtransmit generate "srt://ip:port?passphrase=abcdefghijk&cryptomode=2&grouptype=broadcast" -v --enable-metrics --sendrate 1Mbps --duration 5s
srt-xtransmit.exe receive "srt://ip:port?passphrase=abcdefghijk&cryptomode=2&groupconnect=1" -v --enable-metrics
|
Are you able to document this change in the RFC please? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[core]
Area: Changes in SRT library core
Type: Maintenance
Work required to maintain or clean up the code
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
TODO
AES-CTR Initialisation Vector (IV)
The Initialisation Vector (IV) for the AES-CTR encryption mode is derived by exclusive ORing the first 112 bits of the Salt provided in the Keying Material with the packet sequence number (PktSeqNo) in the SRT header, and left-shifting the resulting value by 16 bits:
Thus the counter (keystream) used by the AES engine is the 128-bit value obtained by concatenating the IV with the block counter ("ctr"):
To avoid using the same keystream twice the payload size MUST be less than 2^16 blocks of 128 bits.
AES-GCM Initialisation Vector (IV)
Starting from v1.5.4.
The Initialisation Vector (IV) for the AES-GCM encryption mode is derived by exclusive ORing the first 96 bits of the Salt provided in the Keying Material with the packet sequence number (PktSeqNo) in the SRT header:
Each outbound packet uses a 12-octet IV and an encryption key to form two outputs (RFC-7714):
With an IV taking 96 bits, there are always
128-96=32
bits for the block counter until it wraps around.