openssl / openssl

TLS/SSL and crypto library
https://www.openssl.org
Apache License 2.0
24.98k stars 9.95k forks source link

why we use srtp for video? why not the defualt funtion in openssl? #19061

Open fengmao31 opened 1 year ago

fengmao31 commented 1 year ago

I start to make a rtsp tcp project. I find webrtc project use libsrtp to encrypt data. but some rtsp with ssl use the default function SSL_Write and SSL_Read to encrypt data. openssl default encryption is 3DE CBC. Also, in the websockets hv project also only use openssl default encryption. I only know default 3DE is weaker than AES in libsrtp.

t8m commented 1 year ago

openssl default encryption is 3DE CBC

What is the OpenSSL version you use? Also where do you see this default? OpenSSL does not use 3DES by default.

fengmao31 commented 1 year ago

sorry, I make the mistake. I get the answer from the Q&A website. Now, I find the TLS process will auto choose the cipher from ciper list. The result from the wireshark show it use TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384.

I test this and lisrtp. The cipher is 9-100us in encryption and socket sent process, 45-500us in decryption and socket recive process. It is hard to cut down two process to test because it looks like some data in Bio is too long and it need more than one packages to send. The lisrtp need 80us to encryption and 100us to decryption. maybe the variance in time because the repeat list check and HMAC function.

By the way, I think the two function is useless because TLS make sure no Man-in-the-Middle Attack.

image

fengmao31 commented 1 year ago

I test the openssl TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 speed again. The client encryption speed is 19-79us. The server decryption speed is 20-48us .The client decryption speed is 19-76us. Most data is between 20-30us.

mattcaswell commented 1 year ago

It is not clear to me what you are asking us with this issue.

fengmao31 commented 1 year ago

It is not clear to me what you are asking us with this issue.

I need to make the encryption module for a remote video system. and I find some project like webrtc use lisrtp, some use openssl function. I want to know which it better for me. what is the different between the two libs.

nhorman commented 1 month ago

marking as inactive, will be closed at the end of the 3.4 dev cycle barring further input