You are on page 1of 66

Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 1: Introduction

1. INTRODUCTION
INTRODUCTION
With the quick development of mobile computing technique and the prevalence of
interpersonal sociality, mobile network has rapidly become popular in people’s daily life
for facilitating communications and building relationship with others. By using mobile
devices, people can receive information from their service providers at any time or place,
and also share their own data interactively to all related and connected users. Actually,
along with the increasing population of mobile services and cloud computing, people are
more likely to distribute and view media data (e.g. videos) rather than text data with the
media center, such as YouTube and Netflix. Moreover, the cloud services such as Google
Cloud and Microsoft Azure make it easy to use high-definition video services on most
popular mobile devices. For example, with Google Cloud, the open platform Vimeo is
able to provide high-definition videos hosting and sharing services, in which media
creators can upload their videos, and also restrict access to specific people .
Although the media services allow media distributors to configure their privacy
settings so that they are able to grant the media to be accessed by selected friends or
subscribers, the media distributor may not trust the media center, especially the cloud
media center. In particular, once the media content is posted to cloud media center, the
media distributor’s direct control over the media content would be deprived. The media
content on cloud media center may be leaked to unauthorized media consumers, which
will seriously threaten the media privacy, even the privacy of media distributor. These
privacy matters have raised wide concerns in existing media services, and require
cryptographic algorithms to protect media confidentiality and guarantee authorized
access when sharing the media content in mobile cloud computing.
Currently, identity-based encryption (IBE) and broadcast encryption have been
utilized to protect the media privacy. However, the traditional identity-based access
control mechanism may not be appropriate for large scale media sharing due to the
widespread dissemination of media content. The fact is that media distributors usually
define the access privileges with the social or subscription relationships . A promising
cryptographic primitive known as attribute-based encryption (ABE) is a candidate to
solve this challenge, since it can protect media privacy and realize fine-grained and one-

1
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 1: Introduction

to-many access control. Specially, cipher text-policy ABE (CP-ABE), enables the media
distributor to enforce an access policy such as ”Member” AND ”Student” over the
attribute universe on the media content such that a media consumer can access it only by
possessing enough attributes. In this case, the media distributor can enforce expressive
access privileges towards the media content.
On the other hand, media dissemination among heterogeneous networks and
devices usually needs to store multiple versions of media content, which will incur a lot
of storage overhead. The scalable structure of media content is applied to adjust the
conditions of heterogeneous network environment, which encodes a single media content
into a base layer with the lowest quality, and multiple enhancement layers providing
high-definition qualities by exploiting scalable video coding (SVC) technique . The SVC
provides a flexible decoding mechanism to deal with different mobile devices and
networks. Hence, a media distributor can share a multi-dimensional media content which
has diverse quality in terms of resolution, frame rate, and signal-noise-ratio (SNR), with
different media consumers, and only some of them could view the content with higher
quality. However, it introduces new challenges to the privacy-preserving media sharing.

2
Multi Authority Attribute Based Keyword Search Over Encrypted Cloud Data Chapter 6: Implementation

2. LITERATURE SURVEY
1. Y. Meng, C. Jiang, T. Q. S. Quek, Z. Han, and Y. Ren, “Social Learning Based
Inference for Crowdsensing in Mobile Social Networks,” IEEE Transactions on
Mobile Computing, vol. 17, no. 8, pp. 1966– 1979, Aug. 2018.
Mobile communication technology provides more service paradigms to social
networks, allowing the development of mobile social networks (MSNs). An important
scenario of MSNs is crowdsensing, which takes advantage of simple sensing and
computation abilities on the portable devices of ordinary people, and fuses the sensing
results to accomplish large-scale tasks. In crowdsensing, the integration of individual
sensing data from users is of great significance, yet highly depends on the goal of tasks.
In this paper, we propose a high-level distributed cooperative environmental state
inference scheme based on non-Bayesian social learning, which can be applied to various
crowdsensing tasks, e.g., traffic monitoring, air quality monitoring, and weather
forecasting. In the proposed scheme, users exchange information with their neighbors and
cooperatively infer the hidden state, which is the goal of the crowdsensing task but
cannot be measured directly. We prove theoretically that every user is able to
asymptotically learn the hidden state, even when the users locations and relationships
keep changing, and when some users cannot observe signals or provide their own
inferences. We also optimize the weight matrix in the fusion step by maximizing the
learning speed.
2. K. Zhang, X. Liang, X. Shen, and R. Lu, “Exploiting multimedia services in
mobile social networks from security and privacy perspectives,” IEEE
Communications Magazine, vol. 52, no. 3, pp. 58–65, Mar. 2014.
With the ever-increasing demands of multimedia services and the boom of
smartphones, traditional online multimedia applications are extended to mobile users
anywhere and anytime. However, the flourishing of multimedia services is still hindered
by inherent security and privacy concerns. In this article, we investigate the security and
privacy issues of multimedia services by studying a newly emerging multimedia-oriented
mobile social network (MMSN), which helps users receive multimedia services not only
from their online social communities but also from their social friends in the vicinity.
Specifically, we first define the MMSN architecture, and identify the unique security and

3
Multi Authority Attribute Based Keyword Search Over Encrypted Cloud Data Chapter 6: Implementation

privacy challenges. Then we study three MMSN applications: content query, service
evaluation, and content filtering. For each application, we present the specific security
and privacy problems with the corresponding countermeasures. Finally, we propose some
future research directions in the MMSN.
3. V. Goyal, O. Pandey, A. Sahai, and B. Waters, “Attribute-based Encryption for
Fine-grained Access Control of Encrypted Data,” in Proceedings of the 13th ACM
Conference on Computer and Communications Security, 2006, pp. 89–98.
Searchable encryption facilitates cloud server to search over encrypted data
without decrypting the data. Single keyword based searchable encryption enables a user
to access a subset of documents, which contains the keyword of the user's interest. In this
paper, we present a single keyword based searchable encryption scheme for the
applications where multiple data owners upload their data and then multiple users can
access the data. The scheme uses attribute based encryption that allows user to access the
selective subset of data from cloud without revealing his/her access rights to the cloud
server. The scheme is proven adaptively secure against chosen-keyword attack in the
random oracle model. We have implemented the scheme on Google cloud instance and
the performance of the scheme found practical in real-world applications.
4. B. Ciubotaru, C. H. Muntean, and G. Muntean, “Mobile Multi- Source High
Quality Multimedia Delivery Scheme,” IEEE Transactions on Broadcasting, vol. 63,
no. 2, pp. 391–403, Jun. 2017.
Increasing amount of multimedia content is being delivered over heterogeneous
networks to diverse user types, holding various devices, many of them mobile. Mobile
devices such as smartphones and tablets have already become both consumers and
sources of multimedia content, but the delivery quality varies widely, especially due to
their users' mobility. In order to support increasing the quality of the multimedia content
delivered to a growing number of mobile users, this paper introduces a mobile multi-
source high quality multimedia delivery scheme (M3QD). M3QD supports efficient high
quality multimedia content delivery to mobile users from multiple sources. Both
simulations and prototyping-based perceptual tests show how increased user perceived
video quality and improved mobility support is achieved when using M3QD in
comparison with the case when a single source classic approach is employed. M3QD can

4
Multi Authority Attribute Based Keyword Search Over Encrypted Cloud Data Chapter 6: Implementation

be used in various scenarios involving multimedia content distribution between mobile


users in leisure parks or around tourist attractions, content exchange between vehicles on
urban roads and even information delivery in industrial applications, where content has to
be shared between large number or diverse mobile users.
5. J. Bethencourt, A. Sahai, and B. Waters, “Ciphertext-Policy Attribute-Based
Encryption,” in 2007 IEEE Symposium on Security and Privacy (SP ’07), 2007, pp.
321–334.
In several distributed systems a user should only be able to access data if a user
posses a certain set of credentials or attributes. Currently, the only method for enforcing
such policies is to employ a trusted server to store the data and mediate access control.
However, if any server storing the data is compromised, then the confidentiality of the
data will be compromised. In this paper we present a system for realizing complex access
control on encrypted data that we call ciphertext-policy attribute-based encryption. By
using our techniques encrypted data can be kept confidential even if the storage server is
untrusted; moreover, our methods are secure against collusion attacks. Previous attribute-
based encryption systems used attributes to describe the encrypted data and built policies
into user's keys; while in our system attributes are used to describe a user's credentials,
and a party encrypting data determines a policy for who can decrypt. Thus, our methods
are conceptually closer to traditional access control methods such as role-based access
control (RBAC). In addition, we provide an implementation of our system and give
performance measurements.

5
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 3: System Analysis

3. SYSTEM ANALYSIS
3.1 EXISTING SYSTEM
Considering this data structure of media content, Zhu et al. proposed a key
generation scheme for MPEG-4, in which multiple layers of each video are encrypted by
several relational keys. The keys in lower level can be generated from that in higher level
based on a oneway hash chain, but it is vulnerable to collusion attack. Wu et al. presented
an encryption scheme for JPEG 2000 image code-streams in which the encrypted image
can be decrypted in many ways, which is compatible with the characteristics of JPEG
2000 image code-streams. However, these two schemes need online key distribution and
cannot support fine-grained authorization for each layer access. Selective encryption is
also exploited to prevent unauthorized access to high-quality multimedia stream, by it
only encrypts the base layer. Since the unencrypted layers may leak private information,
it is insufficient to protect the media stream confidentiality.
Yang et al. proposed a time-domain access control scheme for secure video
content sharing in cloud media center with CPABE, which encrypts the video content
with an access policy and embeds the time into the ciphertext. Then the users can decrypt
the video content by satisfying the access policy in a specific time period.Wu et al.
proposed the first scalable access control mechanism for SVC media content, which
employs a multi-message CP-ABE to encrypt the media layers and constructs a key graph
that allows authorized users to derive all the layer keys with the key of highest access
level. However, this scheme only considers onedimensional scalability. Deng et al.
proposed a layered access control for two-dimensional media streams which utilizes CP-
ABE to enforce access control by disseminating the symmetric keys of the media layers
to authorized users. This approach allows users of higher privilege to efficiently derive
encryption keys for the lower privileges with the key allocation mechanism for access
graph. However the access policy of each layer is individual, which causes heavy
computational and communication cost as CP-ABE .
Ma et al. proposed a scalable access control scheme for media sharing in cloud
computing by distributing the access keys in a scalable way on the basis of CP-ABE. This
scheme can protect the structure of two dimensional media content and reduce the key
management cost by eliminating the same attributes of multiple access policies. In the

6
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 3: System Analysis

extended version of, Ma et al. then proposed an improved scalable media access control
mechanism SCPABE for arbitrary dimensional scalable media streams. This scheme
designed a single access tree structured by multiple access policies, hence multiple levels
of access privileges can be enforced by decrypting different secrets from the tree.
Compared to the traditional access tree in CP-ABE , this design decreases the number of
non-leaf nodes, and eventually reduces the decryption cost.
Disadvantages
1) The system less effective since it is not implemented Multi-level access policy.
2) The system doesn’t implement privacy-preserving multi-dimensional media sharing
scheme named.
3.2 PROPOSED SYSTEM
We propose a scalable access control mechanism for multi-dimensional media
sharing with an efficient multi-level access policy construction based on access tree and
secret sharing. It integrates multiple access policies in a top-down manner and ensures
that consumers who view the media layer at a higher access level must satisfy the access
trees of its child layers at the lower level, which is compatible with the characteristics of
multi-dimensional media, and reduces the complexity of access policies.

We achieve attribute-based secure deduplication by using decentralized key


servers to support both intra-server and inter-server deduplication, in which the same
encrypted scalable media content could be associated with different multi-level access
policies on the basis of the designed storage structure.

We conduct experimental evaluation on mobile device and cloud platform with


real-world datasets. The results indicate that our scheme protects media privacy against
the cloud media center, key servers and unauthorized consumers with fine-grained access
control and incurs less computational and storage cost compared to existing schemes.

7
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 3: System Analysis

Advantages

 The scalable media format encodes a media stream into a base layer which
provides basic quality, and a number of enhancement layers which enhance the
quality from multiple dimensions such as resolution, frame rate, and SNR.
 The system is more effective due to presence of Multi-level access policy.

3.3 FEASIBILTY STUDY


The feasibility of the project is analyzed in this phase and business proposal is put
forth with a very general plan for the project and some cost estimates. During system
analysis the feasibility study of the proposed system is to be carried out. This is to ensure
that the proposed system is not a burden to the company. For feasibility analysis, some
understanding of the major requirements for the system is essential.
Three key considerations involved in the feasibility analysis are
 ECONOMICAL FEASIBILITY
 TECHNICAL FEASIBILITY
 SOCIAL FEASIBILITY
ECONOMICAL FEASIBILITY
This study is carried out to check the economic impact that the system will have
on the organization. The amount of fund that the company can pour into the research and
development of the system is limited. The expenditures must be justified. Thus the
developed system as well within the budget and this was achieved because most of the
technologies used are freely available. Only the customized products had to be purchased.
TECHNICAL FEASIBILITY
This study is carried out to check the technical feasibility, that is, the technical
requirements of the system. Any system developed must not have a high demand on the
available technical resources. This will lead to high demands on the available technical
resources. This will lead to high demands being placed on the client. The developed
system must have a modest requirement, as only minimal or null changes are required for
implementing this system.

8
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 3: System Analysis

SOCIAL FEASIBILITY
The aspect of study is to check the level of acceptance of the system by the user.
This includes the process of training the user to use the system efficiently. The user must
not real threatened by the system, instead must accept it as a necessity. The level of
acceptance by the users solely depends on the methods that are employed to educate the
user about the system and to make him familiar with it. His level of confidence must be
raised so hat he is also able to make some constructive criticism, which is welcomed, as
he is the final user of the system.

3.4 MODULES
3.4.1 Data owner
In this module, the data owner should register by providing user name, password,
email and group, after registering owner has to Login by using valid user name and
password. The Data owner browses and uploads their data to the cloud server. For the
security purpose the data provider encrypts the data file and then stores in the cloud
server and manipulating the following operations such as My Profile, Request Resource
Renting, View Request Processed Details, Upload Resource, View All My Uploaded
File, Upload Video Resource, View All My Uploaded Videos, View All My Remaining
Memory.

3.4.2 Key Server


The Key server is responsible for generating the keys for different users and can View
Secret Key Requests.

3.4.3 Cloud Server


The cloud server is responsible for data storage and file authorization for an end
user. The data file will be stored in cloud server with their tags such as View All Users
and Authorize, Create Virtual Machine, View All User Resource Task Renting Request
and Process, View All User Resources Task with rank, View All User Video Resources
Task with rank, View All VM Usage with Date and Time, View All Expired Resource
Task Renting Users, View Download Request and Authorize, View All Resources Task

9
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 3: System Analysis

Rank in Chart, View All Video Resources Rank in Chart, View VM1,VM2 Memory in
Chart, View Users Memory Usage in Chart, View Users No. Of Task in Chart.
3.4.4 Data Consumer (End User)
The data consumer is nothing but the end user who will request and gets file
contents response from the corresponding cloud servers and performs the following
operations such as My Profile, Request Secret Key, Search Files, Search Videos, Send
File Download Request, Download Permitted Files.

10
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 4: H/W & S/W
Requirements

4. HARDWARE AND SOFTWARE REQUIREMENT


SPECIFICATIONS
4.1 H/W REQUIREMENTS
Processor : Pentium –III/Above
Speed : 1.1 Ghz
RAM : 256 MB(min)
Hard Disk : 120 GB

4.2 SOFTWARE REQUIREMENTS


Operating system : Windows XP/7.
Coding Language : Java/J2EE
Web Server : Tomcat7.x
Database : MySQL5.5

11
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 5: System Design

5. SYSTEM DESIGN
5.1 INTRODUCTION
It is a language to specifying, visualizing and constructing the artifacts of
software system as well as for business models. UML was originally motivated by the
desire to standardize the disparate notational system and approaches to software design
developed by Grady Booch, Ivar Jacobson and James Rumbaugh at Rational Software in
1994-95. The UML notation is useful for graphically depicting Object Oriented Analysis
and Object Oriented Design modules. The unified modeling language is a standard
language for specifying, Visualizing, Constructing and documenting the software system
and its components. It is a graphical language that provides a vocabulary and set of
semantics and rules. The UML focuses on the conceptual and physical representation of
the system. It captures the decisions and understandings about systems that must be
constructed. It is used to understand, design, configure, maintain and control information
about the systems.
An Overview of UML
The Unified Modeling Language is a language for
 Visualizing.
 Specifying.
 Constructing.
 Documenting.
UML Models
User model view
 This view represents the system from the user’s perspective.
 The analysis representation describes a usage scenario from the end-users
perspective.
Structural model view
 In this model the data and functionality are arrived from inside the system.
 This model view models the static structures.
Behavioral model view

12
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 5: System Design

It represents the dynamic of Behavioral as parts of the system, depicting the


interactions of collection between various structural elements described in the user model
and structural model view.
Implementation model view
In this the structural and behavioral as parts of the system are represented as they
are to be built.
Environmental model view
In this the structural and Behavioral aspects of the environment in which the
system is to be implemented are represented. UML is specifically constructed through
two different domains they are
 UML Analysis modeling, this focuses on the user model and structural model
views of the system.
 UML design modeling, which focuses on the Bahavioural modeling,
implementation modeling and environmental model views.
A Conceptual model of UML
 The three major elements of UML are
 The UML’s basic building blocks.
 The rules that dictate how those building blocks may be put together.
 Some common mechanisms that apply throughout the UML.
Basic building blocks of the UML
The vocabulary of UML encompasses three kinds of building blocks
 Things.
 Relationships.
 Diagrams.
Things
Things are the abstractions that are first-class citizens in a model. Relationships
tie these things together. Diagrams group the interesting collection of things. There are
four kinds of things in the UML
Structural things
Behavioral things
Grouping things

13
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 5: System Design

Annotational things
Structural Things
Structural things are the nouns of the UML models. These are mostly static parts
of the model, representing elements that are either conceptual or physical. In all, there
are seven kinds of Structural things.
Use Case
Use case is a description of a set of sequence of actions that a system performs
that yields an observable result of value to a particular things in a model. Graphically,
Use Case is rendered as an ellipse with dashed lines, usually including only its name as
shown below.

Fig : Sample Use case diagram


Class
A class is a description of a set of objects that share the same attributes,
operations, relationships, and semantics. A class implements one or more interfaces.
Graphically a class is rendered as a rectangle, usually including its name, attributes and
operations, as shown below.
Windows
Origin
Size
Open()
Close()
Move()
Display()

Fig :Sample Class Diagram


Interface
An interface is a collection of operations that specify a service of a class or
component. An interface describes the externally visible behaviour of element.
Graphically the interface is rendered as a circle together with its name.

Fig : Interface

14
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 5: System Design

Collaboration
Collaboration defines an interaction and is a society of roles and other elements
that work together to provide some cooperative behaviour that’s bigger than the sum of
all the elements. Graphically, collaboration is rendered as an ellipse with dashed lines,
usually including only its name as shown below.

Fig : Sample Collaboration Diagram

Component
Component is a physical and replaceable part of a system that conforms to and
provides the realization of a set of interfaces. Graphically, a component is rendered as a
rectangle with tabs, usually including only its name, as shown below.

Fig : Sample Component Diagram


Node
A Node is a physical element that exists at run time and represents a
computational resource, generally having at least some memory and often, processing
capability. Graphically, a node is rendered as a cube, usually including only its name, as
shown below.

Fig : Sample Node Diagram

Behavioral Things
Behavioral things are the dynamic parts of UML models. These are the verbs of a
model, representing behavior over time and space.

15
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 5: System Design

Interaction
An interaction is a behavior that comprises a set of messages exchanged among a
set of objects within a particular context to accomplish a specific purpose.

Display
Fig : Sample Interaction Diagram
State Machine
A state machine is a behavior that specifies the sequence of states an object or an
interaction goes through during its lifetime on response to events, together with its
responses to those events. Graphically, a state is rendered as rounded rectangle usually
including its name and its sub-states, if any, as shown below.

Fig : Sample State Machine


3. Grouping Things
Grouping things are the organizational parts of the UML models. These are the
boxes into which a model can be decomposed.
Package A package is a general-purpose mechanism for organizing elements into
groups.

Fig : Sample Package Diagram


Annotational Things
Annotational things are the explanatory parts of the UML models.
Notes
A note is simply a symbol for rendering constraints and comments attached to an
element or a collection of elements. Graphically a note is rendered as a rectangle with
dog-eared corner together, with a textual or graphical comment, as shown below.

16
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 5: System Design

Fig : Sample Note Diagram


Relationships in the UML
There are four kinds of relationships in the UML
 Dependency.
 Association.
 Generalization.
 Realization.
These relationships are the basic relational building blocks of the UML. You use
them to write well-formed models. Graphically dependency is rendered as a dashed line,
possibly directed, and occasionally including a label.
------------------->
Fig : Dependency
Second, an association is a structural relationship that describes a set of links, a
link being a connection among objects. Aggregation is a special kind of association,
representing a structural relationship between a whole and its parts. Graphically, an
association is rendered as a solid line, possibly directed, occasionally including a label,
and often containing other adornments, such as multiplicity and role names.
Employer Employee
Fig : Association

Third, a generalization is a specialization/generalization relationship in which


objects of the specialized element are substitutable for objects of the generalized element
(the parent). In this way, the child shares the structure and the behavior of the parent.
Graphically a generalization relationship is rendered as a solid line with a hollow
arrowhead pointing to the parent.

17
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 5: System Design

Fig : Generalization
Fourth, a realization is a semantic relationship between classifiers, wherein one
classifier specifies a contract that another classifier guarantees to carry out. You’ll
encounter realization relationships in two places between interfaces and the classes or
components that realize them and between use cases and the collaborations that realize
them.

Fig : Realization
Each UML diagram is designed to let developers and customers view a software
system from a different perspective and in varying degrees of abstraction. Use Case
Diagram displays the relationship among actors and use cases.
Class Diagram models class structure and contents using design elements such as classes,
packages and objects. It also displays relationships such as containment, inheritance,
associations and others.
Interaction Diagrams
Sequence Diagram displays the time sequence of the objects participating in the
interaction. This consists of the vertical dimension (time) and horizontal dimension
(different objects).
 Collaboration Diagram displays an interaction organized around the objects and
their links to one another. Numbers are used to show the sequence of messages.
 State Diagram displays the sequences of states that an object of an interaction
goes through during its life in response to received stimuli, together with its
responses and actions.

Activity Diagram
Activity Diagram displays a special state diagram where most of the states are
action states and most of the transitions are triggered by completion of the actions in the
source states. This diagram focuses on flows driven by internal processing.

18
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 5: System Design

Physical Diagrams
 Component Diagram displays the high level packaged structure of the code itself.
Dependencies among components are shown, including source code components,
binary code components, and executable components. Some components exist at
compile time, at link time, at run times well as at more than one time.
 Deployment Diagram displays the configuration of run-time processing elements
and the software components, processes, and objects that live on them. Software
component instances represent run-time manifestations of code.
5.2 UML DIAGRAMS
5.2.1 Use Case Diagram
Use-case diagram graphically depict system behavior. These diagrams present a
high level view of how the system is used as viewed from an outsider’s (actor’s)
perspective. A use-case diagram may depict all or some of the use cases of a system.
A use-case diagram can contain:
 Actors
 Use cases
Interaction or relationship between actor and use cases in the system including the
associations, dependencies, and generalizations. Use-case diagram can be used during
analysis to capture the system requirements and to understand how the system should
work. During the design phase, you can use use-case diagrams to specify the behavior of
the systems implemented.

Use Case Diagram

19
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 5: System Design

FIG:Usecase Diagram

20
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 5: System Design

5.2.2 CLASS DIAGRAM


In software engineering, a class diagram in the Unified Modeling Language (UML)
is a type of static structure diagram that describes the structure of a system by showing
the system's classes, their attributes, operations (or methods), and the relationships among
the classes. It explains which class contains information.

FIG: Class Diagram

21
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 5: System Design

5.2.3 SEQUENCE DIAGRAM

A sequence diagram in Unified Modeling Language (UML) is a kind of


interaction diagram that shows how processes operate with one another and in what
order. It is a construct of a Message Sequence Chart. Sequence diagrams are sometimes
called event diagrams, event scenarios, and timing diagrams.

Fig : Sequence Diagram

22
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 6: Implementation

6. IMPLEMENTATION
6.1 TECHNOLOGY USED
Java technology is both a programming language and a platform.
The Java Programming Language
The Java programming language is a high-level language that can be
characterized by all of the following buzzwords:
 Simple
 Architecture neutral
 Object oriented
 Portable
 Distributed
 High performance
 Interpreted
 Multithreaded
 Robust
 Dynamic
 Secure
With most programming languages, you either compile or interpret a program so
that you can run it on your computer. The Java programming language is unusual in that
a program is both compiled and interpreted. With the compiler, first you translate a
program into an intermediate language called Java byte codes —the platform-
independent codes interpreted by the interpreter on the Java platform. The interpreter
parses and runs each Java byte code instruction on the computer. Compilation happens
just once; interpretation occurs each time the program is executed. The following figure
illustrates how this works.

Fig 6.1.1 : Java Compiler Architecture

23
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 6: Implementation

You can think of Java byte codes as the machine code instructions for the Java
Virtual Machine (Java VM). Every Java interpreter, whether it’s a development tool or a
Web browser that can run applets, is an implementation of the Java VM. Java byte codes
help make “write once, run anywhere” possible. You can compile your program into byte
codes on any platform that has a Java compiler. The byte codes can then be run on any
implementation of the Java VM. That means that as long as a computer has a Java VM,
the same program written in the Java programming language can run on Windows 2000,
a Solaris workstation, or on an iMac.

Fig 6.1.2 : Platform Independent Architecture


The Java Platform
A platformis the hardware or software environment in which a program runs.
We’ve already mentioned some of the most popular platforms like Windows 2000,
Linux, Solaris, and MacOS. Most platforms can be described as a combination of the
operating system and hardware. The Java platform differs from most other platforms in
that it’s a software-only platform that runs on top of other hardware-based platforms.
The Java platform has two components:
 The Java Virtual Machine (Java VM)
 TheJava Application Programming Interface (Java API)
You’ve already been introduced to the Java VM. It’s the base for the Java
platform and is ported onto various hardware-based platforms.
The Java API is a large collection of ready-made software components that
provide many useful capabilities, such as graphical user interface (GUI) widgets. The

24
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 6: Implementation

Java API is grouped into libraries of related classes and interfaces; these libraries are
known as packages. The next section, What Can Java Technology Do? Highlights what
functionality some of the packages in the Java API provide.
The following figure depicts a program that’s running on the Java platform. As
the figure shows, the Java API and the virtual machine insulate the program from the
hardware.

Native code is code that after you compile it, the compiled code runs on a specific
hardware platform. As a platform-independent environment, the Java platform can be a
bit slower than native code. However, smart compilers, well-tuned interpreters, and just-
in-time byte code compilers can bring performance close to that of native code without
threatening portability.
What Can Java Technology Do?
The most common types of programs written in the Java programming language
are applets and applications. If you’ve surfed the Web, you’re probably already familiar
with applets. An applet is a program that adheres to certain conventions that allow it to
run within a Java-enabled browser.
However, the Java programming language is not just for writing cute, entertaining
applets for the Web. The general-purpose, high-level Java programming language is also
a powerful software platform. Using the generous API, you can write many types of
programs.
An application is a standalone program that runs directly on the Java platform. A
special kind of application known as a server serves and supports clients on a network.
Examples of servers are Web servers, proxy servers, mail servers, and print servers.
Another specialized program is a servlet. A servlet can almost be thought of as an applet
that runs on the server side. Java Servlets are a popular choice for building interactive
web applications, replacing the use of CGI scripts. Servlets are similar to applets in that

25
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 6: Implementation

they are runtime extensions of applications. Instead of working in browsers, though,


servlets run within Java Web servers, configuring or tailoring the server.
How does the API support all these kinds of programs? It does so with packages
of software components that provides a wide range of functionality. Every full
implementation of the Java platform gives you the following features:
 The essentials: Objects, strings, threads, numbers, input and output, data
structures, system properties, date and time, and so on.
 Applets: The set of conventions used by applets.
 Networking: URLs, TCP (Transmission Control Protocol), UDP (User
Data gram Protocol) sockets, and IP (Internet Protocol) addresses.
 Internationalization: Help for writing programs that can be localized for
users worldwide. Programs can automatically adapt to specific locales and
be displayed in the appropriate language.
 Security: Both low level and high level, including electronic signatures,
public and private key management, access control, and certificates.
 Software components: Known as JavaBeansTM, can plug into existing
component architectures.
 Object serialization: Allows lightweight persistence and communication
via Remote Method Invocation (RMI).
 Java Database Connectivity (JDBCTM): Provides uniform access to a
wide range of relational databases.
The Java platform also has APIs for 2D and 3D graphics, accessibility, servers,
collaboration, telephony, speech, animation, and more. The following figure depicts what
is included in the Java 2 SDK.

26
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 6: Implementation

Fig 6.1.3 : JRE


6.2 METHODS OF IMPLEMENTATIONS
JDBC
In an effort to set an independent database standard API for Java; Sun
Microsystems developed Java Database Connectivity, or JDBC. JDBC offers a generic
SQL database access mechanism that provides a consistent interface to a variety of
RDBMSs. This consistent interface is achieved through the use of “plug-in” database
connectivity modules, or drivers. If a database vendor wishes to have JDBC support, he
or she must provide the driver for each platform that the database and Java run on.
To gain a wider acceptance of JDBC, Sun based JDBC’s framework on ODBC.
As you discovered earlier in this chapter, ODBC has widespread support on a variety of
platforms. Basing JDBC on ODBC will allow vendors to bring JDBC drivers to market
much faster than developing a completely new connectivity solution.
JDBC was announced in March of 1996. It was released for a 90 day public
review that ended June 8, 1996. Because of user input, the final JDBC v1.0 specification
was released soon after.
The remainder of this section will cover enough information about JDBC for you to know
what it is about and how to use it effectively. This is by no means a complete overview of
JDBC. That would fill an entire book.
JDBC Goals
Few software packages are designed without goals in mind. JDBC is one that,
because of its many goals, drove the development of the API. These goals, in conjunction

27
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 6: Implementation

with early reviewer feedback, have finalized the JDBC class library into a solid
framework for building database applications in Java.
The goals that were set for JDBC are important. They will give you some insight as to
why certain classes and functionalities behave the way they do. The eight design goals
for JDBC are as follows:
IP datagram’s
The IP layer provides a connectionless and unreliable delivery system. It
considers each datagram independently of the others. Any association between datagram
must be supplied by the higher layers. The IP layer supplies a checksum that includes its
own header. The header includes the source and destination addresses. The IP layer
handles routing through an Internet. It is also responsible for breaking up large datagram
into smaller ones for transmission and reassembling them at the other end.
UDP
UDP is also connectionless and unreliable. What it adds to IP is a checksum for
the contents of the datagram and port numbers. These are used to give a client/server
model - see later.
TCP
TCP supplies logic to give a reliable connection-oriented protocol above IP. It
provides a virtual circuit that two processes can use to communicate
Internet addresses
In order to use a service, you must be able to find it. The Internet uses an address
scheme for machines so that they can be located. The address is a 32 bit integer which
gives the IP address. This encodes a network ID and more addressing.
Network address
Class A uses 8 bits for the network address with 24 bits left over for other
addressing. Class B uses 16 bit network addressing. Class C uses 24 bit network
addressing and class D uses all 32.
Subnet address
Internally, the UNIX network is divided into sub networks. Building 11 is
currently on one sub network and uses 10-bit addressing, allowing 1024 different hosts.

28
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 6: Implementation

Host address
8 bits are finally used for host addresses within our subnet. This places a limit of
256 machines that can be on the subnet.
Total Address
The 32 bit address is usually written as 4 integers separated by dots.
Port addresses
A service exists on a host, and is identified by its port. This is a 16 bit number. To
send a message to a server, you send it to the port for that service of the host that it is
running on. This is not location transparency! Certain of these ports are "well known".
Sockets
A socket is a data structure maintained by the system to handle network
connections. A socket is created using the call socket. It returns an integer that is like a
file descriptor. In fact, under Windows, this handle can be used with Read File and Write
File functions.
#include <sys/types.h>
#include <sys/socket.h>
int socket(int family, int type, int protocol);
Here "family" will be AF_INET for IP communications, protocol will be zero, and type
will depend on whether TCP or UDP is used. Two processes wishing to communicate
over a network create a socket each. These are similar to two ends of a pipe - but the
actual pipe does not yet exist.
JFree Chart
JFreeChart is a free 100% Java chart library that makes it easy for developers to
display professional quality charts in their applications. JFreeChart's extensive feature set
includes:
A consistent and well-documented API, supporting a wide range of chart types;
A flexible design that is easy to extend, and targets both server-side and client-side
applications;
Support for many output types, including Swing components, image files
(including PNG and JPEG), and vector graphics file formats (including PDF, EPS and
SVG);

29
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 6: Implementation

JFreeChart is "open source" or, more specifically, free software. It is distributed


under the terms of the GNU Lesser General Public Licence (LGPL), which permits use in
proprietary applications.
Map
Charts showing values that relate to geographical areas. Some examples include:
(a) population density in each state of the United States, (b) income per capita for each
country in Europe, (c) life expectancy in each country of the world. The tasks in this
project include:
Sourcing freely redistributable vector outlines for the countries of the world,
states/provinces in particular countries (USA in particular, but also other areas).
Creating an appropriate dataset interface (plus default implementation), a rendered, and
integrating this with the existing XYPlot class in JFreeChart;
Testing, documenting, testing some more, documenting some more.
Implement a new (to JFreeChart) feature for interactive time series charts --- to display a
separate control that shows a small version of ALL the time series data, with a sliding
"view" rectangle that allows you to select the subset of the time series data to display in
the main chart.
Dashboards
There is currently a lot of interest in dashboard displays. Create a flexible
dashboard mechanism that supports a subset of JFreeChart chart types (dials, pies,
thermometers, bars, and lines/time series) that can be delivered easily via both Java Web
Start and an applet.
Property Editors
The property editor mechanism in JFreeChart only handles a small subset of the
properties that can be set for charts. Extend (or reemployment) this mechanism to provide
greater end-user control over the appearance of the charts.
J2ME (Java 2 Micro edition)
Sun Microsystems defines J2ME as "a highly optimized Java run-time
environment targeting a wide range of consumer products, including pagers, cellular
phones, screen-phones, digital set-top boxes and car navigation systems." Announced in
June 1999 at the JavaOne Developer Conference, J2ME brings the cross-platform

30
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 6: Implementation

functionality of the Java language to smaller devices, allowing mobile wireless devices to
share applications. With J2ME, Sun has adapted the Java platform for consumer products
that incorporate or are based on small computing devices.
6.3 DATABASE
SQL Level API
The designers felt that their main goal was to define a SQL interface for Java.
Although not the lowest database interface level possible, it is at a low enough level for
higher-level tools and APIs to be created. Conversely, it is at a high enough level for
application programmers to use it confidently. Attaining this goal allows for future tool
vendors to “generate” JDBC code and to hide many of JDBC’s complexities from the end
user.
1.SQL Conformance
SQL syntax varies as you move from database vendor to database vendor. In an effort
to support a wide variety of vendors, JDBC will allow any query statement to be passed
through it to the underlying database driver. This allows the connectivity module to
handle non-standard functionality in a manner that is suitable for its users.
1. JDBC must be implemental on top of common database interfaces
The JDBC SQL API must “sit” on top of other common SQL level APIs. This
goal allows JDBC to use existing ODBC level drivers by the use of a software interface.
This interface would translate JDBC calls to ODBC and vice versa.
2. Provide a Java interface that is consistent with the rest of the Java system
Because of Java’s acceptance in the user community thus far, the designers feel
that they should not stray from the current design of the core Java system.
3. Keep it simple
This goal probably appears in all software design goal listings. JDBC is no
exception. Sun felt that the design of JDBC should be very simple, allowing for only one
method of completing a task per mechanism. Allowing duplicate functionality only
serves to confuse the users of the API.
4. Use strong, static typing wherever possible
Strong typing allows for more error checking to be done at compile time; also,
less error appear at runtime.

31
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 6: Implementation

5. Keep the common cases simple


Because more often than not, the usual SQL calls used by the programmer are
simple SELECT’s, INSERT’s, DELETE’s and UPDATE’s, these queries should be
simple to perform with JDBC. However, more complex SQL statements should also be
possible.
They are,
1. TABLE
2. QUERY
3. FORM
4. REPORT
5. MACRO
Table: A database is a collection of data about a specific topic.
Views Of Table: We can work with a table in two types,
1. Design View
2. Datasheet View
Design View: To build or modify the structure of a table we work in the table design
view. We can specify what kind of data will be hold.
Datasheet View: To add, edit or analyses the data itself we work in tables datasheet view
mode.
Query: A query is a question that has to be asked the data. Access gathers data that
answers the question from one or more table. The data that make up the answer is either
dynaset (if you edit it) or a snapshot (it cannot be edited).Each time we run query, we get
latest information in the dynaset. Access either displays the dynaset or snapshot for us to
view or perform an action on it, such as deleting or updating.

32
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 7: Sample Code

7. SAMPLE CODE
Connect.jsp
<%@ page import="java.sql.*"%>
<%@ page import="java.util.*" %>
<%
Connection connection = null;
try {
Class.forName("com.mysql.jdbc.Driver");
connection =
DriverManager.getConnection("jdbc:mysql://localhost:3306/ppms","root","root");
String sql="";
}
catch(Exception e)
{
System.out.println(e);
}
%>
U_Upload_res1.jsp
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Upload Resource</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/coin-slider.css" />
<script type="text/javascript" src="js/cufon-yui.js"></script>
<script type="text/javascript" src="js/cufon-aller.js"></script>

33
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 7: Sample Code

<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>


<script type="text/javascript" src="js/script.js"></script>
<script type="text/javascript" src="js/coin-slider.min.js"></script>

<style type="text/css">
<!--
.style1 {
font-size: 23px;
color: #FFFFFF;
font-weight: bold;
}
.style2 {font-size: 25px}
.style4 {
font-size: 26px;
color: #78bbe6;
}
.style8 {color: #00a3e0}
.style9 {font-size: 15px}
.style10 {font-family: "Times New Roman", Times, serif}
.style11 {font-size: 26px; color: #78bbe6; font-family: "Times New Roman", Times,
serif; }
.style12 {font-size: 20px}
.style14 {font-size: 20px; color: #0000FF; font-family: "Times New Roman", Times,
serif; }
.style15 {color: #0000FF}
-->
</style>
</head>

34
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 7: Sample Code

<body>
<div class="main">
<div class="header">
<div class="header_resize">
<div class="logo">
<p>&nbsp;</p>
<p class="style1 style2">Privacy Preserving Media Sharing with Scalable Access
Control </p>
<p class="style1 style2"> and Secure Deduplication in Mobile Cloud
Computing </p>
</div>
<div class="menu_nav">
<ul>
<li><a href="index.html"><span>Home Page</span></a></li>
<li><a href="a_login.jsp"><span>CSP</span></a></li>
<li class="active"><a href="u_login.jsp"><span>End User</span></a></li>
</ul>
</div>
<div class="clr"></div>
<div class="slider">
<div id="coin-slider"> <a href="#"><img src="images/slide1.jpg" width="960"
height="320" alt="" /> </a> <a href="#"><img src="images/slide2.jpg" width="960"
height="320" alt="" /> </a> <a href="#"><img src="images/slide3.jpg" width="960"
height="320" alt="" /> </a> </div>
<div class="clr"></div>
</div>
<div class="clr"></div>
</div>
</div>

35
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 7: Sample Code

<div class="content">
<div class="content_resize">
<div class="mainbar">
<div class="article">
<h2 align="center" class="style8"> Add Image and Upload </h2>
<p>&nbsp;</p>

<%
String fname=request.getParameter("fname");
String text=request.getParameter("text");
String ftags=request.getParameter("ftags");
String fuses=request.getParameter("fuses");
String vname=request.getParameter("vname");
String csp=request.getParameter("csp");

%>

<form name="s" action="u_upload_res2.jsp" enctype="multipart/form-data"


method="post" onSubmit="return valid()" ons target="_top">
<table width="598" border="1" align="center" cellspacing="0" cellpadding="10">

36
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 7: Sample Code

<tr>
<td bgcolor="#00FFFF" class="style4 style10 style11 style12"><div
align="center" class="style3 style10 style12 style15">File Name :- </div></td>
<td bgcolor="#CC66FF"><input name="fname" type="text" id="fname"
size="50" value="<%=fname%>" /></td>
</tr>

<tr>
<td bgcolor="#00FFFF"><div align="center" class="style14">Content :-
</div></td>
<td bgcolor="#CC66FF"><textarea name="text" id="textarea" cols="50"
rows="15"><%=text%></textarea></td>
</tr>

<tr>
<td bgcolor="#00FFFF" class="style4 style10 style11 style12"><div
align="center" class="style3 style10 style12 style15">Tags :- </div></td>
<td bgcolor="#CC66FF"><textarea name="ftags" id="textarea" cols="50"
rows="3"><%=ftags%></textarea></td>
</tr>

<tr>
<td bgcolor="#00FFFF" class="style4 style10 style11 style12"><div
align="center" class="style3 style10 style12 style15">Uses :- </div></td>
<td bgcolor="#CC66FF"><textarea name="fuses" id="textarea" cols="50"
rows="3"><%=fuses%></textarea></td>
</tr>

<tr>

37
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 7: Sample Code

<td bgcolor="#00FFFF" class="style4 style10 style11 style12"><div


align="center" class="style3 style10 style12 style15"> Selected VM :- </div></td>
<td bgcolor="#CC66FF"><input name="vname" type="text" id="vname"
value="<%=vname%>" size="50" readonly /></td>
</tr>

<tr>
<td bgcolor="#00FFFF" class="style4 style10 style11 style12"><div
align="center" class="style3 style10 style12 style15"> CSP :- </div></td>
<td bgcolor="#CC66FF"><input name="csp" type="text" id="csp" value="<
%=csp%>" size="50" readonly /></td>
</tr>

<tr>
<td bgcolor="#00FFFF" class="style4 style10 style11 style12"><div
align="center" class="style3 style10 style12 style15">Select Image :- </div></td>
<td width="356" bgcolor="#CC66FF"><input type="file" id="pic" name="pic"
class="text" required="required" /></td>
</tr>

<tr>
<td bgcolor="#00FFFF"><div align="center"><span class="style10"><span
class="style11"><span class="style12"><span class="style10"><span
class="style12"><span
class="style15"></span></span></span></span></span></span></div></td>
<td bgcolor="#CC66FF"><input type="submit" name="Submit"
value="Upload" /></td>
</tr>
</table>
</form>

38
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 7: Sample Code

<p>&nbsp;</p>
<p align="right"><a href="u_upload_res.jsp" class="style9"> Back
</a></p>
</div>
</div>
<div class="sidebar">
<div class="gadget">
<p class="style4">User Menu</p>
<ul class="sb_menu">
<li><a href="u_main.jsp">User Main</a></li>
<li><a href="u_login.jsp">Log Out</a></li>
</ul>
</div>
</div>
<div class="clr"></div>
</div>
</div>
<div class="fbg"></div>
<div class="footer">
<div class="footer_resize">
<div style="clear:both;"></div>
</div>
</div>
</div>
<div align=center></div>
</body>
</html>
Update_image.jsp

39
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 7: Sample Code

<%@page
import="com.oreilly.servlet.*,java.sql.*,java.lang.*,java.text.SimpleDateFormat,java.util.
*,java.io.*,javax.servlet.*, javax.servlet.http.*" %>
<%@ page import="java.util.Date" %>
<%@ include file="connect.jsp" %>
<%@ page import ="java.security.Key" %>
<%@ page import ="javax.crypto.Cipher" %>
<%@ page import ="java.math.BigInteger" %>
<%@ page import ="javax.crypto.spec.SecretKeySpec" %>
<%@ page import ="org.bouncycastle.util.encoders.Base64" %>
<%@ page import ="java.security.MessageDigest,java.security.DigestInputStream" %>
<%@ page import
="java.io.PrintStream,java.io.FileOutputStream,java.io.FileInputStream,java.io.BufferedI
nputStream" %>
<%
int id = Integer.parseInt(request.getParameter("id"));
try
{
ServletContext context = getServletContext();
String dirName =context.getRealPath("Gallery/");
String paramname=null;
String image=null;
String com=null;
String uname=null;
String pass=null;
String email=null;
String mno=null;
String gen=null;
String dateOfBirth=null;

40
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 7: Sample Code

String addr=null;
String cont=null;
String state=null;
//String loc=null;
String lat=null;
String lon=null;
FileInputStream fs=null;
File file1 = null;
MultipartRequest multi = new MultipartRequest(request, dirName, 10 * 1024 * 1024); //
10MB
Enumeration params = multi.getParameterNames();
int f = 0;
Enumeration files = multi.getFileNames();
while (files.hasMoreElements())
{
paramname = (String) files.nextElement();
if(paramname != null)
{
f = 1;
image = multi.getFilesystemName(paramname);
String fPath = context.getRealPath("Gallery\\"+image);
file1 = new File(fPath);
fs = new FileInputStream(file1);
}
}
PreparedStatement ps=connection.prepareStatement("update videos set image=? where
id="+id+" ");
ps.setBinaryStream(1, (InputStream)fs, (int)(file1.length()));

41
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 7: Sample Code

int x=ps.executeUpdate();
if(x>0)
{
%>
<p>Image Added Successfully</p>
<p><a href="u_all_up_video.jsp">Back</a></p>
<%
}
}
catch (Exception e)
{
out.println("Please Select Image");
%>
<p><a href="u_all_up_video.jsp">Back</a></p>
<%
}
%>

42
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 8: Testing

8. TESTING
Testing is a process, which reveals errors in the program. It is the major quality
measure employed during software development. During software development, during
testing, the program is executed with a set of test cases and the output of the program for
the test cases is evaluated to determine if the program is performing as it is expected to
perform.

8.1 TESTING METHODOLOGIES


In order to make sure that the system does not have errors, the different
levels of testing strategies to that are applied to at differing phases of software
development.

Unit Testing
Unit testing involves the design of test cases that validate that the internal
program logic is functioning properly, and that program inputs produce valid outputs. All
decision branches and internal code flow should be validated. It is the testing of
individual software units of the application .it is done after the completion of an
individual unit before integration. This is a structural testing, that relies on knowledge of
its construction and is invasive. Unit tests perform basic tests at component level and test
a specific business process, application, and/or system configuration. Unit tests ensure
that each unique path of a business process performs accurately to the documented
specifications and contains clearly defined inputs and expected results.

Integration testing
Integration tests are designed to test integrated software components to determine
if they actually run as one program. Testing is event driven and is more concerned with
the basic outcome of screens or fields. Integration tests demonstrate that although the
components were individually satisfaction, as shown by successfully unit testing, the
combination of components is correct and consistent. Integration testing is specifically
aimed at exposing the problems that arise from the combination of components.

43
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 8: Testing

Functional test
Functional tests provide systematic demonstrations that functions tested are
available as specified by the business and technical requirements, system documentation,
and user manuals.
Functional testing is centered on the following items

Valid Input : identified classes of valid input must be accepted.


Invalid Input : identified classes of invalid input must be rejected.
Functions : identified functions must be exercised.
Output : identified classes of application outputs must be exercised.
Systems/Procedures : interfacing systems or procedures must be invoked.
Organization and preparation of functional tests is focused on requirements, key
functions, or special test cases. In addition, systematic coverage pertaining to identify
Business process flows; data fields, predefined processes, and successive processes must
be considered for testing. Before functional testing is complete, additional tests are
identified and the effective value of current tests is determined.

System Test
System testing ensures that the entire integrated software system meets
requirements. It tests a configuration to ensure known and predictable results. An
example of system testing is the configuration oriented system integration test. System
testing is based on process descriptions and flows, emphasizing pre-driven process links
and integration points.

Black Box Testing


In this strategy some test cases are generated as input conditions that fully execute
all functional requirements for the program. This testing has been uses to find errors in
the following categories:

 Incorrect or missing functions


 Interface errors
 Errors in data structure or external database access
 Performance errors

44
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 8: Testing

 Initialization and termination errors.


In this testing only the output is checked for correctness. The logical flow of the data
is not checked.

White Box Testing


In this the test cases are generated on the logic of each module by drawing flow
graphs of that module and logical decisions are tested on all the cases. It has been uses to
generate the test cases in the following cases:

 Guarantee that all independent paths have been executed.


 Execute all logical decisions on their true and false Sides.
 Execute all loops at their boundaries and within their operational bounds
 Execute internal data structures to ensure their validity.

Integrating Testing

Integration testing ensures that software and subsystems work together a whole.
It tests the interface of all the modules to make sure that the modules behave properly
when integrated together.

System Testing

Here the entire software system is tested. The reference document for this process
is the requirements document, and the goal is to see if software meets its requirements.
Here entire ‘Cybernetic Protectors Application’ has been tested against requirements of
project and it is checked whether all requirements of project have been satisfied or not.

Acceptance Testing

Acceptance Test is performed with realistic data of the client to demonstrate that
the software is working satisfactorily. Testing here is focused on external behavior of the
system; the internal logic of program is not emphasized. In this project ‘Cybernetic
Protectors Application’ I have collected some data and tested whether project is working
correctly or not. Test cases should be selected so that the largest number of attributes of

45
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 8: Testing

an equivalence class is exercised at once. The testing phase is an important part of


software development. It is the process of finding errors and missing operations and also
a complete verification to determine whether the objectives are met and the user
requirements are satisfied.

8.2 TEST APPROACH


Testing can be done in two ways:

 Bottom up approach
 Top down approach
Bottom Up Approach

Testing can be performed starting from smallest and lowest level modules and
proceeding one at a time. For each module in bottom up testing a short program executes
the module and provides the needed data so that the module is asked to perform the way
it will when embedded with in the larger system.

Top down Approach


This type of testing starts from upper level modules. Since the detailed activities
usually performed in the lower level routines are not provided stubs are written. A stub is
a module shell called by upper level module and that when reached properly will return a
message to the calling module indicating that proper interaction occurred. No attempt is
made to verify the correctness of the lower level module.
Validation

The system has been tested and implemented successfully and thus ensured that all
the requirements as listed in the software requirements specification are completely
fulfilled. In case of erroneous input corresponding error messages are displayed.

46
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 8: Testing

8.3 TEST CASES

EXPECTED
S. No. TEST CASES INPUT ACTUAL RESULT STATUS
RESULT

Registration
User User gets
1 Enter all fields Pass
Registration registered
is successful

Registration is
if user miss User not
2 User Fail
any field registered
Registration un successful

Server home
Give the server
Cloud Server page should Sever home Page
3 name and Pass
Login has been opened
password
be opened

Cloud page
Give Username Cloud page has
4 Cloud Login should be Pass
and password been opened
opened

Give
Login Success
Data Owner Ownername Owner Page
5 fully and Owner Pass
Login has to Display
Page is Displayed
And Password

Upload video Enter All the Details Should File Uploaded


6 Pass
File Details be Upload Success Fully

Table 8.3.1: Test Case Results

47
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 9: Screens

9. SCREENS

9.1 Home Page

48
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 9: Screens

9.2 Owner Main

49
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 9: Screens

9.3 Cloud Main

50
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 9: Screens

9.4 Create Virtual Machine

51
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 9: Screens

9.5 View All Download Request

52
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 9: Screens

9.6 View All Resource Task Renting Request and Process

53
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 9: Screens

9.7 Upload File

54
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 9: Screens

9.8 Upload Video File

55
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 9: Screens

9.9 Enter Secret Key Request

56
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 9: Screens

9.10 Search Videos

57
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 9: Screens

9.11 Search Video On Your Keyword

58
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 9: Screens

9.12 View All Uploaded Video Details

59
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 9: Screens

9.13 View All Files and Send Download Request

60
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 9: Screens

9.14 View All Download Request

61
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 9: Screens

9.15 Key Server Main

62
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 10: Conclusion

10. CONCLUSION

CONCLUSION
The shared media content in mobile environment is usually encoded into several layers
with the diverse quality after multi-dimensional extension. This brings greater challenges
to data confidentiality and owner-enforced access control. In this paper, we propose a
privacy-preserving media sharing scheme named SMACD in mobile cloud computing by
utilizing CP-ABE technique. The media contributor firstly encodes the media with SVC
standard and enforces access policies to each media layer. Then we provide a multi-level
access policy construction with secret sharing scheme, in which each media layer is
assigned a random secret that is shared by the access tree in this layer, and also the lower
media layers. It ensures that the users who view the higher media layer must satisfy the
access sub-trees at a lower access level. Moreover, we achieve attribute-based intra server
and inter-server ciphertext deduplication, in which the same encrypted media layer could
be associated with different access policies. The experimental evaluation shows that our
scheme has less computational and communication cost, as well as storage overhead than
relative schemes, which is practical for private media sharing in mobile cloud computing.

63
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 11: Future
Enhancements

11. FUTURE ENHANCEMENTS

It is not possible to develop a system that makes all the requirements of the user. User
requirements keep changing as the system is being used. Some of the future enhancements that
can be done to this system are
It is further to implement video also in encrypted format.

64
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 12: Bibliography

12. BIBLIOGRAPHY
[1] Y. Meng, C. Jiang, T. Q. S. Quek, Z. Han, and Y. Ren, “Social Learning Based
Inference for Crowdsensing in Mobile Social Networks,” IEEE Transactions on Mobile
Computing, vol. 17, no. 8, pp. 1966– 1979, Aug. 2018.
[2] T. Taleb, A. Ksentini, M. Chen, and R. Jantti, “CopingWith Emerging Mobile Social
Media Applications Through Dynamic Service Function Chaining,” IEEE Transactions
on Wireless Communications, vol. 15, no. 4, pp. 2859–2871, Apr. 2016.
[3] M. Ambrosin, C. Busold, M. Conti, A.-R. Sadeghi, and M. Schunter, “Updaticator:
Updating Billions of Devices by an Efficient, Scalable and Secure Software Update
Distribution over Untrusted Cache-enabled Networks,” in Computer Security - ESORICS
2014, 2014, pp. 76–93.
[4] “Vimeo Case Study,” https://cloud.google.com/customers/ vimeo.
[5] J. K. Liu, M. H. Au, W. Susilo, K. Liang, R. Lu, and B. Srinivasan, “Secure sharing
and searching for real-time video data in mobile cloud,” IEEE Network, vol. 29, no. 2,
pp. 46–50, Mar. 2015.
[6] Q. Huang, W. Yue, Y. He, and Y. Yang, “Secure Identity-Based Data Sharing and
Profile Matching for Mobile Healthcare Social Networks in Cloud Computing,” IEEE
Access, vol. 6, pp. 36 584–36 594, 2018.
[7] L. Y. Zhang, Y. Zheng, J. Weng, C. Wang, Z. Shan, and K. Ren, “You Can Access
But You Cannot Leak: Defending against Illegal Content Redistribution in Encrypted
Cloud Media Center,” IEEE Transactions on Dependable and Secure Computing, pp. 1–
1, 2018.
[8] D. Lu, J. Sang, Z. Chen, M. Xu, and T. Mei, “Who Are Your Real Friends: Analyzing
and Distinguishing Between Offline and Online Friendships From Social Multimedia
Data,” IEEE Transactions on Multimedia, vol. 19, no. 6, pp. 1299–1313, Jun. 2017.
[9] T. Stutz and A. Uhl, “A Survey of H.264 AVC/SVC Encryption,” IEEE Transactions
on Circuits and Systems for Video Technology, vol. 22, no. 3, pp. 325–339, Mar. 2012.
[10] K. Zhang, X. Liang, X. Shen, and R. Lu, “Exploiting multimedia services in mobile
social networks from security and privacy perspectives,” IEEE Communications
Magazine, vol. 52, no. 3, pp. 58–65, Mar. 2014.
[11] S. Zhao, A. Aggarwal, R. Frost, and X. Bai, “A Survey of Applications of Identity-
Based Cryptography in Mobile Ad-Hoc Networks,” IEEE Communications Surveys
Tutorials, vol. 14, no. 2, pp. 380–400, 2012.
[12] F. Beato, S. Meul, and B. Preneel, “Practical identity-based private sharing for
online social networks,” Computer Communications, vol. 73, pp. 243–250, Jan. 2016.
[13] E. Luo, Q. Liu, and G. Wang, “Hierarchical Multi-Authority and Attribute-Based
Encryption Friend Discovery Scheme in Mobile Social Networks,” IEEE
Communications Letters, vol. 20, no. 9, pp.1772–1775, Sep. 2016.
[14] A. Sahai and B. Waters, “Fuzzy Identity-Based Encryption,” in Advances in
Cryptology EUROCRYPT 2005, 2005, pp. 457–473.
[15] V. Goyal, O. Pandey, A. Sahai, and B. Waters, “Attribute-based Encryption for
Fine-grained Access Control of Encrypted Data,” in Proceedings of the 13th ACM
Conference on Computer and Communications Security, 2006, pp. 89–98.

65
Privacy Preserving Media Sharing with Scalable Access Control and Secure Deduplication Chapter 12: Bibliography

[16] B. Ciubotaru, C. H. Muntean, and G. Muntean, “Mobile Multi- Source High Quality
Multimedia Delivery Scheme,” IEEE Transactions on Broadcasting, vol. 63, no. 2, pp.
391–403, Jun. 2017.
[17] C. Hsu and M. Hefeeda, “Flexible Broadcasting of Scalable Video Streams to
Heterogeneous Mobile Devices,” IEEE Transactions on Mobile Computing, vol. 10, no.
3, pp. 406–418, Mar. 2011.
[18] J. Bethencourt, A. Sahai, and B. Waters, “Ciphertext-Policy Attribute-Based
Encryption,” in 2007 IEEE Symposium on Security and Privacy (SP ’07), 2007, pp. 321–
334.

66

You might also like