Comprehensive Viva
Comprehensive Viva
Software Engineering
1.1 The Evolving role of software:
Nowadays, software plays a major role with dual activity. It is a product like a vehicle. As
a product, it delivers the computing potential embodied by computer hardware or a network of
computers that are accessible by local hardware. Whether the product or software resides within a
mobile phone or operates inside a mainframe computer, software is an information transformer
likely to produce, manage, acquire, modify, display or transmit the information.
The software
The role of computer software has undergone significant change over a time span
of little more than 50 years.
Software Characteristics:
To make the difference from other things or product, it is important to examine the
characteristics of software. When hardware is built, the human creative process may be
analysis, design, construction, testing is ultimately translated into a physical form where
as build a new computer, the initial sketches, formal design drawings, and bread boarded
prototype evolve into a physical product such as chips, circuit boards, power supplies, etc.
Software is a logical related rather than a physical system. So that the software
have distinct characteristics but the hardware is not so, it is only the peripherals or devices
or components.
Character 1: Software is developed or engineered; it is not manufactured in the
Classical Sense.
Although some similarities exist between software development and hardware
manufacture, the two activities are fundamentally different. In both the activities, high
quality is achieved through good design, but the manufacturing phase for hardware can
introduce quality problems that are nonexistent or easily corrected for software. Both the
activities are dependent on people, but the relationship between people is totally varying.
These two activities require the construction of a "product" but the approaches are
different. Software costs are concentrated in engineering which means that software
projects cannot be managed as if they were manufacturing.
Figure 1.1 Relationship between failure rate and time Software is not susceptible
to the environmental maladies that cause hardware to wear out. In theory, therefore, the
failure rate curve for software should take the form of the idealized curve like a zig-zag
form. Undiscovered defects will cause high failure rates early in the life of a program.
However, the implication is clear software doesn't wear out. But it does deteriorate.
Before the curve can return to the original steady-state failure rate, another change is
requested, causing the curve to spike again. Slowly, the minimum failure rate level begins
to risethe software is deteriorating due to change.
Figure 1.2 Idealized and actual failure curves for software when a hardware
component wears out, it are replaced by a spare part unlike the software spare parts. The
software failure indicates an error in design or in the process through which design as
translated into machine executable code. Therefore, software maintenance involves more
complexity than hardware maintenance.
Character 3: Although the industry is moving toward component-based assembly,
most software continues to be custom built
Consider the manner in which the control hardware for a computer-based product
is designed and built. The design engineer draws a simple schematic of the digital
circuitry, does some fundamental analysis to assure that proper function will be achieved,
and then goes to the shelf where catalogs of digital components exist.
Each integrated circuit (called an IC or a chip) has a part number, a defined and
validated function, a well-defined interface, and a standard set of integration guidelines.
After each component is selected, it can be ordered off the shelf. As an engineering
discipline evolves, a collection of standard design components is created. Standard screws
and off-the-shelf integrated circuits are standard components that are used by mechanical
and electrical engineers to design new systems.
The reusable components have been created so that the engineer can concentrate
on the truly innovative elements of a design, that is, the parts of the design that represent
something new. In the hardware world, component reuse is a natural part of the
engineering process.
A software component should be designed and implemented so that it can be
reused in many different programs. In the 1960s, we built scientific subroutine libraries
that were reusable in a broad array of engineering and scientific applications. These
subroutine libraries reused well-defined algorithms in an effective manner but had a
limited domain of application and not extended algorithm only but included data structure
too. Modern reusable components encapsulate both data and the processing applied to the
data, enabling the software engineer to create new applications from reusable parts.
systems), the communication of information (networks), and the creation and control of other
programs (software tools and environments).
Software delivers the most important product of our timeinformation. It transforms
personal data (e.g., an individuals financial transactions) so that the data can be more useful in a
local context; it manages business information to enhance competitiveness; it provides a gateway
to worldwide information networks (e.g., the Internet), and provides the means for acquiring
information in all of its forms.
The role of computer software has undergone significant change over the last halfcentury. Dramatic improvements in hardware performance, profound changes in computing
architectures, vast increases in memory and storage capacity, and a wide variety of exotic input
and output options, have all precipitated more sophisticated and complex computer-based
systems. Sophistication and complexity can produce dazzling results when a system succeeds, but
they can also pose huge problems for those who must build complex systems.
Today, a huge software industry has become a dominant factor in the economies of the
industrialized world. Teams of software specialists, each focusing on one part of the technology
required to deliver a complex application, have replaced the lone programmer of an earlier era.
And yet, the questions that were asked of the lone programmer are the same questions that are
asked when modern computer-based systems are built:
These, and many other questions, are a manifestation of the concern about software and
the manner in which it is developeda concern that has lead to the adoption of software
engineering practice.
Legacy software systems . . . were developed decades ago and have been continually
modified to meet changes in business requirements and computing platforms. The proliferation of
such systems is causing headaches for large organizations who find them costly to maintain and
risky to evolve.
Liu and his colleagues [Liu98] extend this description by noting that many legacy
systems remain supportive to core business functions and are indispensable to the business.
Hence, legacy software is characterized by longevity and business criticality.
Unfortunately, there is sometimes one additional characteristic that is present in legacy
softwarepoor quality. Legacy systems sometimes have inextensible designs, convoluted code,
poor or nonexistent documentation, test cases and results that were never archived, a poorly
managed change historythe list can be quite long. And yet, these systems support core
business functions and are indispensable to the business. What to do?
The only reasonable answer may be: Do nothing; at least until the legacy system must
undergo some significant change. If the legacy software meets the needs of its users and runs
reliably, it isnt broken and does not need to be fixed. However, as time passes, legacy systems
often evolve for one or more of the following reasons:
The software must be adapted to meet the needs of new computing environments
or technology.
The software must be enhanced to implement new business requirements.
The software must be extended to make it interoperable with other more modern
systems or databases.
The software must be re-architected to make it viable within a network
environment.
Then these modes of evolution occur, a legacy system must be reengineered so that it
remains viable into the future. The goal of modern software engineering is to devise
methodologies that are founded on the notion of evolution; that is, the notion that software
systems continually change, new software systems are built from the old ones, and . . . all must
interoperate and cooperate with each other.
Today, most knowledgeable software engineering professionals recognize myths for what
they aremisleading attitudes that have caused serious problems for managers and practitioners
alike. However, old attitudes and habits are difficult to modify, and remnants of software myths
remain.
Management Myths:
Managers with software responsibility, like managers in most disciplines, are often under
pressure to maintain budgets, keep schedules from slipping, and improve quality. Like a
drowning person who grasps at a straw, a software manager often grasps at belief in a software
myth, if that belief will lessen the pressure (even temporarily).
Myth: We already have a book thats full of standards and procedures for building software.
Wont that provide my people with everything they need to know?
Reality: The book of standards may very well exist, but is it used? Are software practitioners
aware of its existence? Does it reflect modern software engineering practice? Is it complete? Is it
adaptable? Is it streamlined to improve time-to-delivery while still maintaining a focus on
quality? In many cases, the answer to all of these questions is no.
Myth: If we get behind schedule, we can add more programmers and catch up (sometimes called
the Mongolian horde concept).
Reality: Software development is not a mechanistic process like manufacturing. In the words of
Brooks [Bro95]: adding people to a late software project makes it later. At first, this statement
may seem counterintuitive. However, as new people are added, people who were working must
spend time educating the newcomers, thereby reducing the amount of time spent on productive
development effort. People can be added but only in a planned and well coordinated manner.
Myth: If I decide to outsource the software project to a third party, I can just relax and let that
firm build it.
Reality: If an organization does not understand how to manage and control software projects
internally, it will invariably struggle when it outsources software projects.
Customer Myths:
A customer who requests computer software may be a person at the next desk, a technical
group down the hall, the marketing/sales department, or an outside company that has requested
software under contract. In many cases, the customer believes myths about software because
software managers and practitioners do little to correct misinformation. Myths lead to false
expectations (by the customer) and, ultimately, dissatisfaction with the developer.
6
Myth: A general statement of objectives is sufficient to begin writing programswe can fill in
the details later.
Reality: Although a comprehensive and stable statement of requirements is not always possible,
an ambiguous statement of objectives is a recipe for disaster. Unambiguous requirements
(usually derived iteratively) are developed only through effective and continuous communication
between customer and developer.
Myth: Software requirements continually change, but change can be easily accommodated
because software is flexible.
Reality: It is true that software requirements change, but the impact of change varies with the
time at which it is introduced. When requirements changes are requested early (before design or
code has been started), the cost impact is relatively small. However, as time passes, the cost
impact grows rapidlyresources have been committed, a design framework has been established,
and change can cause upheaval that requires additional resources and major design modification.
Practitioners myths:
Myths that are still believed by software practitioners have been fostered by over 50 years
of programming culture. During the early days, programming was viewed as an art form. Old
ways and attitudes die hard.
Myth: Once we write the program and get it to work, our job is done.
Reality: Someone once said that the sooner you begin writing code, the longer itll take you to
get done. Industry data indicate that between 60 and 80 percent of all effort expended on
software will be expended after it is delivered to the customer for the first time.
Myth: Until I get the program running I have no way of assessing its quality.
Reality: One of the most effective software quality assurance mechanisms can be applied from
the inception of a projectthe technical review. Software reviews (described in Chapter 15) are a
quality filter that have been found to be more effective than testing for finding certain classes
of software defects.
Myth: The only deliverable work product for a successful project is the working program.
Reality: A working program is only one part of a software configuration that includes many
elements. A variety of work products (e.g., models, documents, plans) provide a foundation for
successful engineering and, more important, guidance for software support.
Myth: Software engineering will make us creates voluminous and unnecessary documentation
and will invariably slow us down.
Reality: Software engineering is not about creating documents. It is about creating a quality
product. Better quality leads to reduced rework. And reduced rework results in faster delivery
times.
Many software professionals recognize the fallacy of the myths just described.
Regrettably, habitual attitudes and methods foster poor management and technical practices, even
when reality dictates a better approach. Recognition of software realities is the first step toward
formulation of practical solutions for software engineering.
Total quality management and similar philosophies foster a continuous process improvement
culture, and this culture ultimately leads to the development of increasingly more mature
approaches to software engineering. The bedrock that supports software engineering is a quality
focus.
Correction: Even with the best quality assurance activities, it is likely that the customer will
uncover defects in the software. Corrective maintenance changes the software to correct defects.
Adaptation: Over time, the original environment (e.g., CPU, operating system, business rules,
external product characteristics) for which the software was developed is likely to change.
Adaptive maintenance results in modification to the software to accommodate changes to its
external environment.
Enhancement: As software is used, the customer/user will recognize additional functions that
will provide benefit. Perfective maintenance extends the software beyond its original functional
requirements.
Prevention: Computer software deteriorates due to change, and because of this, preventive
maintenance, often called software reengineering, and must be conducted to enable the software
to serve the needs of its end users. In essence, preventive maintenance makes changes to
computer programs so that they can be more easily corrected, adapted, and enhanced.
In addition to these support activities, the users of software require continuing support.
In-house technical assistants, telephone-help desks, and application-specific web sites are often
implemented as part of the support phase.
Today, a growing population of legacy programs1 is forcing many companies to pursue
software reengineering strategies. In a global sense, software reengineering is often considered as
part of business process reengineering.
The phases and related steps described in our generic view of software engineering are
complemented by a number of umbrella activities. Typical activities in this category include:
Level 2: Repeatable. Basic project management processes are established to track cost, schedule,
and functionality. The necessary process discipline is in place to repeat earlier successes
on projects with similar applications.
Level 3: Defined. The software process for both management and engineering activities is
documented, standardized, and integrated into an organization wide software process. All
projects use a documented and approved version of the organization's process for
developing and supporting software.
This level includes all characteristics defined for level 2.
Level 4: Managed. Detailed measures of the software process and product quality are collected.
Both the software process and products are quantitatively understood and controlled
using detailed measures. This level includes all characteristics defined for level 3.
Level 5: Optimizing. Continuous process improvement is enabled by quantitative feedback from
the process and from testing innovative ideas and technologies.
This level includes all characteristics defined for level 4.
The five levels defined by the SEI were derived as a consequence of evaluating responses
to the SEI assessment questionnaire that is based on the CMM. The results of the questionnaire
are distilled to a single numerical grade that provides an indication of an organization's process
maturity.
The SEI has associated key process areas (KPAs) with each of the maturity levels. The
KPAs describe those software engineering functions (e.g., software project planning,
requirements management) that must be present to satisfy good practice at a particular level. Each
KPA is described by identifying the following characteristics:
Goalsthe overall objectives that the KPA must achieve.
Commitmentsrequirements (imposed on the organization) that must be met to achieve the
goals or provide proof of intent to comply with the goals.
Abilitiesthose things that must be in place (organizationally and technically) to enable the
organization to meet the commitments.
Activitiesthe specific tasks required to achieve the KPA function.
Methods for monitoring implementationthe manner in which the activities are monitored as
they are put into place.
Methods for verifying implementationthe manner in which proper practice for the KPA can
be verified.
13
Eighteen KPAs (each described using these characteristics) are defined across the
maturity model and mapped into different levels of process maturity. The following KPAs should
be achieved at each process maturity level: 3.
15
Each framework activity is populated by a set of S/W eng actions a collection of related
tasks that produces a major S/W eng work product (design is a S/W eng action). Each action is
populated with individual work tasks that accomplish some part of the work implied by the
action.
The following generic process framework is applicable to the vast majority of S/W
projects.
Communication: involves heavy communication with the customer (and other
and encompasses requirements gathering.
stakeholders)
Planning: Describes the technical tasks to be conducted, the risks that are likely, resources that
will be required, the work products to be produced and a work schedule.
Modeling: encompasses the creation of models that allow the developer and customer to better
understand S/W req. and the design that will achieve that req.
Construction: combines code generation and the testing required uncovering errors in the code.
Deployment: deliver the product to the customer who evaluates the delivered product and
provides feedback.
Each S/W eng action is represented by a number of different task sets each a collection
of S/W eng work tasks, related work products, quality assurance points, and project milestones.
The task set that best accommodates the needs of the project and the characteristics of the
team is chosen.
The framework described in the generic view of S/W eng is complemented by a number
of umbrella activities. Typical activities include:
S/W project tracking and control: allows the team to assess progress against the project
plan and take necessary action to maintain schedule.
Risk Management: Assesses the risks that may affect the outcome of the project or the
quality.
Software quality assurance: defines and conducts the activities required to ensure
software quality.
Formal Technical Review: uncover and remove errors before they propagate to the next
action.
Measurement: defines and collects process, project, and product measures that assist the
team in delivering S/W that meets customers needs.
Software configuration management: Manages the effect of change throughout the S/W
process
16
development is iterative in nature. Although this may be true of the small, pilot projects
prevalent in the early 1990s, it is not true of todays large-scale, mission-critical
applications. The reality is that OO development is serial in the large, iterative in the
small, delivering incremental releases over time (Ambler, 1998b). Phase process patterns
are performed in serial order, made up of stage process patterns which are performed
iteratively.
Initiating
Diagnosing
Establishing
Acting
Leveraging
Initiating:
Diagnosing:
-
Develop recommendations
Establishing:
-
Plan actions
18
Acting:
-
Leveraging:
-
Findings & KPA guidance used to plan improvement strategy for organization
19
Common Steps
-
On-site Visit
Using results analysis, conduct on-site visit to view process areas
Using KPAs as guide, question, listen, review & synthesize info
Apply professional judgment
Document rationale for situations where KPAs not met
Findings
At end of on-site period, team produces list of findings
Identifies strengths & weaknesses of orgs software processes
Software Process Assessment -> Basis for PI recommendations
Software Capability Evaluation -> Findings part of risk analysis
20
KPA Profile
Team prepares KPA profile, showing where KPAs satisfied / not satisfied
by organization
KPA can be satisfied and still have associated findings, as long as findings
dont identify major problems achieving goals of KPA
PSP emphasizes the need to record and analyze the types of errors you make, so you can
develop strategies eliminate them.
Planning isolates requirements and based on these develops both size & resource
estimates. A defect estimate is made.
High level Design external specification of all components. All issues are recorded and
tracked.
High level Design Review- formal verification to uncover errors.
Development- metrics are maintained for all important tasks & work results.
Postmortem- using measures & metrics collected effectiveness of process is determined
an improved.
Because personnel costs constitute 70 percent of the cost of software development, the
skills and work habits of engineers largely determine the results of the software development
process.
Based on practices found in the CMMI, the PSP can be used by engineers as a guide to a
disciplined and structured approach to developing software. The PSP is a prerequisite for an
organization planning to introduce the TSP.
The PSP can be applied to many parts of the software development process, including
- Small-program development
- Requirement definition
- Document writing
22
- Systems tests
- Systems maintenance
- Enhancement of large software systems
TSP:
Engineering groups use the TSP to apply integrated team concepts to the development of
software-intensive systems. A launch process walks teams and their managers through
- establishing goals
- defining team roles
- assessing risks
- producing a team plan
Benefits:
The TSP provides a defined process framework for managing, tracking and reporting the
team's progress.
Using TSP, an organization can build self-directed teams that plan and track their work,
establish goals, and own their processes and plans. These can be pure software teams or
integrated product teams of 3 to 20 engineers.
23
TSP will help your organization establish a mature and disciplined engineering practice
that produces secure, reliable software.
2. Network Security
2.1 Security Attacks
Introduction:
We start our description of security in distributed systems by taking a look at some
general security issues. First, it is necessary to define what a secure system is. We distinguish
security policies from security mechanisms, and take a look at the Globus wide-area system for
which a security policy has been explicitly formulated. Our second concern is to consider some
general design issues for secure systems. Finally, we briefly discuss some cryptographic
algorithms, which play a key role in the design of security protocols.
Security in computer systems is strongly related to the notion of dependability.
Informally, a dependable computer system is one that we justifiably trust to deliver its services
(Laprie, 1995). Dependability includes availability, reliability, safety, and maintainability.
However, if we are to put our trust in a computer system, then confidentiality and integrity should
also be taken into account. Confidentiality refers to the property of a computer system whereby
its information is disclosed only to authorize parties. Integrity is the characteristic that alterations
to a systems assets can be made only in an authorized way. In other words, improper alterations
in a secure computer system should be detectable and recoverable. Major assets of any computer
system are its hardware, software, and data. Another way of looking at security in computer
systems is that we attempt to protect the services and data it offers against security threats.
There are mainly two types of attacks:
1) Passive attacks:
Attempts to learn or make use of information from the system but does not affect
system resources
a) Traffic Analysis
b) Release of message contents
a) Traffic Analysis:
In this attack the eavesdropper analyzes the traffic, determines the location,
identifies communicating hosts, observes the frequency and length of message being
exchanged. Using all these information they predict the nature of communication. All
incoming and outgoing traffic of network is analysed but not altered.
24
2) Active attacks:
Attempts to alter system resources or affect their operation
Examples:
Masquerade (spoofing)
An entity pretends to be a different entity
Replay
Capture and subsequent retransmission of data
Modification (substitution, insertion, destruction)
(some parts of the) legitimate messages are altered or deleted, or fake messages are
generated
If done in real time, then it needs a man in the middle
Denial of service
Normal use or management of the system is prevented or inhibited
e.g., a server is flooded by fake requests so that it cannot reply normal requests
Difficult to prevent, should be detected
There are four types of security threats to consider:
25
1. Interception
2. Interruption
3. Modification
4. Fabrication
1. Interception:
Interception refers to the situation that an unauthorized party has gained access to
a service or data.
A typical example of interception is where communication between two
has been overheard by someone else.
parties
2. Interruption:
Interception also happens when data are illegally copied, for example, after
breaking into a persons private directory in a file system.
An example of interruption is when a file is corrupted or lost. In general,
interruption refers to the situation in which services or data become unavailable, unusable,
destroyed, and so on. In this sense, denial of service attacks by which someone
maliciously attempts to make a service inaccessible to other parties is a security threat
that classifies as interruption.
3. Modification:
26
Confidentiality
Authentication
Integrity
Non-repudiation
Access Control
Availability
1) Confidentiality:
The concept of Confidentiality in information security pertains to the protection of
information and prevention of unauthorized access or disclosure. The ability to keep data
confidential, or secret, is critical to staying competitive in todays business environments.
Loss of confidentiality jeopardizes system and corporate integrity.
Threats to confidentiality:
Hackers
27
Masqueraders
Authorized users on the system that have obtained another person
credentials.
Unauthorized Users
Users that gain access to the system even if company rules forbid it.
Unprotected Downloads
Downloads of files from secure environments to non-secure environments
or media.
Malware
Virus and worms and other malicious software
Software hooks (Trapdoors)
During the development phase software developers create hooks that
allow them to bypass authentication processes and access the internal
workings of the program. When the product development phase is over
developers do not always remember the hooks and may leave them in
place to be exploited by hackers.
2) Authentication:
Authentication is the process by which the information system assures that you are
who you say you are; how you prove your identity is authentic.
Methods of performing authentication are:
User ID and passwords. The system compares the given password with a stored
password. If the two passwords match then the user is authentic.
Swipe card, which has a magnetic strip embedded, which would already contain
your details, so that no physical data entry takes place or just a PIN is entered.
Digital certificate, an encrypted piece of data which contains information about its
owner, creator, generation and expiration dates, and other data to uniquely identify
a user.
key fob, small electronic devices which generate a new random password
synchronized to the main computer
Biometrics - retinal scanners and fingerprint readers. Parts of the body are
considered unique enough to allow authentication to computer systems based one
their properties.
For a very secure environment, it is also possible to combine several of these options,
such as by having fingerprint identification along with user ID and key fob.
28
3) Integrity:
4) Non-repudiation:
Data flows around the internet at the speed of light, or as close to it as the servers allow.
There are hackers, spoofers, sniffers, and worse out there just waiting to steal, alter, and
corrupt your information.
Data consumers need to be able to trust that the data has not been altered, and that its
source is authentic.
Through the use of security related mechanisms, producers and consumers of data can be
assured that the data remains trustworthy across untrusted networks such as the internet,
and even internal intranets.
5) Access Control:
The purpose of access control is to limit the actions or operations that a legitimate user of
a computer system can perform. Access control constrains what a user can do directly, as well as
what programs executing on behalf of the users are allowed to do. In this way access control
seeks to prevent activity that could lead to a breach of security.
Access control relies on and coexists with other security services in a computer system.
Access control is concerned with limiting the activity of legitimate users. It is enforced by a
reference monitor which mediates every attempted access by a user ( or program executing on
behalf of that user) to objects in the system. The reference monitor consults an authorization
database in order to determine if the user attempting to do an operation is actually authorized to
perform that operation. Authorizations in this database are administered and maintained by a
security administrator. The administrator sets these authorizations on the basis of the security
policy of the organisation. Users may also be able to modify some portion of the authorization
database, for instance, to set permissions for their personal files. Auditing monitors and keeps a
record of relevant activity in the system.
29
6) Availability:
Availability assures that the resources that need to be accessed are accessible to
authorized parties in the ways they are needed. Availability is a natural result of the other
two concepts. If the confidentiality and integrity of the systems are assured their
availability for the purpose they are intended for is a direct consequence.
Threats to Availability :
Availability can be affected by a number of events which break down into human
and non human influenced factors. This further break down to unintentional and
intentional acts.
Examples of unintentional (non-directed) acts can be overwriting, in part or whole,
of data, compromising of systems, or network infrastructure by organizational
staff.
Intentional acts can be conventional warfare (bombs and air-strikes), information
warfare denial of service (DoS) and distributed denial of service (DDoS).
Non-human factors include loss of availability due to fires, floods, earthquakes
and storms.
Encipherment
30
Digital signature
Data appended to, or a cryptographic transformation of, a data unit that
allows a recipient of the data unit to prove the source and integrity of the data
unit and protect against forgery
1.3.
Access control
A variety of mechanisms that enforce access rights to resources
1.4.
Data integrity
A variety of mechanisms used to assure the integrity of a data unit or
stream of data units
1.5.
Authentication exchange
A mechanism intended to ensure the identity of an entity by means of
information exchange
1.6.
Traffic padding
The insertion of bits into gaps in a data stream to frustrate traffic analysis
attempts
1.7.
Routing control
Enables selection of a particular physically secure routes for certain data
and allows routing changes, especially when a breach of security is suspected
1.8.
Notarization
The use of the third trusted party to assure certain properties of a data
exchange
The marking bound to a resource (which may be a data unit) that names or
designates the security attributes of that resources.
3. Event detection:
Detection of security relevant events.
4. Security audit trail:
Data collected and potentially used to facilitate a security audit, which is
independent review and examination of system records and activities
5. Security recovery:
Deals with requests from mechanisms, such as event handling and
management functions, and takes recovery actions.
32
employee who wishes to do damage or a criminal who seeks to exploit computer assets for
financial gain (e.g., obtaining credit card numbers or performing illegal money transfers).
Another type of unwanted access is the placement in a computer system of logic that exploits
vulnerabilities in the system and that can affect application programs as well as utility programs,
such as editors and compilers. Programs can present two kinds of threats:
1. Information access threats: Intercept or modify data on behalf of users who should not
have access to that data.
2. Service threats: Exploit service flaws in computers to inhibit use by legitimate users.
34
35
sequence number which helps the receiving host to synchronize and reassemble the stream of
packets back into their original and intended order.
TCP session establishment is shown in figure:
TCP hijacks are meant to intercept the already established TCP sessions between any two
communicating parties and then pretending to be one of them, finally redirecting the TCP traffic
to it by injecting spoofed IP packets so that your commands are processed on behalf of the
authenticated host of the session. It desynchronizes the session between the actual
communicating parties and by intruding itself in between. As authentication is only required at
the time of establishing connection , an already established connection can be easily stolen
without going through any sort of authentication or security measures concerned. TCP session
hijacks can be implemented in two different ways: Middle Man Attack (suggested by Lam,
LeBlanc, and Smith) and the Blind attack.
IP Spoofing: Assuming the identity
Spoofing is pretending to be someone else. This is a technique used to gain unauthorized
access to the computer with an IP address of a trusted host. The trusted host in case of session
hijacking is the client with whose IP address we will spoof our packets so that our packets will
become acceptable to the server maintaining the session with the client. In implementing this
technique session hijacker has to obtain the IP address of the client and inject his own packets
spoofed with the IP address of client into the TCP session, so as to fool the server that it is
communicating with the victim i.e. the original host.
What remains untouched is how to alter the sequence and the acknowledgement numbers
of the spoofed packets which the server is expecting from the client. Once it is altered, hijacker
injects its own forged packet in the established session before the client can respond , ultimately
desynchronizing the original session , because now our server will expect a different sequence
number , so the original packet will be trashed. Based on the anticipation of sequence numbers
there are two types of TCP hijacking: Man in the Middle and Blind hijacking.
Since UDP does not use packet sequencing and synchronizing; it is easier than TCP to
hijack UDP session. The hijacker has simply to forge a server reply to a client UDP request
before the server can respond. If sniffing is used than it will be easier to control the traffic
generating from the side of the server and thus restricting servers reply to the client in the first
place.
ARP spoofing is a type of attack in which a malicious actor sends falsified ARP (Address
Resolution Protocol) messages over a local area network. This results in the linking of an
attackers MAC address with the IP address of a legitimate computer or server on the network.
Once the attackers MAC address is connected to an authentic IP address, the attacker will begin
receiving any data that is intended for that IP address. ARP spoofing can enable malicious parties
to intercept, modify or even stop data in-transit. ARP spoofing attacks can only occur on local
area networks that utilize the Address Resolution Protocol.
Denial-of-service attacks: DoS attacks often leverage ARP spoofing to link multiple IP
addresses with a single targets MAC address. As a result, traffic that is intended for many
different IP addresses will be redirected to the targets MAC address, overloading the target
with traffic.
Session hijacking: Session hijacking attacks can use ARP spoofing to steal session IDs,
granting attackers access to private systems and data.
Man-in-the-middle attacks: MITM attacks can rely on ARP spoofing to intercept and
modify traffic between victims.
A routing table contains the information necessary to forward a packet along the best path
toward its destination. Each packet contains information about its origin and destination. When a
packet is received, a network device examines the packet and matches it to the routing table entry
providing the best match for its destination. The table then provides the device with instructions
for sending the packet to the next hop on its route across the network.
A basic routing table includes the following information:
Interface: The outgoing network interface the device should use when forwarding the
packet to the next hop or final destination
Metric: Assigns a cost to each available route so that the most cost-effective path can be
chosen
Routes: Includes directly-attached subnets, indirect subnets that are not attached to the
device but can be accessed through one or more hops, and default routes to use for certain
types of traffic or when information is lacking.
Routing tables can be maintained manually or dynamically. Tables for static network
devices do not change unless a network administrator manually changes them. In dynamic
routing, devices build and maintain their routing tables automatically by using routing protocols
to exchange information about the surrounding network topology. Dynamic routing tables allow
devices to "listen" to the network and respond to occurrences like device failures and network
congestion.
40
Plaintext: This is the original message or data that is fed into the algorithm as input.
Encryption algorithm: The encryption algorithm performs various substitutions and
transformations on the plaintext.
Secret key: The secret key is also input to the algorithm. The exact substitutions and
transformations performed by the algorithm depend on the key.
Cipher text: This is the scrambled message produced as output. It depends on the plaintext and
the secret key. For a given message, two different keys will produce two different cipher texts.
Decryption algorithm: This is essentially the encryption algorithm run in reverse. It takes the
cipher text and the same secret key and produces the original plaintext.
There are two requirements for secure use of symmetric encryption:
1. We need a strong encryption algorithm. At a minimum, we would like the algorithm to be such
that an opponent who knows the algorithm and has access to one or more cipher texts would be
unable to decipher the cipher text or figure out the key. This requirement is usually stated in a
stronger form: The opponent should be unable to decrypt cipher text or discover the key even if
he or she is in possession of a number of cipher texts together with the plaintext that produced
each cipher text.
2. Sender and receiver must have obtained copies of the secret key in a secure fashion and must
keep the key secure. If someone can discover the key and knows the algorithm, all
communication using this key is readable.
2.12.1 Cryptography:
Cryptographic systems are generically classified along three independent dimensions:
1. The type of operations used for transforming plaintext to cipher text. All encryption algorithms
are based on two general principles: substitution, in which each element in the plaintext (bit,
letter, group of bits or letters) is mapped into another element, and transposition, in which
elements in the plaintext are rearranged. The fundamental requirement is that no information be
lost (that is, that all operations be reversible). Most systems, referred to as product systems,
involve multiple stages of substitutions and transpositions.
41
2. The number of keys used. If both sender and receiver use the same key, the system is referred
to as symmetric, single-key, secret-key, or conventional encryption. If the sender and receiver
each use a different key, the system is referred to as asymmetric, two-key, or public-key
encryption.
3. The way in which the plaintext is processed. A block cipher processes the input one block of
elements at a time, producing an output block for each input block. A stream cipher processes the
input elements continuously, producing output one element at a time, as it goes along.
42
43
Key size: Larger key size means greater security but may decrease encryption/ decryption
speed. The most common key length in modern algorithms is 128 bits.
Number of rounds: The essence of a symmetric block cipher is that a single round offers
inadequate security but that multiple rounds offer increasing security. A typical size is 16 rounds.
Sub key generation algorithm: Greater complexity in this algorithm should lead to greater
difficulty of cryptanalysis.
Round function: Again, greater complexity generally means greater resistance to cryptanalysis.
There are two other considerations in the design of a symmetric block cipher:
Fast software encryption/decryption: In many cases, encryption is embedded in applications
or utility functions in such a way as to preclude a hardware implementation. Accordingly, the
speed of execution of the algorithm becomes a concern.
Ease of analysis: Although we would like to make our algorithm as difficult as possible to
cryptanalyze, there is great benefit in making the algorithm easy to analyze. That is, if the
algorithm can be concisely and clearly explained, it is easier to analyze that algorithm for
cryptanalytic vulnerabilities and therefore develop a higher level of assurance as to its strength.
DES, for example, does not have an easily analyzed functionality.
Decryption with a symmetric block cipher is essentially the same as the encryption
process. The rule is as follows: Use the cipher text as input to the algorithm, but use the subkeys
Ki in reverse order. That is, use Kn in the first round, Kn 1 in the second round, and so on until
K1 is used in the last round. This is a nice feature, because it means we need not implement two
different algorithmsone for encryption and one for decryption.
44
3. Flat
3.1 Regular grammars:
Recall the general form of regular expressions:
If A is an alphabet, and a A , then a is a regular expression.
is a regular expression.
If r and s are regular expressions, then the following are also regular
expressions: r* , r s = rs , r + s , and ( r )
And the general form of context-free grammars (CFG):
a set T of terminals (usually denoted with lowercase letters)
a set N of non-terminals (usually denoted with uppercase letters)
a unique start symbol S N
a set P of productions of the form A , where A N and (T+N)*
Recall also that CFGs allow for specifying a richer variety of languages than do regular
expressions.
What is the relationship between CFGs and regular expressions?
Can regular expressions be rewritten as context-free grammars?
The answer is yes, but to see it, lets first considers a simpler type of CFG
Formally a grammar consists of a set of nonterminals (or variables) V, a set of
terminals
(the alphabet of the language), a start symbol S, which is a nonterminal, and a set of
rewrite rules (productions) P.
A production has in general the form a-> b, where a is a string of terminals and
nonterminals with atleast one non terminal in it and b is a string of terminals and nonterminals.
A grammar is regular if and only if a is a single nonterminal and b is a single terminal or a
single terminal followed by a single nonterminal, that is a production is of the form X -> a or X
-> aY, where X and Y are nonterminals and a is a terminal.
In theoretical computer science and formal language theory, a regular grammar is
a formal grammar that is right-regular or left-regular. Every regular grammar describes a regular
language.
45
46
S -> detB
S -> detC
B -> adj B
B -> adjC
C -> nounD
D -> transitiveVerbE
E -> noun
47
A x
Where x is some string of terminals.
Here is an example of a left-linear grammar:
Grammar J:
S Aa
A Aab |
L(J) = (ab)na, where n0
There is a set of steps for reversing a left-linear grammar, turning it into a right-linear
one (we wont cover it, but you can look it up). Since right-linear grammars are regular, it follows
that left-linear grammars are also regular.
Thus, Regular Grammars produce Regular Languages and are equivalent in expressive
power to Regular Expressions, DFAs, and NFAs.
1) If the left linear grammar has a rule S p, then make that a rule in the right linear
grammar
2) If the left linear grammar has a rule A p, then add the following rule to the right linear
grammar:
S pA
3) If the left linear grammar has a rule B Ap, add the following rule to the right linear
grammar:
A pB
4) If the left linear grammar has a rule S Ap, then add the following rule to the right linear
grammar:
Ap
Ex:
49
S Aa
A ab
Then
S abA
Ex:
If the left linear grammar has this rule A p, then add the following rule to the right
linear grammar: S pA
S Aa
A ab
Then
S abA
Aa
Ex:
If the left linear grammar has S Ap, then add the following rule to the right linear
grammar: A p
S Aa
A ab
Then
S abA
Aa
We Denote by:
1. If A is a variable, then ([A], )={[]|A is production}
2. If a is in T and in T* U T* V, then ([a], a)={[]|.
Then an easy induction on the length of derivation or move sequence shows that ([S], w)
contains [] if and only if S * xA-> xy, where Ay is a Production and xy=w or if =S and
w=.
As [] is the unique final state , M accepts w if and only if S
xA -> w.
But since every derivation of a terminal string has at least one step, we see that M accepts
if and only if G generates w. Hence every Right Linear Grammar generates w regular sets.
Now, Let G=(V,T,P,S) be a left linear grammar. Let G=(V,T,P,S), where P consist of the
productions of G with right sides reversed , i.e., P={A|AR is in P}
If we reverse the productions of a Left Linear grammar we get a right linear grammar and
vice versa.
Thus G is right linear and it is easy to show that L(G)=L(G)R.
By the preceding paragraph, L(G) is regular set. But the regular sets are closed under
reversal, so L(G)R =L(G) is also regular set.
q0
Then clearly (p,w)=q iff p * wq. If wa is accepted by M, Let (q0 ,w)=p, implying
wp. Also, (p,a) is final, so pa is production. Thus q0 *wa.
Conversly, let q0 *
x. Then x=wa, and q0
(q0 ,w)=p and (p,a) is final.
wp
->
52
What is a grammar?
A grammar consists of one or more variables that represent classes of strings (i.e.,
languages)
There are rules that say how the strings in each class are constructed. The construction can
use :
1. symbols of the alphabet
2. Strings that are already known to be in one of the classes
3. or both
A grammar of palindromes:
In the example of palindromes, we need one variable P which represents the set of
palindromes; i.e., the class of strings forming the language Lpal
Rules:
P
P0
P1
P 0P0
P 1P1
The first three rules form the basis.
They tell us that the class of palindromes includes the strings , 0 and 1
None of the right sides of these rules contains a variable, which is why they form a
basis for the definition
The last two rules form the inductive part of the definition.
For instance, rule 4 says that if we take any string w from the class P, then 0w0 is also in
class P.
54
Production rules:
Each production rule consists of:
A variable that is being (partially) defined by the production. This variable is often called
the head of the production.
The production symbol!.
A string of zero or more terminals and variables. This string, called the body of the
production, represents one way to form strings in the language of the variable of the
head.
In doing so, we leave terminals unchanged and substitute for each variable of the body
any string that is known to be in the language of that variable
E*E
(E)*E
(E+E)*E
(id+E)*E
55
(id+id)*E
(id+id)*id
aAS
aSbAS
aabAS
aabbaS
aabbaa
Rightmost Derivation:
S
aAS
aAa
aSbAa
aSbbaa
aabbaa
ABC, A
aA, A
,B
bB, B
,C
cC, C
}.
With this grammar, there is a choice of variables to expand. Here is a sample derivation:
S
ABC
aABC
aABcC
aBcC
abBcC
57
abBc
abbBc
abbc
If we always expanded the leftmost variable first, we would have a leftmost derivation:
S
ABC
aABC
aBC
abBC
abbBC
abbC
abbcC
abbc
Conversely, if we always expanded the rightmost variable first, we would have a rightmost
derivation:
S
ABC
ABcC
ABc
AbBc
AbbBc
Abbc
aAbbc
abbc
58