Showing posts with label Online_Computer. Show all posts
Showing posts with label Online_Computer. Show all posts

PowerPoint Presentation : Design a Chart

In the previous post we discussed as how to draw a table in PowerPoint Presentation. Similarly, presentation software enables the user to insert charts in  slides to present statistical table data in a pictorial representation. This ensures that the audience can grasp complex data at a glance. In this exercise you will learn to work with charts. Open a new file using presentation software. To insert a chart in the slide, click on Chart option under Illustrations group in the Insert tab. A dialog box appears as shown below.
You will notice different type of the charts that can be used in the presentation.
       Select a chart type and click OK. A default chart will be inserted on the slide. The default data  table  for  that  chart  will  be  opened  in  a  spreadsheet  application separately as shown below.
You  can  edit  the  values  in  the  spreadsheet  and  the  presentation  software  will automatically update the chart.  Now enter the following in the spreadsheet window:










     Once you have modified the data table in the spreadsheet the chart in the slide gets modified automatically and the chart will displayed similar to the one below.
Now change the values in the spreadsheet and observe the changes in the chart. You can change the colors and effects of the chart by using Chart Styles available under Design tab. To change to a different style, select a style from Chart Styles and double-click on it.
Some basic guidelines are as follows:
  • Convey one message per chart. Make the message the heading.
  • Make the chart easy to read. Label the X and Y axis and label the lines, bars, or pie wedges. Make  the most important  text  largest,  the most important data  lines or sections darkest. 
  • Make bars and columns wider than the spaces between them.
  • Be accurate. Always start a numerical axis at zero. Compare only like variables.
  • Eliminate all unnecessary details. Avoid grid  lines, data points, boxes, etc. unless they relate to the message. 
  • Use a few (maximum four) colors per visual.
Importing a chart 
You can also import a chart from a spreadsheet. The method is the same as importing a table into presentation software. Since the entire sheet is imported, you may need to maneuver around and display the chart in the embedded object. To increase/decrease the size of the object, you can double click on it and resize it.

Share:

PowerPoint Presentation : Design a Table


Presentation software enables the user to add tables in the slides in order to represent the statistical data meaningfully. In this post you will learn to work with tables.
   Open a new file using presentation software. You can insert a table in two ways:
  • Using Insert tab 
  • Using Title and Content Option 
Click on Table option under Tables group in  the Insert  tab, a drop down appears as shown below :
You can have learnt to create tables in a word processor by dragging the mouse over requisite number of boxes. Follow the same method here and create the table shown below. Now go ahead and try the Insert Table… and Draw Table options to create the table.
Using Title and Content Option 
Open  a  new  file  using  presentation  software  and  change  the  layout  of  the  slide. To
change the layout of a slide do the following:
Click on Layout option available under Slides group in the Home tab, as you did while selecting a movie clip. Click on Title and Content option from the dropdown list. You  can insert the table in the slide by clicking the
 icon available within the layout. Once you click the icon, a dialog appears as shown below :
Now enter the values for the number of columns and rows that you would like to have in  the  table. For example,  if you need a  table with  3 columns and 3  rows,  type 3  in both Number of columns and Number of rows fields. Once you have inserted the table into the slide, additional tabs - Design and Layout - are made available. You can use them for editing and formatting the table further.


    You can change the design of the table by changing background, borders or effects by using Table Styles group in the Design tab. To use a particular design, Select a design under Table Styles group and double-click on it. If you would like to change a design, choose a different design under Table Styles group and double-click on the new design. You have learnt to create a table in a presentation, but if the table already exists in a word processor document or a spreadsheet, you can directly import it from there. To do so:
    With a slide in edit mode, choose Object from the Insert menu.
  • In  the Insert  Object dialog  box, click  the  Create  From  File  option  and  click  Browse to locate and choose the document or spreadsheet that contains the table. By default, the presentation software will insert the table.  
  • When you click OK, the entire document or spreadsheet is imported to your slide. Double-click the inserted text to remove extra text if the document contains more than the table. 
  • If you check the Link checkbox while inserting. On doing so, after you update the table in the document or spreadsheet, then right click on the imported table in the presentation  software,  and  select  the  option  Update Link, the embedded  table gets updated automatically. 
  • Drag and drop the table on the slide to position it.
Similarly we can draw a graphical form of the table obtained as well.

Share:

PowerPoint Presentation : Inserting an Audio Clip

In our previous blog we have shown you how to insert an movie clip to a powerpoint presentation. You can  include audio clips  to a presentation  similar to that of videos. For example,  you can play mild background music while making your presentation.  In this post you will learn how to insert an audio clip in slides. Open a new file using presentation software. Click on Sound option under Media clips group in the Insert tab, a drop down appears as shown below:
 
You  can  select  the  Sound  from File…  option  to  insert  the  sound  clip.  A  dialog  box  appears as shown below. 
You can  locate  the audio clip and click OK  to  insert  the  same  in  the  slide. You may  follow the same steps as you learnt while inserting a Movie Clip. There is an inbuilt clip  organizer  for  a  list  of  sounds.  You  can  access  them  via  the  Sound  from  Clip Organizer… option. Go ahead and insert an audio clip using this option.When you have completed inserting the sound clip, and you play the slideshow, the audio clip will be played automatically. 

Share:

PowerPoint Presentation : Inserting a Movie Clip

Presentation allows the user to add movie clips to  the presentation in order to make  the  presentation colourful and meaningful. You can sum-up any of your views using a power point presentation saved with an extension of .ppt. In the same way you can  insert movies or YouTube videos  downloaded from the Internet.  In  this  post  you will  learn  how  to  insert  a movie  clip  in  slides.  Open  a  new  file  using presentation software.


 You can insert a movie in two ways:
  • Using Insert tab 
  • Using Title and Content Layout Option
Click on Movie option under Media clips group in the Insert tab, a drop down appears  as shown below.
 
You  can  select  the Movie  from  File…  option  to  insert  the movie  clip  that  you  have  already downloaded from the Internet. A dialog box appears as shown below: 

You  can  locate  the  movie  clip  and  click  OK  to  insert  the  same  in  the  slide.  The  presentation will be displayed as shown below.
You  can  set  one  of  the  two  options  available  for  playing  the  media  clip,  i.e  Automatically or When Clicked. 
     Alternatively, you can select Movie from Clip Organizer… option to insert the movie clips that are available under Clip Organizer. Doing so displays the clip art task pane as shown below:

You can select any of  the movies available and  insert  it  in  the  slide. Once you have  inserted the movie clip in the slide, the presentation will be displayed as shown below.
Using Layout Option 

Open a new file using presentation software and change the layout of the slide. 
     Click on Layout option available under Slides group in the Home tab, a dropdown list  appears as shown below. 
 
Click  on  Title  and  Content  option  and  a  slide will  be  displayed with  the  layout  as  shown below. 
You can insert a movie in the slide by clicking the        icon in the Layout option. Once you click the icon, a dialog appears as shown below.

When you play the slideshow, the movie clip will be played automatically.
So guys this was all a short attempt, in case of any sorts of queries please don't hesitate to comment us. In the same way you can also insert an audio clip in an powerpoint presentation as shown in our next post.

Share:

Database Development : Create and Manage Queries

Having created the tables and entering data into them, now you want to extract some information. That’s when you query the database. As the name suggests, query is to collect specific information from the pool of data. A query helps us join information from different tables and filter that information. Filtering means that the query uses criteria you provide it to hide some data and present only what you want to see. Some RDBMS provide a graphical means to create queries, but most RDBMS do not do so. That’s where you use SQL (pronounced as “sequel”) or Structured Query Language. Query languages are computer languages used to make queries into databases and information systems. Queries are commands that are used to define the data structure and also to manipulate the data in the database.
         A SELECT statement retrieves zero or more rows from one or more database tables or database views. In most applications, SELECT is the most commonly used Data Manipulation Language (DML) command.
         The SELECT statement has many optional clauses:
  • WHERE specifies which rows to retrieve.
  • ORDER BY specifies an order in which to return the rows.
To retrieve all the columns in a table the syntax is:SELECT * FROM TABLENAME;
In order to execute queries click on the Queries option available on the left side under
database section, click Create Query in SQL View as shown below.
  

A window appears similar to the one displayed below.
 
You can type the query in the above window and execute it by using the F5 function key or by clicking the 

icon in the window.
For example, if you want to display all the data in the table that you created in the early session, then the select statement will be: select * from SDetails;
After executing the select query the output will be shown similar to the one displayed below. 
 
To get details about the list of students whose favorite color is blue, you can use:
select * from SDetails where Color='Blue'.
After executing the select query the output will be shown similar to the one displayed below. 
 


To view records in ascending order of RollNo, from the table the select statement will be:
select * from "SDetails" order by "Rollno" ASC;

You can add, modify or delete records using the Insert, Update and Delete commands. 
To type and execute SQL commands, click on Tools > SQL. A window similar to the one below will be displayed.
 
You can type the SQL Commands in the Command to execute space and click on Execute.

INSERT statement

INSERT statement is used to add one or more records to a database. The general syntax of the insert statement is shown below. 
INSERT INTO table (column1, column2, column3 ...) VALUES (value1, value2, value3 ...)
To add a record in the database created earlier, type the following and click Execute.
insert into "SDetails" ("ID", "Name", "Rollno", "DOB", "Class" , "Phone", "Email", "Color", "Location") values ('8', ' Ranjith Singh',' 67' , '12-03-99','X' , '435363' , ' ranjth99@gmail.com' , 'White', 'Bihar');
After inserting the data into the table, use select query to view the updated table. After execution you should see a window similar to the one displayed below.
 

UPDATE statement

Update statement is used for modifying records in a database. The general syntax of the update statement is as follows: 
UPDATE table_name SET column_name = value [, column_name = value ...] [WHERE condition]
To update a record using update statement, type the following and click Execute.
update "SDetails” set "Location"='Bhubaneswar' where "Rollno"=14;
Execute select query to view the updated table. After execution you should see a window similar to the one displayed below.


DELETE statement

Delete Statement is used to remove one or more records in a database. The general syntax of the delete statement is as follows:
DELETE FROM “table_name” [WHERE] condition;
To delete one of the records in the table created earlier using delete statement, type the
following and click Execute:
delete from "SDetails" where ID=8;
Execute select query to view the updated table. After execution you should see a window similar to the one displayed below. 
 Notice the record with the Roll No 8 is deleted from the database.

CREATE Statement

Create statement is used for creating a database or a table in any RDBMS Software. A commonly used CREATE command is the CREATE TABLE command. The general syntax of the create statement is shown below.
CREATE TABLE TABLENAME ([column definitions]) [table parameters]
Column definitions: A comma-separated list consisting of any of the following
Column definition: [column name] [data type] {NULL | NOT NULL} {column options}
Primary key definition: PRIMARY KEY ([comma separated column list])
For example, if you would like to create a table using the Create statement, type the
following and click Execute.
CREATE TABLE "Employee" ("ID" INTEGER," Name "VARCHAR (50),
"Department" VARCHAR (50),
"Address" VARCHAR (120),
"Contact Number" INTEGER);
Now create 5 records in the table and use the SQL statements to view, modify and delete them.


Share:

Database Development : Database System

A database is an organized collection of data. You can visualize it as a container of information. The data is typically organized to model relevant aspects of reality (for example, the availability of rooms in hotels), in a way that supports processes requiring this information (for example, finding a hotel with vacancies). Suppose if you own a stationary shop, you need to keep detailed records of the materials available in your shop. You also need to store information about pricing, stock levels for reordering, old stocks, etc. While in the manual system, you would maintain several files with different bits of information; in the computerized system you would use database programs such as Microsoft Access, OpenOffice.org Base, and MySQL, to organize the data as per your business need. The database concept has evolved since the 1960s to ease increasing difficulties in designing, building, and maintaining complex information systems (typically with many concurrent end-users, and with a large amount of diverse data). In this lesson, you will learn database concepts and to work with a Database Management System (DBMS).

Database Management System

A database management system is a software package with computer programs that controls the creation, maintenance, and use of a database. It allows organizations to conveniently develop databases for various applications. A database is an integrated collection of data records, files, and other objects. A DBMS allows different user application programs to concurrently access the same database. Well known DBMSs include Oracle, IBM DB2, Microsoft SQL Server, Microsoft Access,
PostgreSQL, MySQL, FoxPro, and SQLite. Data can be organized into two types:
  • Flat File: Data is stored in a single table. Usually suitable for less amount of data.
  • Relational: Data is stored in multiple tables and the tables are linked using a common field. Relational is suitable for medium to large amount of data.

Database Servers

Database servers are dedicated computers that hold the actual databases and run only the DBMS and related software. Typically databases available on the database servers are accessed through command line or graphic user interface tools referred to as Frontends; database servers are referred to as Back-ends. Such type of data access is referred to as a client-server model.

RDBMS

A relational database management system (RDBMS) is a database management system that is based on the relational model as introduced by E. F. Codd, of IBM's San Jose Research Laboratory. Most popular databases currently in use are based on the relational database model.
      The relational model for database management is a database model based on first-order predicate logic, first formulated and proposed in 1969 by Edgar F. Codd. In the relational model of a database, all data is represented in terms of tuples, grouped into relations. A database organized in terms of the relational model is a relational database. The purpose of the relational model is to provide a declarative method for specifying data and queries: users directly state what information the database contains and what information they want from it, and let the database management system software take care of describing data structures for storing the data and retrieval procedures for answering queries.

Database Concepts

Database contains objects that are used for storing and managing information. To understand a database in very simple language, let’s look at the example of your address book. What do you store in an address book? You may have people’s name, people’s address, people’s phone number and maybe even people’s birthdays. There is a common element here – people. In this example, each person is considered an “item”. So, an item is what the database is storing information about. When you were recording information in your address book, what did you ask the people? What is your address? What is your phone number? etc. Each question that we ask about our item is a “field”. Now, say you make new friends and want to add their information to your address book. You will ask questions, get the answers and create a new “record”. So a record is a set of information (made up of fields) stored in your database about one of the items. A “value” is the actual text or numerical amount or date that you put in while adding information to your database. When you put all the information together in a grid (like you do in a spreadsheet), a collection of similar records creates a table. A database can have one or many tables. An address book example is a very simple one, in real life there are many more details involved. A big company would have in its database, one table for its products, one table for its suppliers, one table for its customer details, one for orders received and maybe many others. Basically each table in a database contains information about one type of item. So a database is basically a container that holds tables and other objects and manages how they can be used.
    Another very important thing to remember is that when we put in information, we may have people with the same name (there can be more than one Charu Arora) or the same address (members of a family). But when creating a database an important feature is record uniqueness in every table. It is important to be able to distinguish between different items having duplicate values. Uniqueness helps to avoid accidental duplication of records caused by user or computer error. This can be achieved by using some number or value that uniquely identifies a record. If such a unique value does not exist in your fields, as the database designer, you can create a special additional field in a table where unique numbers or values can be assigned for each new entry. Therefore, every table has a key field which ensures that there are 100% unique values throughout the database. Every database table should have one or more fields designated as key. You can assign a unique value to this key for differentiating records that may have similar names or address. Look at the following example of student database:

In this table, it will be extremely difficult to differentiate between student records as they have names that are similar. To differentiate, you can add additional field - roll number - that will be unique for each record (example below).


Share:

Object and Classes in Java : Basics and Syntax

As mentioned in the topic today we are going to learn about classes and its object. It will include definition of classes how it is declared how and why they are utilized. In Java the OOP concept includes a part called classes a vital part of java as well making the program much more faster to compile. A very basic thing to be noted objects are logical as well as physical entity whereas classes are logical entity.

Objects

Since childhood we know that objects are those entities that has state and a particular behavior for example books, computer, etc; This was an example from our day to day life. As mentioned above its can be logical or physical, i.e; tangible and intangible. We can distinguish an object with three characteristics:
  • State: Represents data of the object.
  • Behavior: Represents functionality of the class
  • Identity: Every object is identified by an unique identity but the difference is that the value is hidden in case of computers.
Now relating both classes and objects. Classes are blueprints for which objects are created. Hence, objects are instances of objects defined.

Classes

A class is a collection of objects with similar properties. In a class we can define multiple data under one name. It is a template for which an object is defined. It is a logical quantity and can never be physical.

Syntax

class class_name{
   data_to_be stored;
   variables;
   functions;
}

Instance Variable

Variables defined inside the class but outside the method are instance variables. Memory allocation to these variable are not in the compiling time but in the run-time. This is the reason relating the English language it was named as instance variable. Because its declaration is at the run-time.

"new" keyword

This keyword is used to allocate data in the runtime.


Objects and Classes in Main function

There is a simple program following containing  a class named student with data members as ID and Name. This program is to simply display the data calls the class using an object in the main function. this class definition is for the public java class. So, here we go:
class Student{       //file name is student
            int id;
            string name;

public static void main(String[] args){
       Student s1= new Student();  //this creates object for the class
       System.out.println(s1.id);  //displays ID part of the class
       System.out.println(s1.name);  //displays Name part of the class 
    } 
}
Now we shall do the same program but without using the public class that is a different class. This class can be defined within the main class as well as outside the main class. So, here we go:
class Stud{
        int id;
        string name;
}
public class Student{
 public static void main(String[] args){
   Stud s1=new Stud();
   System.out.println(s1.id);
   System.out.println(s1.name);
   }
}
we can declare the objects of class in two ways one is directly by programmer while defining the variables and the other way is by user through scanner class. Assuming all definitions are correctly done here comes a short definition  of class:
class Student{
  int a;
  void accept{
   scanner  sc=new Scanner(System.in);
   a=sc.nextInt();
  }
}
In the main function we call the data of class through an object. So to store more than one set of values we can define more number of classes in the main function. Like for the above class the main program can be as follows:
public static void main(String[] args)
{
    scanner sc=new scanner(System.in);
    Student s1=new Student();  //Object 1
    Student s2=new Student();  //Object 2  
    s1.a=nextInt();   //statement 1
    s2.a=nextInt();   //statement 2
}
Here statement 1 as well as 2 both are valid. Since s1 and s2 are two different objects so two different set of values are stored in it. There are loads of things in classes shall be continued in our other posts.

Share:

Introduction to an Automatic Dependent Surveillance Broadcast(ADS-B) Intrusion Detection System




ADS-B has emerged in recent years as a viable alternative to current radio and RADAR standards in Aircraft signaling. Its advantages include superior location accuracy due to the use of Global Position System (GPS), ease of deploying and maintaining ADS-B stations compared to traditional RADAR
stations, and lower purchasing costs. Software-defined radio (SDR) is a technology that migrates hardware components to software, which enables developers to customize the desired functionality a radio should have. This technology has been applied to various fields and its use in air traffic control (ATC) research is causing the emergence of new promising protocols, including in ADS-B applications. Piracci et al. [21] describe the technical and hardware challenges to build an SDR device dedicated to ADS-B. However, these benefits did not eliminate ADS-B’s vulnerabilities related to its open clear-text broadcasting of messages. Several research efforts [1], [3], [18] demonstrated in a controlled and simulated environment that it is possible to launch attacks on ADS-B. These efforts were focused in demonstrating the vulnerabilities, and did not provide a systemic approach to detecting the attacks and focused instead on specific types of attacks. Few researchers aimed at proposing a comprehensive approach to thwart ADS-B attacks from a cyber-security view, such as in [4] and in [17]. Unfortunately, as we discuss below, neither approach is currently implementable. In previous work [6], [8], [9], we proposed different variants of a cyber-security module that verifies the authenticity and integrity of transmitted ADS-B messages. The module thwarts several message-injection attacks by using keyed-hash message authentication code (HMAC). The difference between the versions is the way the HMAC digest is generated and used to create the security metadata in place of the Cyclic Redundancy Check (CRC) field. The latter is used for biterror verification and can be easily broken. Also, in [7], we proposed a mechanism to securely exchange the keys used for the HMAC algorithm. We leveraged the fact that aircraft need to obtain authorizations from the entities governing the ATC zones included in its flight path before taking off. We made a simplifying assumption that these entities are referred to as the ATC centers. Then, we delegate the key negotiation to source ATC center, which initiates secure handshakes with the ATCs that control other zones in the flight path to exchange the secret keys over public key infrastructure (PKI) schemes. In this paper, we propose an Intrusion Detection System (IDS) for ADS-B signals by combining above described previous work with new techniques acting both at the ADS-B sender and receiver in order to strengthen the attack detection. This is achieved by assessing the cyber-physical environment of supposedly signaling aircraft. This IDS detects potential attacks and provides as a result artifacts that could be used for digital forensic analyses. The rest of the paper is organized as follows. Section II discusses the related work while section III describes the background information in ADS-B. Section IV describes the details of our proposed intrusion detection system. Section V provides experimental evaluation of our IDS system.


ADS-B BACKGROUND
ADS-B operates in two modes, namely, ADS-B Out and ADS-B In as shown in Figure 1. The former is deployed on aircraft that gets its location from the nearby satellite to make an ADS-B messages, modulate it using Pulse Position Modulation (PPM) before broadcasting it every second in the 1090 MHz band. ADSB-In is mostly deployed on ground components, i.e. ADS-B stations and ATC centers, that receive ADS-B messages from air crafts that are within transmission range, which is in the order of 150 nautical miles [12]. In practice, 1090 Mode S Extended Squitter is an implementation that supports ADS-B, where ADS-B data is encapsulated in Mode S frames as shown in Figure. The preamble is used for synchronization and the DF Format field indicates the protocol being used, where the 17 decimal represents ADSB. The capability bits indicate the sub-protocol in use and the International Civil Aviation Organization (ICAO) identifier uniquely identifies each aircraft. The CRC field is used for bit error verification. The ADS-B data occupies 56 bits of the 112 bits of Modes S frames and provide several information such longitude, latitude, altitude, velocity, etc. Each GPS location is encoded using two ADS-B messages: even and odd. This is due to the use of the Compact Position Reporting (CPR) [2] in order to encode and decode latitude and longitude using an optimal number of bits (17 bit for longitude and 17 bits for latitude, where 23 bits owuld be needed if plain binary encoding is used). The even/odd parity is used to divide the earth in longitudinal and latitudinal lines to determine the exact location. However, due to clear-text ADS-B messages broadcast, it is possible to use cheap hardware and launch ADS-B attacks. It is possible to download an open-source ADS-B receiver and relatively inexpensive radios to at least eavesdrop on air traffic. Besides, if the attacker has the ability to craft ADS-B messages and broadcast them on the 1090 MHz band, this can cause injection attacks that would create more problems.
         We developed an attack taxonomy to study the threat model of ADS-B, where we used two classification criteria: the difficulty of implementation of the attack and the location of the radio used for the attack. Therefore, we concluded that there are three categories:
Medium-level attacks: includes most traditional message injection attacks where the geo-location information used to create the ADS-B message is randomly generated and the radio used for the attack is immobile.
Advanced-level attacks: the geo-location is generated from a flight simulator program which creates realistic trajectories while the radio is also immobile.
Expert-level attacks: with proliferation of manned and unmanned aerial vehicles, the radio used for the attack could be located on an aircraft or drone.

ADS-B IDS FRAMEWORK
A. Overview
An overview of the proposed ADS-B IDS. First, at the sender, the goal is to craft secure ADS-B
messages based on valid location data. Therefore, the aircraft passes the obtained GPS location at time t along with the corresponding predicted one. The latter is obtained from the aircraft prediction module [11] that computes the flight path in term of series of GPS locations every second by leveraging the Base of Aircraft Data (BADA) that defines specific parameters for each aircraft according to its make and model. Then, the security analysis module at the sender compares both location to check if there is an inconsistency, and if the pilot is very far from its supposed flight path it could indicate a GPS spoofing attack. Consequently, the result is the location that would be used to generate and send the secure ADS-B message. At the receiver, the goal is to verify the integrity and
authenticity of the transmitted ADS-B messages, double-check that with data obtained from the physical environment of the aircraft and finally locate the attacker and create a corresponding
entry in the quarantine.
B. Security Analysis Module at the Sender
Once the aircraft obtain its GPS location from nearby satellite, the security analysis module at the sender checks for conformity of the position with regards to the flight path that is generated by the aircraft prediction module [11] before takeoff. This module generates a series of geo-coordinates
for a specific make and model of an aircraft by leveraging parameters from BADA. If the GPS location deviates, at a time t, from the corresponding predicted one beyond a certain threshold, this
indicates that the reported position is not within the aircraft safe zone at time t. In the next subsection, we describe how we defined this safe zone. In this case, there could be a potential GPS spoofing attack or inappropriate maneuver by the pilot.
C. Safe Zone of an Aircraft
This subsection describe the safe zone of an aircraft, that sets the upper and lower bounds for
a reported position in the sender or receiver. We define this safe as a sphere having as diameter the overall length of the aircraft. For a reported position to be valid, its distance from the predicted position at an instant t, is less than or equal to the diameter of the sphere. In order to compute this distance between two points in the geographic coordinate system, we use the Haversine formula stated in Equation 1, where Δ Lat, Δ Lon, Δ Alt correspond, respectively, to the difference between the reported and predicted latitude, longitude and altitude :
Then, if this distance is less to the value of the diameter of the sphere representing the safe zone, then it is a valid position update as the green marker. Otherwise, it is not a valid one such as the red marker. The diameter of the sphere depends on the make and model of the aircraft
and can be gotten from BADA database.

D. Secure ADS-B Message Generator
After the security analysis module checks the validity of the location to be used, the secure message generator encodes it into the two corresponding even and odd ADS-B messages. However, in order to enforce authenticity and integrity of these messages, there is a challenge of fitting the HMAC-based
metadata without changing the packet format or adding extra messages because the smallest size of HMAC is 128 bits which is greater than the whole Mode S frame. Algorithm 2 describes the process of generating secure ADS-B messages from plain ones. In line 1, we present the initial conditions stating that the GPS position to use have already been validated by the security analysis module and
the HMAC key to use in the zone where the aircraft flies is available. In line 2−3, we generate the plain ADS-B messages, i.e. the even and odd ones, to encode a GPS position. In line 4, we run the HMAC algorithm based on the two ADS-B messages in question and the key before splitting the resulting digest in multiple of 8. For example, we split a 128 bit digest into 8 portions and we split a 256 bit digest into 16 portions. Then, in lines 6 − 7, we makes two even-sized sets out
the portions before running several rounds of a chosen bit manipulation algorithm to each set in lines 8−12. The number of rounds is basically half of the set’s size. Then, we delete the previous elements from each set and we replace then by the output of this algorithm for each set after running all the
rounds. In lines 13−14, we generate the metadata for the even and odd messages based on the content of set1 and set2. Each metadata has 8 bits sequence number and 16 bits resulting
from the bit manipulation algorithm. 
E. Secure ADS-B Message Receiver 
Once ADS-B messages are received, they need to be checked for integrity and authenticity before further checks are performed by the security analysis module. Algorithm 3 describes the process of validating incoming messages that are first grouped according to their ICAO identifier then to their sequence number. Thus, we used a doubly nested hashmap to that effect which facilitates the
computation of the HMAC digest. In line 1, of Algorithm 3, several variables are initialized.
Line 2 marks the start of the while loop checking for incoming ADS-B messages. Line 3 extracts the ICAO identifier and the sequence number while lines 4 − 7 checks for existence of the hashmaps and create them accordingly. The first hashmap bucket has as key the ICAO number and the second hashmap sequence as mapped content. This latter has the sequence number as key and a queue containing the ADS-B messages as mapped content. Line 8 enqueues each message in the
corresponding queue’s hashmap. In line 9, we check the size of the queue for a given ICAO
and sequence number. If it is equal to 2, that means we can start verifying the HMAC. Lines 10 − 14 extract parts of the metadata to assemble the HMAC digest while computing the HMAC based on the payloads and the used key. In lines 15−18, we check if the computed versus assembled HMACs
match and we store the result in a binary variable which we pass to the security analysis module, in line 19, along with miscellaneous information about the aircraft and ADS-B messages involved. In lines 20 − 21, we resolve the case where the size of the hashmap is less than 2 meaning that one or both messages are not received. Therefore, in lines 22 − 26, we apply a 30 seconds timeout and if the messages are received we return to line 9 to check the HMAC. Otherwise, we pass the result to the security analysis module that can determine if this is due to transmission power such as weak signal power. This cannot undue the failure to compute the safe zone but can solve this problem with the next transmission by ordering the aircraft to apply some adaptation mechanisms such as increasing its
signal power or avoiding a zone where risk factors affect ADSB transmissions.
F. Security Analysis Module at the Receiver
The objective of this module is to run another check on received messages regardless whether their HMAC verification failed or succeeded. Therefore, it computes the location encoded by the ADS-B messages in question and checks if it is within the safe zone, according to guidelines defined in
subsection IV-C. Algorithm 4 describes the logic of this component. Line 1 defines the initial conditions assuming that most of ADS-B are received and that the flight path is already known. Lines 2−5 extract from the ADS-B message and the BADA database, respectively, the ICAO number, the sequence number, the queue corresponding to an ICAO and a sequence number, and the make and model of the aircraft. Lines 6 − 7 compute the predicted position, at a instant t, based on the flight path of the aircraft in question and the declared position based on decoding the ADS-B messages in question. Line 8 calculates the distance between both positions using the Haversine formula defined in subsection IV-C. Line 9 computes the threshold which determines the final decision if the ADS-B position is really valid or not. This is obtained by extracting the overall length of the aircraft. For a ADS-B position to be valid, its distance from the corresponding one at a time t has to be within the safe zone, i.e. less than the threshold. In lines 10 − 13, explore the cases where the measured distance is less than the threshold. Therefore, we validate he position report. In addition, if the HMAC verification failed, we conclude it is due to risk factors affecting ADS-B broadcast. Therefore, we initiate some adaptation techniques to fix that according to [9]. Conversely, in lines 14−19, we explore the cases where this distance is greater than the threshold. In this case, we confirm the existence of message injection attack. Therefore, we create an entry for the message(s) in question specifying its time of arrival, the type of attack and we leverage multilateration techniques to determine the real location of the attacker. This is done by computing the time difference of arrival from different sensors at the ATC center such as in [10].
G. Quarantine
The quarantine is a database where artifacts, related to attacks or isolated ADS-B messages, are stored. These artifacts can serve as input for digital forensics experts to bridge the gap between ADS-B vulnerabilities and ADS-B attacks. The structure of the quarantine is as follows:
ADS-B Message: the message to be stored in quarantine.
Timestamp: time of arrival of the ADS-B message. 
Type of Attack: specifies the type of suspected attack if applicable.
Sender’s Position: specifies the longitude, latitude and altitude of the attacker if any, which is obtained by leveraging multilateration techniques such as in [10].
Share:

C++ menu driven program to enter, display and see aperticular record based on roll number using files


#include<fstream.h>
#include<conio.h>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
class student
{   private : int rno, percent;
     char name[50];
    public : void accp();
    void disp();
    int getrno()
    {    return rno;
    }
}s1;
void main()
{   clrscr();
    int a;
    fstream f1("student.dat",ios::binary|ios::in|ios::app|ios::out);
    if (!f1)
    {  cout<<"\n could not find";
       getch();
       exit(-1);
    }
    cout<<"\n 1. wants to enter 10 records ";
    cout<<"\n 2. want to display records ";
    cout<<"\n 3. want to see a paticular record based on roll no. ";
    cout<<"\n enter your choice : ";
    cin>>a;
    switch(a)
    {   case 1:   for (int i=0; i<4; i++)
 {   s1.accp();
     f1.write ((char*)&s1,sizeof(s1));
 }
 break;

case 2:  f1.seekg(0);
 while (!f1.eof())
 {     f1.read ((char*)&s1,sizeof(s1));
s1.disp();
 }
 break;

case 3:   int rn, b, x=0;
 cout<<"\n roll number to be found : ";
 cin>>rn;
 f1.seekg(0);
 while (!f1.eof())
 {     f1.read ((char*)&s1,sizeof(s1));
b=s1.getrno();
if (b==rn)
{   x=1;
   break;
}
 }
if (x==1)
{   s1.disp();
}
else
cout<<"\n not found";


    }
    f1.close();
    getch();
}
void student::accp()
{   cout<<"\n enter the student name:";
    gets(name);
    cout<<"\n enter the roll number:";
    cin>>rno;
    cout<<"\n enter the percentage:";
    cin>>percent;
    return;
}
void student::disp()
{   cout<<"\n student name:"<<name;
    cout<<"\n roll number:"<<rno;
    cout<<"\n percentage:"<<percent;
    return;
}
Share:

C++ menu driven program to display the reversed scentence or count the number of scentence using files concept


#include<fstream.h>
#include<conio.h>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
void countline();
void main()
{  clrscr();
   int ch;
   cout<<"\n 1. wants to show the reversed file";
   cout<<"\n 2. wants to know the number of lines";
   cout<<"\n enter the choice ";
   cin>>ch;
   switch(ch)
   {case 1 :
     char str[100];
       fstream f1("mydata.txt",ios::in);
       if (!f1)
       {  cout<<"\n could not find";
 getch();
 exit(-1);
       }
       char ch;
       cout<<"\n THE SENTENCE IS : ";
       while (!f1.eof())
       {    f1.get(ch);
   cout<<ch;
       }
       f1.close();
       char c;
       int i=0;
       fstream f("mydata.txt",ios::in);
       while (!f.eof())
       {    f.get(c);
   str[i]=c;
   i++;
       }
       str[i]='\0';
       cout<<"\n THE REVERSED SENTENCE IS :";
       for ( i=0; str[i]!='\0'; i++);
       for (int j=i-1; j>=0; j--)
       cout<<str[j];
       break;

   case 2:
     countline();

   break;
 }
   getch();
}
void countline()
{  char c;
   fstream f1("mydata.txt",ios::in);
   if (!f1)
   {  cout<<"\n could not find";
      getch();
      exit(-1);
   }
   char ch;
   cout<<"\n THE SENTENCE IS : ";
   while (!f1.eof())
   {    f1.get(ch);
cout<<ch;
   }
   f1.close();
   fstream f("mydata.txt",ios::in);
   int i=0;
   while (!f.eof())
   {  f.get(c);
      if (c=='.' || c=='!' || c=='?')
      i++;
   }
   f.close();
   cout<<"\n number of line are : "<<i;
   return;
}
Share:

C++ Program to cont the occurance of a word in a scentence of a file

//programe to count the occurance of the word 'do'

#include<fstream.h>
#include<conio.h>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
void countdo();
void main()
{  clrscr();
   countdo();
   getch();
}
void countdo()
{  char str[50], arr[10];
   int i=0;
   fstream f1("memo.txt",ios::in);
   if (!f1)
   {  cout<<"\n could not find";
      getch();
      exit(-1);
   }
   char ch;
   cout<<"\n THE SENTENCE IS : ";
   while (!f1.eof())
   {    f1.get(ch);
cout<<ch;
   }
   f1.close();
   fstream f("memo.txt",ios::in);
   while (!f.eof())
   {  f>>arr;
      if (strcmp (arr,"do")==0)
      i++;
   }
   f.close();
   cout<<"\n 'do' occured "<<i<<" times";
   return;
}
Share:

C++ Program to create a txt or binary file File


#include<fstream.h>
#include<conio.h>
#include<stdlib.h>
#include<stdio.h>
#include<ctype.h>
void main()
{  clrscr();
   char str[50], c;
   int cnt=0;
   fstream f("mydata.dat",ios::binary|ios::in);
   if (!f)
   {  cout<<"\n could not find";
      getch();
      exit(-1);
   }
   cout<<"\n THE SENTENCE IS : ";
   while (!f.eof())
   {  f.get(c);
      cout<<c;
      if (isalpha(c))
      {  cnt++;
      }
   }
   f.close();
   cout<<"\n number of characters are : "<<cnt;
   getch();
}
Share:

C++ Program to calculate date using classes


#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
class date
{   private: char olddate[20];
     int days;
    public: char colddate[20];
   int day;
   void accp();
   void getdate()
   {  strcpy (colddate,olddate);
      day=days;
      return;
   }
   char newdate(char colddate[], int day);
   void disp();
};
void main()
{ clrscr();
  date d;
  char a[20];int b;
  d.accp();
  strcpy(a,d.colddate);
  b=d.day  ;
  d.newdate(a,b);
  d.disp();
  getch();
}
void date::accp()
{ cout<<"\n enter the old date (dd-mm-yyyy) : ";
  gets(olddate);
  cout<<"\n enter the numbers of days : ";
  cin>>days;
}
char date::newdate(char colddate[], int day)
{ int m=0,y=0;char temp[20];
  do
  {    if (day>=360)
       {  y++;
 day=day-360;
       }
       else
       if (day>=30)
       {  m++;
 day=day-30;
       }
  }while(day>=30);
  colddate[0]=colddate[0]+(day/10);
  colddate[1]=colddate[1]+(day%10);
  colddate[3]=colddate[3]+(m/10);
  colddate[4]=colddate[4]+(m%10);
  colddate[8]=colddate[8]+(y/10);
  colddate[8]=colddate[8]+(y%10);
  return colddate[];
}
void date::disp()
{  cout<<"\n new date is "<<colddate;
}



Share: