How to add encrption ECC to arduino code

I have a code of the smoke detector project that I need to add security to it. Any idea of how to write it using ECC or any other encryption techniques?
int redLed = 12;
int greenLed = 11;
int buzzer = 10;
int smokeA0 = A5;
int sensorThres = 400;

void setup() {
pinMode(redLed, OUTPUT);
pinMode(greenLed, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(smokeA0, INPUT);
Serial.begin(9600);
}

void loop() {
int analogSensor = analogRead(smokeA0);

Serial.print("Pin A0: ");
Serial.println(analogSensor);
if (analogSensor > sensorThres)
{
digitalWrite(redLed, HIGH);
digitalWrite(greenLed, LOW);
tone(buzzer, 1000, 200);
}
else
{
digitalWrite(redLed, LOW);
digitalWrite(greenLed, HIGH);
noTone(buzzer);
}
delay(100);
}
int redLed = 12;
int greenLed = 11;
int buzzer = 10;
int smokeA0 = A5;
int sensorThres = 400;

void setup() {
pinMode(redLed, OUTPUT);
pinMode(greenLed, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(smokeA0, INPUT);
Serial.begin(9600);
}

void loop() {
int analogSensor = analogRead(smokeA0);

Serial.print("Pin A0: ");
Serial.println(analogSensor);
if (analogSensor > sensorThres)
{
digitalWrite(redLed, HIGH);
digitalWrite(greenLed, LOW);
tone(buzzer, 1000, 200);
}
else
{
digitalWrite(redLed, LOW);
digitalWrite(greenLed, HIGH);
noTone(buzzer);
}
delay(100);
}

What exactly do you want to encrypt? Also please edit your post and put the code inside code tags.

"ECC" usually stands for Error Correcting Code, an aspect of data packet transmission protocols, which acts to reduce transmission errors. There are many different ECC approaches, which differ in how many single bit errors can be corrected or detected.

Encryption is separate and there are several Arduino libraries, covering most of the popular methods.

Most people use both for reliable encrypted data transmission.

ECC in crypto refers to elliptic-curve cryptography.

Yes!

The OP could use ECC to detect and possibly correct bit errors, and ECC to encrypt the data, possibly doing this work at ECC (El Camino College), using ECC (International) as engineering consultants.

Payments could be made using ECC (Network), or ECC (Eagle Point Credit Company).

Use Tools->Manage Libraries... in the IDE to search for the library named "Crypto" (a.k.a Arduino Cryptography Library). The documentation is here:
https://rweather.github.io/arduinolibs/crypto.html