🔐 Introduction

This report compares CRYSTALS-Kyber and ECC encryption algorithms across four critical performance metrics for Vehicle-to-Everything (V2X) communication in autonomous vehicles.


📥 Step 1: Load and View Dataset

V2X <- read_csv("V2X.csv")
## Rows: 500 Columns: 6
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): Encryption_Type
## dbl (5): Message_ID, Latency_ms, Packet_Delivery_Ratio, Bandwidth_Overhead_P...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
str(V2X)
## spc_tbl_ [500 × 6] (S3: spec_tbl_df/tbl_df/tbl/data.frame)
##  $ Message_ID                : num [1:500] 1 2 3 4 5 6 7 8 9 10 ...
##  $ Encryption_Type           : chr [1:500] "ECC" "CRYSTALS-Kyber" "ECC" "ECC" ...
##  $ Latency_ms                : num [1:500] 112.3 87.3 118.3 137.8 128.2 ...
##  $ Packet_Delivery_Ratio     : num [1:500] 94.1 95.3 90.9 95.5 88.8 ...
##  $ Bandwidth_Overhead_Percent: num [1:500] 19.1 18.1 18.2 15.3 16.8 ...
##  $ Energy_Consumption_Joules : num [1:500] 2.28 2.42 2.38 2.06 2.46 ...
##  - attr(*, "spec")=
##   .. cols(
##   ..   Message_ID = col_double(),
##   ..   Encryption_Type = col_character(),
##   ..   Latency_ms = col_double(),
##   ..   Packet_Delivery_Ratio = col_double(),
##   ..   Bandwidth_Overhead_Percent = col_double(),
##   ..   Energy_Consumption_Joules = col_double()
##   .. )
##  - attr(*, "problems")=<externalptr>
# Load necessary packages
library(dplyr)
library(knitr)
library(kableExtra)

# Organize summary statistics
summary_stats <- data.frame(
  Metric = c("Latency (ms)", "Packet Delivery Ratio (%)", 
             "Bandwidth Overhead (%)", "Energy Consumption (Joules)"),
  Min = c(min(V2X$Latency_ms), 
          min(V2X$Packet_Delivery_Ratio), 
          min(V2X$Bandwidth_Overhead_Percent), 
          min(V2X$Energy_Consumption_Joules)),
  Q1 = c(quantile(V2X$Latency_ms, 0.25), 
         quantile(V2X$Packet_Delivery_Ratio, 0.25), 
         quantile(V2X$Bandwidth_Overhead_Percent, 0.25), 
         quantile(V2X$Energy_Consumption_Joules, 0.25)),
  Median = c(median(V2X$Latency_ms), 
             median(V2X$Packet_Delivery_Ratio), 
             median(V2X$Bandwidth_Overhead_Percent), 
             median(V2X$Energy_Consumption_Joules)),
  Mean = c(mean(V2X$Latency_ms), 
           mean(V2X$Packet_Delivery_Ratio), 
           mean(V2X$Bandwidth_Overhead_Percent), 
           mean(V2X$Energy_Consumption_Joules)),
  Q3 = c(quantile(V2X$Latency_ms, 0.75), 
         quantile(V2X$Packet_Delivery_Ratio, 0.75), 
         quantile(V2X$Bandwidth_Overhead_Percent, 0.75), 
         quantile(V2X$Energy_Consumption_Joules, 0.75)),
  Max = c(max(V2X$Latency_ms), 
          max(V2X$Packet_Delivery_Ratio), 
          max(V2X$Bandwidth_Overhead_Percent), 
          max(V2X$Energy_Consumption_Joules))
)

# Display it in a beautiful table
summary_stats %>%
  kbl(caption = "Descriptive Statistics for V2X Dataset") %>%
  kable_styling(full_width = FALSE, html_font = "Cambria")
Descriptive Statistics for V2X Dataset
Metric Min Q1 Median Mean Q3 Max
Latency (ms) 70.235453 105.962971 116.600712 117.218782 128.404595 182.790972
Packet Delivery Ratio (%) 83.311234 90.973589 93.422873 93.349843 95.478481 101.365900
Bandwidth Overhead (%) 12.157299 17.601664 18.946082 19.153582 20.777972 26.386215
Energy Consumption (Joules) 1.294146 2.145159 2.355709 2.352447 2.558356 3.327898

📊 Step 2: Summary Statistics by Encryption Type

summary_table <- V2X %>%
  group_by(Encryption_Type) %>%
  summarise(
    Mean_Latency = round(mean(Latency_ms), 2),
    SD_Latency = round(sd(Latency_ms), 2),
    Mean_PDR = round(mean(Packet_Delivery_Ratio), 2),
    SD_PDR = round(sd(Packet_Delivery_Ratio), 2),
    Mean_Bandwidth = round(mean(Bandwidth_Overhead_Percent), 2),
    SD_Bandwidth = round(sd(Bandwidth_Overhead_Percent), 2),
    Mean_Energy = round(mean(Energy_Consumption_Joules), 2),
    SD_Energy = round(sd(Energy_Consumption_Joules), 2)
  )

summary_table %>%
  kbl(caption = "Grouped Summary Statistics: Kyber vs ECC") %>%
  kable_classic(full_width = FALSE, html_font = "Cambria")
Grouped Summary Statistics: Kyber vs ECC
Encryption_Type Mean_Latency SD_Latency Mean_PDR SD_PDR Mean_Bandwidth SD_Bandwidth Mean_Energy SD_Energy
CRYSTALS-Kyber 109.83 15.02 94.36 3.00 20.26 2.06 2.5 0.28
ECC 124.97 15.26 92.29 2.93 17.99 1.93 2.2 0.30

📈 Step 3: Boxplot Comparisons

⏱️ Latency Comparison

ggplot(V2X, aes(x = Encryption_Type, y = Latency_ms, fill = Encryption_Type)) +
  geom_boxplot() +
  labs(title = "Latency Comparison", y = "Latency (ms)") +
  theme_minimal()

📦 Packet Delivery Ratio

ggplot(V2X, aes(x = Encryption_Type, y = Packet_Delivery_Ratio, fill = Encryption_Type)) +
  geom_boxplot() +
  labs(title = "Packet Delivery Ratio", y = "PDR (%)") +
  theme_minimal()

📶 Bandwidth Overhead

ggplot(V2X, aes(x = Encryption_Type, y = Bandwidth_Overhead_Percent, fill = Encryption_Type)) +
  geom_boxplot() +
  labs(title = "Bandwidth Overhead", y = "Overhead (%)") +
  theme_minimal()

⚡ Energy Consumption

ggplot(V2X, aes(x = Encryption_Type, y = Energy_Consumption_Joules, fill = Encryption_Type)) +
  geom_boxplot() +
  labs(title = "Energy Consumption", y = "Energy (Joules)") +
  theme_minimal()


📌 Key Findings

  • Kyber shows significantly lower latency and higher packet delivery reliability.
  • Slight increase in bandwidth and energy use, but within acceptable range.
  • Results support the hypothesis that Kyber is more suitable for quantum-resilient AV communications.

📄 Conclusion

CRYSTALS-Kyber encryption demonstrates superior performance in metrics essential for real-time V2X communication, making it a strong candidate for future-ready autonomous vehicle infrastructure in Australia.