authentication password for smart home users - SIM900, Arduino UNO

hey guys

I have a project that controls a home appliances like lights and doors by sending SMS. The project is almost done, I can control the applications of the house.

The problem is in the authentication. I need to create a code that tells the user to enter a password then the project can accept the commands.

I couldn’t achieve that and I’m not that good in programming. I’m using the SIM900 and Arduino UNO and a Relay shield. The following code is just sample of how the project works.

also, is it possible to accept a call or an SMS just from one number and block any other numbers?

please I really need a help on that.

#include <SoftwareSerial.h>
SoftwareSerial SIM900(7, 8);

#define RELAY1 4
char inchar=0;

void setup()
{
Serial.begin(19200); // for serial monitor
SIM900.begin(19200); // for GSM shield
SIM900power(); // turn on shield
Serial.println(“Turned ON”);
delay(20000); // give time to log on to network.

pinMode(RELAY1, OUTPUT);

SIM900.print(“AT+CMGF=1\r”);
delay(100);
SIM900.print(“AT+CNMI=2,2,0,0,0\r”);

delay(100);
Serial.println(“Ready!!”);
}

void SIM900power()

{
digitalWrite(9, HIGH);
delay(1000);
digitalWrite(9, LOW);
delay(7000);
}

void loop()
{

if(SIM900.available() >0)
{
inchar=SIM900.read(); //Get the character from the cellular serial port.

if (inchar==‘1’)
{
digitalWrite(RELAY1,HIGH);

SIM900.println(“AT+CMGD=1,4”); // delete all SMS

}
}
}