crptography
crptography
INTRODUCTION
There has been a rapid growing trend in the recent times in using online services. A
major benefit of using online services is that users can store their data online and access it
from anywhere. However, many online service providers do not have the capacity to store
large amount of users’ data due to high maintenance cost and complexity. Cloud services
such as cloud storage services are providing solutions to address these issues with the ability
to store and manage increasing amount of users’ data stored online. Online service providers
can outsource users’ data to the public cloud while focusing on the service quality. Since a
public cloud is an open platform, and can be subjected to malicious attacks from both insiders
and outsiders, this has raised several security issues such as how to control and prevent
unauthorized access to data stored in the cloud; this also applies to cloud providers
themselves as the owners of the data may not wish the cloud providers to view or access its
content.
1
1.1 ABOUT THE PROJECT
The trust models provide an approach for the owners and roles to determine the
trustworthiness of individual roles and users respectively in the RBAC system. The proposed
trust models take into account role inheritance and hierarchy in the evaluation of
trustworthiness of roles. We present a design of a trust-based cloud storage system which
shows how the trust models can be integrated into a system that uses cryptographic RBAC
schemes. We have also considered practical application scenarios and illustrated how the
trust evaluations can be used to reduce the risks and enhance the quality of decision making
by data owners and roles of cloud storage service.
2
MODULES EXPLANATION
a) Experience-based Trust
b) Role-based Encryption
c) Trust issues in using cryptographic RBAC schemes in secure cloud storage
a) EXPERIENCE-BASED TRUST
Trust has played a foundational role in security for a long period of time. Most
experience-based trust systems derive the trustworthiness of an entity from both its own
experience and the feedback on the transactions provided by other entities which have had
interactions with the entity concerned in the past. Let us consider a simple example of such a
system. When a client c finishes a transaction with a service provider p, c gives a feedback as
either “positive” or “negative” depending on whether or not c is satisfied with the transaction.
The feedback record is of the form f = (c; p; b; t) where b represents the binary value of the
feedback and t is the timestamp when the transaction took place. This record f is uploaded by
the client to a trust central repository.
b) ROLE-BASED ENCRYPTION
A cryptographic RBAC scheme integrates encryption scheme with RBAC model to
enforce the access control policies in an entrusted environment. This approach allows data to
be encrypted in the way that the cipher text can only be decrypted by those which are allowed
by the access policies. A hierarchical cryptographic access control scheme was proposed in
1983. Because of the similarity in structures between hierarchical access control and RBAC,
a hierarchical cryptographic access control scheme can be easily transformed into a
cryptographic RBAC scheme. The problem of access control for securely outsourcing data
using cryptographic techniques was first considered in . Several cryptographic access control
approaches have been investigated to address the problem of secure data access and cost
effective key management in distributed environments. Among the cryptographic RBAC
schemes in the literature, role-based encryption (RBE) schemes have achieved many superior
characteristics compared to other solutions in terms of efficiency and flexibility.
In this section, we review several concepts in RBE schemes and briefly describe how
it works to assist understanding our proposed trust models. We first describe four types of
entities which are involved in a RBE scheme, The system administrator of the system. It
generates the system parameters and issues all the necessary credentials. In addition, this
administrator manages the role hierarchy structure for the RBAC system.
3
c) TRUST ISSUES IN USING CRYPTOGRAPHIC RBAC SCHEMES IN
SECURE CLOUD STORAGE
Trust issues in using cryptographic RBAC schemes in secure cloud storage. By using
cryptographic RBAC schemes in cloud storage systems, a data owner can encrypt the data to
a role, and only the users who have been granted the membership to the role or the ancestor
role of that role can decrypt the data. In this paper, we assume that the data owners and users
reside outside this role system infrastructure (where the roles are being administered). Hence
the issues to consider are how the data owners can decide whether or not to trust the role
managers in the system and how the role managers can decide whether and how much to trust
the users in the system. Owners consider the trust of role managers in order to ensure that
their data is secure after being assigned to the roles, and role managers consider the trust of
users so that users with negative behaviors are excluded from the roles, which in turn makes
owners trust these roles. In this section, we discuss the trust issues that need to be considered
by the data owners and role managers of a cryptographic RBAC system.
4
1.2 ABOUT THE COMPANY
Hewlett Packard Enterprise (HPE) provides total enterprise solutions. They are a
major player in the storage industry and are the closest competitor to Cisco in the Networking
solutions domain. The recent spin-off of HPE from the parent has brought about a greater
clarity of the business .Further, by exiting from loss leaders such as public cloud ,the
management has put significant efforts to bring in a more conservative, leaner and disciplined
strategy that is aligned with HPE’s core competencies of storage, servers, networking and
hybrid cloud services.
A key strategic decision by HPE has been its partnership with Microsoft in the public
cloud domain. By partnering with a flagship Microsoft product such as Azure, the motto of
HPE has been “If you cannot beat them join them. Further the acquisition of Aruba for $3B in
May 2015 has added to its portfolio of offerings in the mobile WLAN space. While M&A
has been a part of HPE, there has been significant talk by the CEO, Meg Whitman, about
organic growth and investment in R&D, necessary to add value to the organization.
We estimate Enterprise Group and Software segment to grow at 2.96% and 3.49% in
2016 and 2017 respectively .Enterprise Group that caters to the core products of HPE is likely
to see strong sales due to its niche products and also due to the sales of Aruba products post
its acquisition by HPE.
5
We expect the negative growth trends to continue for Enterprise services and
Financial Services segment and expect the segments to contract at -5.46% and -5.46% in
2016. Our projections indicate that the cumulative negative top line growth of recent years to
continue into 2016 at a growth rate of -0.66%, while we expect year2017 to set HPE on the
path of a healthy fiscal recovery at a growth rate of 0.41% and the growth to pick up
thereafter. We believe the intrinsic stock value is most closely approximated by the DCF
valuation, which presents a value of $21.52, as it most closely captures the revenue
decomposition and growth forecasts of the different segments of business. The stock
currently trades for around $15.68 and thus we estimate an upside of 37% that can be
captured in the long run. We believe this is a value stock and hence we have given a buy
rating to the stock.
6
2. SYSTEM STUDY
As an extension of the owners’ RBAC trust model, our trust models have also
addressed the roles’ trust on users. The existing works control the access privileges of a user
depending on his or her trust level. The differences between our model and the existing ones
are that our roles’ trust model works in the RBAC systems which use cryptographic RBAC
schemes. That is, our models take into account cryptographic operations and the access
privilege to decrypt the data stored in the cloud, which none of the existing works address.
7
2.2 PROPOSED SYSTEM
The proposed trust models take into account role inheritance and hierarchy in the
evaluation of trustworthiness of roles. We present a design of a trust-based cloud storage
system which shows how the trust models can be integrated into a system that uses
cryptographic RBAC schemes. Many access control models have been proposed over the
years in the literature. In this context, role-based access control (RBAC) is a well-known
access control model which can help to simplify security management especially in large-
scale systems. In the RBE scheme proposed in the paper the users management can be
decentralized to individual roles; that is, the administrators only manage the roles and the
relationship among them while the roles have the flexibility in specifying the user
memberships themselves. The proposed trust models address the missing aspect of trust in
cryptographic RBAC schemes to secure data storage in the cloud, and can provide better
protection of stored data than using cryptographic approaches alone. The paper has
proposed trust models for owners and roles in RBAC systems which are using
cryptographic RBAC schemes to secure stored data.
8
2.3 FEASIBILITY STUDY
Technical Feasibility
The technology used can be developed with the current equipments and has the
technical capacity to hold the data required by the new system. Technical feasibility on the
existing system and to what extend it can support the proposed addition. We can add new
modules easily without affecting the Core program. Most of parts are running in the server
using the concept of stored procedures.
Operational Feasibility
This proposed system can easily be implemented, as this based on ASP coding(C#) &
XML. The resources that are required to implement/install these are available. The personal
of the organization already has enough exposure to computers. So the project is operationally
feasible.
Economical Feasibility
Economic analysis is the most frequently used method for evaluating the effectiveness
of a new system. More commonly known cost / beneficial analysis, the procedure is to
determine the benefits and savings that are expected from a candidate system and compare
them with costs. If benefits outweigh costs, then the decision is made to design and
implement the system. The system is more feasible and so it is economically good project.
9
3. REQUIREMENT ANALYSIS
10
4. SYSTEM ANALYSIS
4.1 DATA FLOW DIAGRAM
i) DEFINITION
A data flow diagram (DFD) is a graphical representation of the "flow" of data
through an information system, modeling its process aspects.
A DFD is often used as a preliminary step to create an overview of the
system, which can later be elaborated. DFDs can also be used for the visualization of data
processing.
CHARACTERISTICS
Information and/or data flow is represented by a labeled arrow
Processes (transformations) are represented by labeled circles (bubbles)
Information sources and sinks are represented by boxes
Files and depositories are represented by a rounded rectangle or a double line.
An entity.
A source
of data or a
destination
for data.
A process
or task that
is
performed
by the
system.
11
A data
store, a
place
where data
is held
between
processes.
A data
flow.
ADVANTAGES OF DFD
DISADVANTAGES OF DFD
DFD undergoes lot of alteration before going to users, so makes the process little
slow.
It make the programmers little confusing towards the system.
Physical consideration are left
12
iii) DATAFLOW DIAGRAM
Level 0 DFD
Database
Level 1 DFD
Access control
Database
Database
User File upload
Admin
Verification
Access Control
13
4.2 ENTITY RELATIONSHIP DIAGRAM
i) DEFINITION
FEATURES
Start with an ERD template then add entities, actions, and attributes by clicking
simple commands in the Smart Panel.
To add an ERD symbol to your page, click on it and without releasing the mouse,
drag it to the page or just click once in the page to stamp it.
To connect an attribute or an action to any entity on the page, select the appropriate
symbol .
1. Entity
An entity is a real-world object.
Eg : student
ENTITY
2. Attribute
An attribute is a property which describes the entity
ATTRIBUTE
3. Relationships
A relationship describes how entities interact.
RELATIONSHI
P
4. Weak entity
14
A weak entity is an entity that depends or derived from another entity.
WEAK ENITITY
5. Weak Attribute
It is also called as multi valued attribute
If an attribute can have more than one value it is called a multi valued
attribute.
It is important to note that this is different to an attribute having its
own attributes.
MULTI VALUED
ATTRIBUTE
6. Weak Relationship
Indirect relationships between the entities are referred as weak
relationships.
WEAK
RELATION
7. Key Attribute
Primary key
Key attribute
8. Composite Attribute
ATTRIBUTE
ATTRIBUTE
ATTRIBUTE
15
iii) ENTITY RELATIONSHIP DIAGRAM
rank
Mobile number
date
Security key
emailid
USER login
age
REGISTRATION
block
gender
password
ownerpwd id
FILE ACCESS
Ownerid
fileid
roles serverkey
auditor
fsubject
tpa
File_REPORT
REGISTRATION_2
filepath
count
fencryptkey
M1
filebytes
status
M2
ftext fowner
M6
M3 filename
M5
M4 fdatetime
16
5. SYSTEM REQUIREMENT SPECIFICATION
17
5.3 SOFTWARE SPECIFICATION
Visual Studio supports different programming languages and allows the code
editor and debugger to support (to varying degrees) nearly any programming
language, provided a language-specific service exists. Built-in languages include C,
C++ and C++/CLI (via Visual C++), VB.NET (via Visual Basic .NET), C# (via
Visual C#), and F# (as of Visual Studio 2010). Support for other languages such as
Python, Ruby, Node.js, and M among others is available via language services
installed separately. It also supports XML/XSLT, HTML/XHTML, JavaScript and
CSS. Java (and J#) was supported in the past.
18
SUPPORTED PRODUCTS
EDITIONS
Community
Professional
Enterprise
Test Professional
Express
19
5.3.2 BACK END SPECIFICATION
FEATURES
20
A tutorial on SQL Server Management Studio to help you take advantage of the many
new features and become more productive right away.
A new activity monitor with filtering and automatic refresh.
Integrated Database Mail interfaces.
CHARACTERISTICS
SQL is an ANSI and ISO standard computer language for creating and manipulating
databases.
SQL allows the user to create, update, delete and retrieve data from a database.
SQL is a very simple and easy to learn.
SQL works with database programs like DB2, Oracle, MS Access, Sybase, MS SQL
Server etc.
ADVANTAGES
High speed: SQL Queries can be used to retrieve large amounts of records from a
database quickly and efficiently.
Well Defined Standards Exist: SQL databases use long-established standard, which is
being adopted by ANSI & ISO. Non-SQL databases do not adhere to any clear
standard.
No Coding Required: Using standard SQL it is easier to manage database systems
without having to write substantial amount of code.
Emergence of ORDBMS: Previously SQL databases were synonymous with
relational database. With the emergence of Object Oriented DBMS, object storage
capabilities are extended to relational databases.
6. SYSTEM DESIGN
21
6.1 TABLE DESIGN
DEFINITION
The database management system is software that defines a database, stores the
data, supports query language, produces reports and creates data entry screens.
FEATURES
NORMALIZATION
22
As per First Normal Form, no two Rows of data must contain repeating group
of information i.e each set of column must have a unique value, such that multiple columns
cannot be used to fetch the same row. Each table should be organized into rows, and each
row should have a primary key that distinguishes it as unique.
Example
Example:
Adam 15 Biology
23
Adam 15 Maths
Alex 14 Maths
Student Age
Adam 15
Alex 14
In Student Table the candidate key will be Student column, because all other column
i.e Age is dependent on it.
Student Subject
Adam Biology
Adam Maths
Alex Maths
24
Third Normal form applies that every non-prime attribute of table must be
dependent on primary key, or we can say that, there should not be the case that a non-prime
attribute is determined by another non-prime attribute. So this transitive functional
dependency should be removed from the table and also the table must be in Second Normal
form. For example, consider a table with following fields.
Student_Detail Table
In this table Student_id is Primary key, but street, city and state depends upon Zip. The
dependency between zip and other fields is called transitive dependency. Hence to
apply 3NF, we need to move the street, city and state to new table, with Zip as primary key.
Address Table :
25
It can exist when there are atleast three attribute in a relation (A,B,C) and one
attribute A determines the other two B and C
The B and C are independent of each other (i.e) A->B,A->C.
A relation is in 4NF iff it is in BCNF and there is no multi value dependency.
(eg) consider the employee task table
Employeetask(eid,speciality,toolid)
The employeetask table is not in 4NF because the business rule says employee has
many speciality and each specility has many tools.
Since there are multivalue dependency the table is not in 4NF and hence it is splitted
into two tables as,
Employee speciality(eid,speciality)
Employee tools(eid,toolid)
FIFTH NORMAL FORM: 5NF
It is also called as domain key normal form
it is good for designing application
the goal of 5NF is to have each table represent one topic and for all business
rule to be expressed interms of domain constraints and key relationships
example
student(sid,name,major,advisor)
advisor(fid,name,office,discipline)
5NF says a student can have many advisors but only one for each major
Therefore primary key sid would not be unique
Faculty can be advisor for only this discipline therefore their must be an
explicit rule for concerning the major and the discipline
Student(sid,name)
Advisor(sid,major,fid)
Faculty(fid,name,office,discipline)
26
The standard SQL commands to interact with relational databases are CREATE,
SELECT, INSERT, UPDATE, DELETE and DROP. These commands can be classified into
groups based on their nature:
Oracle uses the following set of commands to define database schema
Create
Creates new databases, tables and views from RDBMS
For example
create table table_name(column_name data type(limit) );
Commit;
Drop
Drop commands deletes views, tables and databases from RDBMS
drop table table_name;
Table table_name dropped
Alter
Modifies database schema.
Alter table table_name column_name ;
These basic constructs allows database programmers and users to enter data and
information into the database and retrieve efficiently using a number of filter options.
Select
27
This is one of the fundamental query command of SQL. It is similar to projection
operation of relational algebra. It selects the attributes based on the condition described by
WHERE clause.
From
This clause takes a relation name as an argument from which attributes are to be
selected/projected. In case more than one relation names are given this clause corresponds to
cartesian product.
Where
This clause defines predicate or conditions which must match in order to qualify
the attributes to be projected.
Transaction Control Language (TCL)
A transaction control language (TCL) is a computer language and a subset of SQL,
used to control transactional processing in a database. A transaction is a logical unit of work
that comprises one or more SQL statements, usually a group of data Manipulation
Language(DML) statements.
Example:
Commit: Commit to apply transaction by saving the database changes .
Rollback: Rollback to undo all changes of a transaction.
SavePoint: Savepoint to divide the transaction into smaller sections. It defines breakpoints
for a transaction to allow partial rollbacks.
TABLE CREATION
PRIMARY KEY
It is column or set of column that identifies a particular row.
28
It should be unique.
The relationship between primary key and the rest of the data is one to one.
FORGIEN KEY
It is primary key in one table that appears as a field in another table where the
first table has a relationship to the second.
CANDIDATE KEY
It is key that uniquely identifies a particular row.
A table can have many candidate key but only one primary key.
COMPOSITE KEY
In the table more than one column used as a part of primary key.
Composite keys are needed when the table contains one to many or many to
many relationship with another table.
CREATING TABLES:
29
Column Name Data Type Allow Nulls
ID nvarchar(50) null
OWNER_ID nvarchar(50) null
OWNER_PWD nvarchar(50) null
GENDER nvarchar(50) null
AGE nvarchar(50) null
MOBILE_NUMBER Bigint null
EMAIL_ID nvarchar(50) null
DATE Datetime Null
SECURITY_KEY nvarchar(50) Null
RANK nvarchar(50) Null
BLOCK nvarchar(50) Null
30
FSUBJECT nvarchar(50) Null
FILEPATH nvarchar(50) Null
FILEBYTE nvarchar(50) Null
FILENAME nvarchar(50) Null
FTEXT nvarchar(50) Null
FDATETIME Datetime Null
FOWNER nvarchar(50) Null
FENCRYPTKEY nvarchar(50) Null
31
possible - optimized to serve humanity. Goal of interface design is a user interface that is
designed so that the widest possible range of users experiencing an optimal wishes / needs /
target achievement by appropriate action steps. While designers across in the course
of interaction design (Eg Interaction Design ) deal in detail with the behavior and the design
(use cases) of a product, it goes in the interface design to the specific design, though not only
visually, an interface. Both disciplines are difficult to separate, the boundaries are blurred,
because every interaction designers created mostly during the process a graphical interface.
The user interface (UI), in the industrial design field of human–machine interaction, is
the space where interactions between humans and machines occur. The goal of this
interaction is to allow effective operation and control of the machine from the human end,
whilst the machine simultaneously feeds back information that aids the operators' decision-
making process. Examples of this broad concept of user interfaces include the interactive
aspects of computer operating systems, hand tools, heavy machinery operator controls,
and process controls. Common practices for interaction specification include user- centered
design, persona, activity-oriented design, scenario-based design, resiliency design.
FEATURES
• Clear
• Concise
• Familiar
32
• Responsive
• Consistent
• Attractive
• Efficient
Clear
Clarity is the most important element of user interface design. Indeed, the whole
purpose of user interface design is to enable people to interact with your system by
communicating meaning and function. If people can’t figure out how your application works
or where to go on your website they’ll get confused and frustrated.
Concise
Clarity in a user interface is great, however, you should be careful not to fall into the
trap of over-clarifying. It is easy to add definitions and explanations, but every time you do
that you add mass. Your interface grows. Add too many explanations and your users will
have to spend too much time reading through them. Keep things clear but also keep things
concise. When you can explain a feature in one sentence instead of three, do it. When you can
label an item with one word instead of two, do it. Save the valuable time of your users by
keeping things concise. Keeping things clear and concise at the same time isn’t easy and
takes time and effort to achieve, but the rewards are great.
Familiar
Many designers strive to make their interfaces ‘intuitive’. intuitive really means
something that can be naturally understood and comprehended. User make something
intuitive by making it ‘Familiar is just that: something which appears like something else
you’ve encountered before. When you’re familiar with something, you know how it behaves
you know what to expect. Identify things that are familiar to your users and integrate them
into your user interface.
Responsive
Responsive means a couple of things. First of all, responsive means fast. The
interface, if not the software behind it, should work fast. Waiting for things to load and using
33
laggy and slow interfaces is frustrating. Seeing things load quickly, or at the very least, an
interface that loads quickly (even if the content is yet to catch up) improves the user
experience.Responsive also means the interface provides some form of feedback. The
interface should talk back to the user to inform them about what’s happening. Have you
pressed that button successfully? How would you know? The button should display a
‘pressed’ state to give that feedback. Perhaps the button text could change to “Loading…”
and it’s state disabled. Is the software stuck or is the content loading? Play a spinning wheel
or show a progress bar to keep the user in the loop.
Consistent
Now, I’ve talked before about the importance of context and how it should guide your
design decisions. I think that adapting to any given context is smart, however, there is still a
level of consistency that an interface should maintain throughout.Consistent interfaces allow
users to develop usage patterns — they’ll learn what the different buttons, tabs, icons and
other interface elements look like and will recognize them and realize what they do in
different contexts. They’ll also learn how certain things work, and will be able to work out
how to operate new features quicker, extrapolating from those previous experiences.
Efficient
A user interface is the vehicle that takes you places. Those places are the different
functions of the software application or website. A good interface should allow you to
perform those functions faster and with less effort. Now, ‘efficient’ sounds like a fairly
vague attribute — if you combine all of the other things on this list, surely the interface will
end up being efficient? Almost, but not quite .What you really really need to do to make an
interface efficient is to figure out what exactly the user is trying to achieve, and then let them
do exactly that without any fuss. You have to identify how your application should ‘work’ —
what functions does it need to have, what are the goals you’re trying to achieve? Implement
an interface that lets people easily accomplish what they want instead of simply
implementing access to a list of features.
6.3 ALGORITHMS USED
34
All the required algorithms in the RBE scheme have been executed properly to setup
the system parameters. We first look at the case where an owner wants to encrypt a
message M to the role R3. The inputs of the RBE encryption are the system public keys
pk and the role public parameters pubR3 of R3, and the output of the algorithm is the
cipher text tulle.
RBE decryption algorithm to recover the message M, and the inputs of the algorithm
are pk, the role public parameters pub R1 the user decryption key dkU1 and the cipher
text C. The algorithm outputs the message M if the decryption key dkU1 that U1 holds is
valid.
Trust issues that need to be considered by the data owners and role managers of a
cryptographic RBAC system.
7. SCREENSHOTS
35
Figure: 7.1 Home Page
36
Figure: 7.3 User Registration Page
37
Figure: 7.5 Client Details
38
Figure: 7.7 User Behaviour Auditor Page
39
Figure: 7.9 Owner Cloud Storage Server Page
40
Figure: 7.11 Trust Based Access Page
41
Figure: 7.13 User Behavior Page
42
Figure: 7.15 User File Upload Page
43
8. CODING
AdminLogin.aspx
<%@PageLanguage="C#"AutoEventWireup="true"MasterPageFile="~/
Administrator.master" CodeFile="AdminLogin.aspx.cs" Inherits="AdminLogin" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"
TagPrefix="cc1" %>
<asp:Content ContentPlaceHolderID="tpalogin" runat="server">
<asp:Label style="position:absolute; top: 216px; left: 445px;" ID="Label1"
runat="server" Text="Administrator" Font-Size="14pt"
Font-Names="Verdana" Font-Bold="True"
ForeColor="#CC3300"></asp:Label>
<asp:Panel style="position:absolute; width: 360px; top: 258px; left: 259px; height: 207px;"
ID="Panel1" runat="server" BorderWidth="4px" BorderColor="#CC3300"
BorderStyle="Solid">
<asp:Label style="position:absolute; top: 35px; left: 21px;" ID="Label2" runat="server"
Font-Bold="True" Font-Names="Verdana" Font-Size="Medium"
Text="Admin Id"></asp:Label>
<asp:TextBox style="position:absolute; top: 35px; left: 146px; width: 185px; height: 25px;
text-align: center;" ID="TextBox1" runat="server" Font-Names="Bookman Old Style" Font-
Size="16"></asp:TextBox>
<asp:Label style="position:absolute; top: 95px; left: 21px;" ID="Label3"
runat="server" Font-Bold="True" Font-Names="Verdana" Font-Size="Medium"
Text="Password"></asp:Label>
<asp:TextBox style="position:absolute; top: 95px; left: 146px; width: 185px; height: 25px;"
ID="TextBox2" runat="server" TextMode="Password"
Font-Names="Bookman Old Style" Font-Size="16"></asp:TextBox>
<asp:Button STYLE="position:absolute; background-color: Transparent; background-image:
url('Images/red.jpg'); top: 149px; left: 72px; width: 97px; height: 32px;"
ID="Button1" runat="server" Text="Submit" Font-Size="15pt" ForeColor="#CC3300"
Font-Names="Imprint MT Shadow" onclick="Button1_Click" Font-Bold="True" />
<asp:Button STYLE="position:absolute; background-color: Transparent; background-image:
url('Images/red.jpg'); top: 149px; left: 187px; width: 97px; height: 32px;"
ID="Button2" runat="server" Text="Clear" Font-Size="15pt" ForeColor="#CC3300"
Font-Names="Imprint MT Shadow" onclick="Button2_Click" Font-Bold="True" />
</asp:Panel><asp:LinkButton ID="LinkButton3" runat="server" Font-Bold="True"
Font-Names="Imprint MT Shadow" Font-Size="Large" Font-Underline="False"
ForeColor="Black" STYLE="position:absolute; top: 434px; left: 764px; width: 149px;"
PostBackUrl="~/Default.aspx">Back to Home</asp:LinkButton>
<cc1:DropShadowExtender ID="DropShadowExtender1" runat="server" Opacity=".1"
TargetControlID="Panel1" Rounded="true" Radius="3"> </cc1:DropShadowExtender>
<cc1:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server"
WatermarkCssClass="watermarked" WatermarkText="Administrator ID"
TargetControlID="Textbox1">
</cc1:TextBoxWatermarkExtender><cc1:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender2" runat="server" WatermarkCssClass="watermarked"
WatermarkText="Password" TargetControlID="Textbox2">
</cc1:TextBoxWatermarkExtender><asp:ScriptManager ID="ScriptManager1"
runat="server"></asp:ScriptManager></asp:Content>
44
AdminLogin.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class AdminLogin : System.Web.UI.Page
{
string upid, uppwd;
protected void Button1_Click(object sender, EventArgs e)
{
upid = TextBox1.Text.ToUpper();
uppwd = TextBox2.Text.ToUpper();
if (TextBox1.Text == "") {
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Administrator ID";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true); }
else
{
if (TextBox2.Text == "")
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Administrator Password";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}
else
{
if (upid == "ADMIN" && uppwd == "ADMIN")
{ Response.Redirect("CloudReport.aspx"); }
else
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Administrator ID/Password Correcly.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}}}}
protected void Button2_Click(object sender, EventArgs e)
{TextBox1.Text = "";
TextBox2.Text = "";
}}
45
AdminOwnerDetails.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class AdminOwnerDetails : System.Web.UI.Page
{
SqlConnectioncon=new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
SqlDataAdapter adp = new SqlDataAdapter("Select ownerid from Registration", con);
DataSet ds = new DataSet();
adp.Fill(ds);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
DropDownList1.Items.Add(ds.Tables[0].Rows[i]["ownerid"].ToString());
}}}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (DropDownList1.SelectedItem.Text == "--Select--")
{
Panel2.Visible = false;
}
else
{
Panel2.Visible = true;
SqlDataAdapter adp = new SqlDataAdapter("Select * from Registration where ownerid='" +
DropDownList1.SelectedItem.Text + "'", con);
DataSet ds = new DataSet(); adp.Fill(ds);
Label5.Text = ds.Tables[0].Rows[0]["oid"].ToString();
Label8.Text = ds.Tables[0].Rows[0]["ownerid"].ToString();
Label11.Text = ds.Tables[0].Rows[0]["gender"].ToString();
Label14.Text = ds.Tables[0].Rows[0]["age"].ToString();
Label17.Text = ds.Tables[0].Rows[0]["mobile"].ToString();
Label20.Text = ds.Tables[0].Rows[0]["emailid"].ToString();
Label23.Text = ds.Tables[0].Rows[0]["date"].ToString();
}}}
46
AdminOwnerDetails.aspx
47
<asp:Label style="position: absolute; top: 199px; left: 180px;" ID="Label13"
runat="server" Text=":" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 199px; left: 240px;" ID="Label14"
runat="server" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 252px; left: 45px;" ID="Label15"
runat="server" Text="Mobile" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 252px; left: 180px;" ID="Label16"
runat="server" Text=":" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 252px; left: 240px;" ID="Label17"
runat="server" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 305px; left: 45px;" ID="Label18"
runat="server" Text="Emailid" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 305px; left: 180px;" ID="Label19"
runat="server" Text=":" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 305px; left: 240px;" ID="Label20"
runat="server" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 358px; left: 45px;" ID="Label21"
runat="server" Text="Date" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 358px; left: 180px;" ID="Label22"
runat="server" Text=":" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 358px; left: 240px;" ID="Label23"
runat="server" Font-Names="Rockwell" Font-Size="Large"></asp:Label></asp:Panel>
<asp:LinkButton ID="LinkButton2" runat="server"
STYLE="position:absolute; top: 435px; left: 755px;" Font-Bold="True"
Font-Names="Imprint MT Shadow" Font-Size="Large" Font-Underline="False"
ForeColor="Black" PostBackUrl="~/tpaverify.aspx" >Alert Message</asp:LinkButton>
<asp:LinkButton ID="LinkButton1" runat="server" Font-Bold="True"
Font-Names="Imprint MT Shadow" Font-Size="Large" Font-Underline="False"
ForeColor="Black" PostBackUrl="~/KeyResponses.aspx"
STYLE="position:absolute; top: 475px; left: 755px; width: 161px;">Key
Responses</asp:LinkButton>
<asp:LinkButton ID="LinkButton5" runat="server" Font-Bold="True"
Font-Names="Imprint MT Shadow" Font-Size="Large" Font-Underline="False"
ForeColor="Black" PostBackUrl="~/Intruderdetails.aspx"
STYLE="position:absolute; top: 515px; left: 755px; width: 176px;">Intruder
Details</asp:LinkButton>
<asp:LinkButton ID="LinkButton4" runat="server" Font-Bold="True"
Font-Names="Imprint MT Shadow" Font-Size="Large" Font-Underline="False"
ForeColor="Black" PostBackUrl="~/AdminOwnerDetails.aspx"
STYLE="position:absolute; top: 555px; left: 755px; width: 161px;">Client
Details</asp:LinkButton>
<asp:LinkButton ID="LinkButton3" runat="server" Font-Bold="True"
Font-Names="Imprint MT Shadow" Font-Size="Large" Font-Underline="False"
ForeColor="Black"
STYLE="position:absolute; top: 595px; left: 755px; width: 149px;"
PostBackUrl="~/Default.aspx">Signout</asp:LinkButton>
</asp:Content>
48
ClientRegistration.aspx
<%@PageLanguage="C#"AutoEventWireup="true"MasterPageFile="~/
ClientMasterPage.master" CodeFile="ClientRegistration.aspx.cs"
Inherits="ClientRegistration" %>
<asp:Content ContentPlaceHolderID="ClientRegistration" runat="server">
<asp:LinkButton ID="LinkButton2" runat="server"
STYLE="position:absolute; top: 435px; left: 755px;" Font-Bold="True"
Font-Size="Large" Font-Underline="False"
ForeColor="Black" onclick="LinkButton2_Click"
Font-Names="Segoe Condensed">Client Login</asp:LinkButton>
<asp:LinkButton ID="LinkButton1" runat="server" Font-Bold="True"
Font-Size="Large" Font-Underline="False"
ForeColor="Black"
STYLE="position:absolute; top: 475px; left: 755px; width: 213px;"
onclick="LinkButton1_Click" Font-Names="Segoe Condensed">Client
Registration</asp:LinkButton>
<asp:LinkButton ID="LinkButton3" runat="server" Font-Bold="True"
Font-Size="Large" Font-Underline="False"
ForeColor="Black"
STYLE="position:absolute; top: 515px; left: 755px; width: 149px;"
PostBackUrl="~/Default.aspx" Font-Names="Segoe Condensed">Back to
Home</asp:LinkButton>
<asp:Label style="position:absolute; top: 201px; left: 310px; right: 650px; height: 36px;"
ID="Label13" runat="server" Font-Names="Tunga" Font-Size="X-Large"
Text="User Sign In:" Font-Bold="True" ForeColor="#990000"></asp:Label>
<asp:Label style="position:absolute; top: 209px; left: 510px; right: 296px; height: 28px;"
ID="Label9" runat="server" Font-Names="Tunga" Font-Size="X-Large"
Text="Cloud Account Registration:" Font-Bold="True" ForeColor="#990000"></asp:Label>
<asp:Panel style="position:absolute; width: 414px; top: 267px; left: 286px; height: 405px;"
ID="Panel1" runat="server" BorderWidth="5px"
BorderColor="#CC3300" BackColor="#FEE8E0" BorderStyle="Double">
<asp:Label ID="Label2" runat="server" Font-Bold="True" Font-Names="Verdana"
Font-Size="Small" ForeColor="#990000"
style="position:absolute; top: 35px; left: 68px;" Text="Client Id"></asp:Label>
<asp:TextBox style="position:absolute; top: 35px; left: 219px; width: 163px; height: 24px;
text-align: center;" ID="TextBox1" runat="server" Font-Names="Verdana" Font-
Size="Small" Font-Bold="True"></asp:TextBox>
<asp:Label style="position:absolute; top: 75px; left: 68px;" ID="Label3"
runat="server" Font-Names="Verdana" Font-Size="Small"
Font-Bold="True" ForeColor="#990000" Text="Password"></asp:Label>
<asp:TextBox style="position:absolute; top: 75px; left: 219px; width: 163px; height: 24px;
text-align: center;"
ID="TextBox2" runat="server" TextMode="Password"
Font-Names="Verdana" Font-Size="Small" Font-Bold="True"></asp:TextBox>
<asp:Label style="position:absolute; top: 115px; left: 68px;" ID="Label4"
runat="server" Font-Names="Verdana" Font-Size="Small"
Font-Bold="True" ForeColor="#990000" Text="Gender"></asp:Label>
<asp:RadioButtonList RepeatDirection="Horizontal"
style="position:absolute; top: 115px; left: 219px; width: 236px;"
49
Font-Bold="True" Font-Names="Verdana" Font-Size="Small" ID="RadioButtonList1"
runat="server">
<asp:ListItem Text="Male" Value="Male"></asp:ListItem>
<asp:ListItem Text="Female" Value="Female"></asp:ListItem>
</asp:RadioButtonList>
<asp:Label style="position:absolute; top: 155px; left: 68px;" ID="Label5"
runat="server" Font-Names="Verdana" Font-Size="Small"
Font-Bold="True" ForeColor="#990000"
Text="Age" ></asp:Label><asp:TextBox MaxLength="3"
OnKeyPress="ValidateNumeric()" style="position:absolute; top: 155px; left: 219px; width:
163px; height: 24px; text-align: center;" Font-Names="Verdana" Font-Size="Small"
ID="TextBox3" runat="server" Font-Bold="True"></asp:TextBox>
<asp:Label style="position:absolute; top: 195px; left: 68px;" ID="Label6"
runat="server" Font-Names="Verdana" Font-Size="Small"
Font-Bold="True" ForeColor="#990000"
Text="Phone"></asp:Label>
<asp:TextBox MaxLength="14" OnKeyPress="ValidateNumeric()"
style="position:absolute; top: 195px; left: 219px; width: 163px; height: 24px; text-align:
center;" Font-Names="Verdana" Font-Size="Small" ID="TextBox4" runat="server"
Font-Bold="True"></asp:TextBox><asp:Label style="position:absolute; top: 235px; left:
68px;" ID="Label7" runat="server" Font-Names="Verdana" Font-Size="Small" Font-
Bold="True" ForeColor="#990000" Text="Email ID"></asp:Label><asp:TextBox
style="position:absolute; top: 235px; left: 219px; width: 163px; height: 24px; text-align:
center;" Font-Names="Verdana" Font-Size="Small" ID="TextBox5" runat="server" Font-
Bold="True"></asp:TextBox> <asp:Label style="position:absolute; top: 275px; left: 68px;"
ID="Label8"runat="server" Font-Names="Verdana" Font-Size="Small" Font-Bold="True"
ForeColor="#990000" Text="Date"></asp:Label>
<asp:TextBox Enabled="false"
style="position:absolute; top: 275px; left: 219px; width: 163px; height: 24px; text-align:
center;" Font-Names="Verdana" Font-Size="Small" ID="TextBox6" runat="server"
Font-Bold="True"></asp:TextBox>
<asp:Button STYLE="position:absolute; background-color: Transparent; background-image:
url('Images/btnadmin1.jpg'); top: 337px; left: 140px; width: 78px; height: 27px;"
ID="Button1" runat="server" Text="Submit" Font-Names="Verdana" Font-Size="Medium"
Font-Bold="True" ForeColor="#CC3300" onclick="Button1_Click"
BackColor="White" /><asp:Button STYLE="position:absolute; background-color:
Transparent; background-image: url('Images/btnadmin1.jpg'); top: 338px; left: 258px; width:
80px; height: 27px;"ID="Button2" runat="server" Text="Clear" Font-Names="Verdana"
Font-Size="Medium"Font-Bold="True" ForeColor="#CC3300" onclick="Button2_Click"
BackColor="White" /><br />
</asp:Panel><asp:Panel style="position:absolute; width: 288px; top: 275px; left: 307px;
height: 249px;" ID="Panel2" runat="server" BorderWidth="5px" BackColor="White"
BorderColor="#990000" BorderStyle="Groove">
<asp:Label style="position:absolute; top: 35px; left: 11px;" ID="Label1"
runat="server" Font-Bold="True" Font-Names="Verdana" Font-Size="Small"
Text="Client Id" ForeColor="#CC6600"></asp:Label>
<asp:TextBox style="position:absolute; top: 34px; left: 107px; width: 166px; height: 24px;
text-align: center;" ID="TextBox7" runat="server" Font-Names="Verdana" Font-
Size="Small" Font-Bold="True"></asp:TextBox>
<asp:Label style="position:absolute; top: 85px; left: 14px;" ID="Label10"
50
runat="server" Font-Bold="True" Font-Names="Verdana" Font-Size="Small"
Text="Password" ForeColor="#CC6600"></asp:Label>
<asp:TextBox style="position:absolute; top: 79px; left: 107px; width: 166px; height: 24px;
text-align: center;" ID="TextBox8" runat="server" TextMode="Password"
Font-Names="Verdana" Font-Size="Small" Font-Bold="True"></asp:TextBox>
<asp:Button STYLE="position:absolute; background-image: url('Images/red1.jpg'); top:
179px; left: 0px; width: 288px; height: 33px;" ID="Button7" runat="server" Text="Click
here to send keygen key" Font-Size="13pt" ForeColor="#CC0000" Font-Names="Imprint
MT Shadow" onclick="Button7_Click" BackColor="White" Font-Bold="True"/>
<asp:Button ID="Button3" runat="server" BackColor="White"
Font-Names="Imprint MT Shadow" Font-Size="15pt" ForeColor="#CC0000"
onclick="Button3_Click" STYLE="position: absolute; background-image:
url('Images/red1.jpg'); top: 124px; left: 37px; width: 88px; height: 31px;" Text="Sign in"
Font-Bold="True" />
<asp:Button STYLE="position:absolute; background-image: url('Images/red1.jpg'); top:
125px; left: 155px; width: 88px; height: 31px;"
ID="Button4" runat="server" Text="Clear" Font-Size="15pt" ForeColor="#CC0000"
Font-Names="Imprint MT Shadow" onclick="Button4_Click" BackColor="White"
Font-Bold="True" /><asp:Label ID="Label14" runat="server"
style="position:absolute; top: 220px; left: 130px;" Text="Label"
Font-Bold="True" Font-Names="Imprint MT Shadow" Font-Underline="False"
ForeColor="#FF9900"></asp:Label></asp:Panel>
<asp:Panel style="position:absolute; width: 318px; top: 259px; left: 400px; height: 155px;"
ID="Panel3" runat="server" BorderWidth="2" BackColor="White"
BorderColor="#FF3300">
<asp:ImageButton style="position:absolute; top: 1px; left: 267px"
ID="ImageButton2" runat="server" ImageUrl="~/Images/close.jpg" Height="25"
Width="25" onclick="ImageButton2_Click"/>
<asp:Label style="position:absolute; top: 0px; left: -1px; height: 20px;" Font-Size="Small"
ID="Label11" runat="server" Text="Public Auditability Key is sent to your mail !"
ForeColor="Red" Visible="False" Font-Bold="True"></asp:Label>
<asp:Label style="position:absolute; top: 25px; left: 2px; height: 20px;" Font-Size="Small"
ID="Label12" runat="server" Text="Public Auditability Key" Visible="False"
Font-Bold="True" Font-Names="Verdana"></asp:Label>
<asp:TextBox ID="TextBox9" runat="server" Font-Bold="True" Font-Names="Verdana"
Font-Size="Small" style="position:absolute; top: 44px; left: 3px; height: 24px; width: 176px;
text-align: center;" TextMode="Password" Visible="False"></asp:TextBox>
<asp:Button style="position:absolute; background-color: Transparent; background-image:
url('Images/red1.jpg'); top: 89px; left: 10px; height: 27px; width: 57px;"
ID="Button5" runat="server" Text="Sign in" onclick="Button5_Click"
CausesValidation="false" ForeColor="#993300" Font-Size="12pt" Font-Names="Imprint
MT Shadow" Visible="False" BackColor="White" Font-Bold="True"/>
<asp:Button style="position:absolute; background-color: Transparent; background-image:
url('Images/red1.jpg'); top: 91px; left: 94px; height: 27px; width: 59px;"
ID="Button6" runat="server" Text="Cancel" CausesValidation="false"
ForeColor="#993300" Font-Size="12pt" Font-Names="Imprint MT Shadow"
onclick="Button6_Click" Visible="False" BackColor="#CCCCCC" Font-Bold="True"/>
<asp:LinkButton ID="LinkButton4" runat="server" onclick="LinkButton4_Click"
ToolTip="Click & Get Security Key" Font-Bold="True">Get Key
Offline</asp:LinkButton>
51
</asp:Panel></asp:Content>
ClientRegistration.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.IO;
using System.Net;
using System.Net.Mail;
using System.Text;
using System.Security.Cryptography;
public partial class ClientRegistration : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
Class1 cs = new Class1();
int ownerid, Securitykey = 0;
string owrid, yes, yes1;
string owrid1, owrpwd, yes2,blacked;
string pas1;
string gMailAccount = "[email protected]";
string password = "alliswell1";
string to;
string subject = "secret key for login";
string message;
string Securitykey1;
string ranno,ranno1;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
TextBox6.Text = DateTime.Now.ToShortDateString();
TextBox3.Attributes.Add("OnKeyPress", "ValidateNumeric()");
TextBox4.Attributes.Add("OnKeyPress", "ValidateNumeric()");
Panel1.Visible = false;
Label9.Visible = false;
Panel2.Visible = false;
Panel3.Visible = false;
Label13.Visible = false;
Button7.Visible = false;
52
}
ownerid = cs.idgeneration();
}
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox1.Text == "")
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Client ID.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}
else
{
if (TextBox2.Text == "")
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Client Password.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else {
if (RadioButtonList1.SelectedIndex == -1)
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Select Gender";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else
{
if (TextBox3.Text == "")
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter your age.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}
else
{
if (TextBox4.Text == "")
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter your contact number.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}
else
{
if (TextBox5.Text == "")
{
string myStringVariable1 = string.Empty;
53
myStringVariable1 = "Enter your Email ID.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true); }
else
{
SqlDataAdapter adp = new SqlDataAdapter("select * from Registration", con);
DataSet ds = new DataSet();
adp.Fill(ds);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
owrid = ds.Tables[0].Rows[i]["ownerid"].ToString();
if (owrid == TextBox1.Text)
{yes = "yes";
goto Outer;}
else
{yes = "no";}}
Outer:
yes1 = "yes";
if (yes != "yes")
{
SqlCommand cmd = new SqlCommand();
con.Open();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "SPRegistration";
cmd.Parameters.Add("@oid", SqlDbType.Int, 0);
cmd.Parameters["@oid"].Value = ownerid;
cmd.Parameters.Add("@ownerid", SqlDbType.VarChar, 50);
cmd.Parameters["@ownerid"].Value = TextBox1.Text;
cmd.Parameters.Add("@ownerpwd", SqlDbType.NVarChar, 50);
cmd.Parameters["@ownerpwd"].Value = TextBox2.Text;
cmd.Parameters.Add("@gender", SqlDbType.NVarChar, 10);
cmd.Parameters["@gender"].Value = RadioButtonList1.SelectedItem.Text;
cmd.Parameters.Add("@age", SqlDbType.Int, 3);
cmd.Parameters["@age"].Value = TextBox3.Text;
cmd.Parameters.Add("@mobile", SqlDbType.BigInt, 15);
cmd.Parameters["@mobile"].Value = TextBox4.Text;
cmd.Parameters.Add("@emailid", SqlDbType.NVarChar, 50);
cmd.Parameters["@emailid"].Value = TextBox5.Text;
cmd.Parameters.Add("@date", SqlDbType.NVarChar, 10);cmd.Parameters["@date"].Value
= TextBox6.Text;
54
cmd.Parameters.Add("@RolesAuditor", SqlDbType.NVarChar, 5);
cmd.Parameters["@RolesAuditor"].Value = "Roles Auditor Bending";
cmd.ExecuteNonQuery();
//NetworkCredential loginInfo = new NetworkCredential(gMailAccount, password);
//MailMessage msg = new MailMessage();
//msg.From = new MailAddress(gMailAccount);
//msg.To.Add(new MailAddress(TextBox5.Text));
//msg.Subject = subject;
//msg.Body = message;
//msg.IsBodyHtml = true;
//SmtpClient client = new SmtpClient("smtp.gmail.com");
//client.EnableSsl = true;
//client.UseDefaultCredentials = false;
//client.Credentials = loginInfo;
//client.Send(msg);
//MailMessage mail = new MailMessage();
//mail.To = TextBox5.Text;
//mail.From = gMailAccount;
//mail.Subject = "secret key";
//mail.Body = "this is my test email body";
//mail.BodyFormat = MailFormat.Html;
////mail.Priority = MailPriority.Normal;
//SmtpMail.SmtpServer = "localhost"; //your real server goes here
//SmtpMail.Send(mail);
MsgBox.Show("Registered Successfully");
}
else
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "This Client ID Already Exists.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}}}}}}}}
protected void Button2_Click(object sender, EventArgs e)
{
TextBox1.Text = "";
TextBox2.Text = "";
RadioButtonList1.SelectedIndex = -1;
TextBox3.Text = "";
TextBox4.Text = "";
TextBox5.Text = "";
}
protected void LinkButton2_Click(object sender, EventArgs e)
{ Label9.Visible = false;
Panel1.Visible = false;
Panel2.Visible = true;
Label13.Visible = true;}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Label9.Visible = true;
55
Panel1.Visible = true;
Panel2.Visible = false;
Label13.Visible = false;
}
protected void Button3_Click(object sender, EventArgs e)
{
Session["pas"] = TextBox8.Text;
if (TextBox7.Text == "")
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Client ID";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}
else
{
if (TextBox8.Text == "")
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Client Password";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}
else
{
SqlDataAdapter adp = new SqlDataAdapter("select * from Registration", con);
DataSet ds = new DataSet();
adp.Fill(ds);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
owrid1 = ds.Tables[0].Rows[i]["ownerid"].ToString();
owrpwd = ds.Tables[0].Rows[i]["ownerpwd"].ToString();
blacked = ds.Tables[0].Rows[i]["Black"].ToString();
if (TextBox7.Text == owrid1 && TextBox8.Text == owrpwd && blacked=="True")
{
yes2 = "yes";
con.Open();
SqlCommand blsa = new SqlCommand("Update Registration set Count='0' where ownerid='"
+ TextBox7.Text + "'", con);
blsa.ExecuteNonQuery();
con.Close();
}}
if (yes2 == "yes")
{
Session["ownerid"] = TextBox7.Text;
//Response.Redirect("OwnerMain.aspx");
//Panel2.Visible = true;
Button7.Visible = true;
56
//this.Button1.Attributes.Add("onclick", "javascript:return OpenPopup()");
//onClick="genericPopup(this.href,300,300,no)"
//Response.Write("<script>window.close()</script>");
}
else
{
SqlDataAdapter adpb = new SqlDataAdapter("select ownerid,Count from Registration where
ownerid='"+ TextBox7.Text+"'", con);
DataSet dsb = new DataSet();
adpb.Fill(dsb);
Label14.Text=dsb.Tables[0].Rows[0]["Count"].ToString();
if ("0" == Label14.Text)
{
con.Open();
SqlCommand bla = new SqlCommand("Update Registration set Count=Count+1 where
ownerid='" + TextBox7.Text + "'", con);
bla.ExecuteNonQuery();
con.Close();
string count = string.Empty;
count = "Enter Clientid/Password Correctly.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + Label14.Text + "');",
true);
}
if ("1" == Label14.Text)
{
con.Open();
SqlCommand bla = new SqlCommand("Update Registration set Count=Count+1 where
ownerid='" + TextBox7.Text + "'", con);
bla.ExecuteNonQuery();
con.Close();
string count = string.Empty;
count = "Enter Clientid/Password Correctly.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + Label14.Text + "');",
true);
}
if ("2" == Label14.Text)
{con.Open();
SqlCommand bla = new SqlCommand("Update Registration set Count=Count+1 where
ownerid='" + TextBox7.Text + "'", con);
bla.ExecuteNonQuery();
con.Close();
string count = string.Empty;
count = "Enter Clientid/Password Correctly.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + Label14.Text + "');",
true);
}
if ("3" == Label14.Text)
{
con.Open();
57
SqlCommand bla = new SqlCommand("Update Registration set Count=Count+1 where
ownerid='" + TextBox7.Text + "'", con);
bla.ExecuteNonQuery();
con.Close();
Label14.Text = "your Account Blacked";
string count = string.Empty;
count = "Enter Clientid/Password Correctly.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + Label14.Text + "');",
true);
}
else
{
con.Open();
SqlCommand blsa = new SqlCommand("Update Registration set Black='Black' where
ownerid='" + TextBox7.Text + "'", con);
blsa.ExecuteNonQuery();
con.Close();
}
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Clientid/Password Correctly.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}}}}
protected void Button4_Click(object sender, EventArgs e)
{ TextBox7.Text = "";
TextBox8.Text = ""; }
protected void Button7_Click(object sender, EventArgs e)
{
Panel3.Visible = true;
Button7.Visible = false;
pas1 = (string)Session["pas"];
if (TextBox7.Text == ""){
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Client ID";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else
{
if (pas1 == "")
{string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Client Password";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else{
SqlDataAdapter adp = new SqlDataAdapter("select * from Registration", con);
DataSet ds = new DataSet();
adp.Fill(ds);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
owrid = ds.Tables[0].Rows[i]["oid"].ToString();
owrid1 = ds.Tables[0].Rows[i]["ownerid"].ToString();
58
owrpwd = ds.Tables[0].Rows[i]["ownerpwd"].ToString();
if (TextBox7.Text == owrid1 && pas1 == owrpwd)
{
Random val = new Random();
int rno = val.Next(12345, 54321);
ranno = Convert.ToString(rno);
ranno1 = Encrypt(ranno);
Session["rendomnum"] = ranno1;
con.Open();
SqlCommand cmd = new SqlCommand("update Registration set securitykey='" + ranno1 +
"'where oid='" + owrid + "'", con);
cmd.ExecuteNonQuery();
con.Close();
message = "<hr><br>Hello " + "<b>" + owrid + " ! </b><br><br>" + "Your Login Security
Key is : " + "<b>" + ranno1 + "</b>";
to = ds.Tables[0].Rows[i]["emailid"].ToString();
NetworkCredential loginInfo = new NetworkCredential(gMailAccount, password);
MailMessage msg = new MailMessage();
msg.From = new MailAddress(gMailAccount);
msg.To.Add(new MailAddress(to));
msg.Subject = subject;
msg.Body = message;
msg.IsBodyHtml = true;
try{
SmtpClient client = new SmtpClient("smtp.gmail.com");
client.EnableSsl = true;
client.UseDefaultCredentials = false;
client.Credentials = loginInfo;
client.Send(msg);}
catch (Exception ex){
Console.WriteLine(ex);
Label11.Text = "OFFLINE : Failure Sending Mail !";
LinkButton4.Visible = true;}
yes2 = "yes";
}}
if (yes2 == "yes"){
Session["ownerid"] = TextBox7.Text;
Panel3.Visible = true; Label11.Visible = true;
TextBox9.Visible = true; Label12.Visible = true;
Button5.Visible = true; Button6.Visible = true; Button7.Visible = false;
}
else
{string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Clientid/Password Correctly.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}}}}
protected void Button5_Click(object sender, EventArgs e)
{Securitykey1 = (string)Session["rendomnum"];
if (TextBox9.Text == Securitykey1)
59
{Session.Remove("rendomnum");
con.Open();
SqlCommand blsas = new SqlCommand("Update Registration set Rank=Rank+1 where
securitykey='" + TextBox9.Text + "'", con);
blsas.ExecuteNonQuery();
con.Close();
Response.Redirect("OwnerFileUpload.aspx");}
else{
TextBox9.Text = "";
//Response.Redirect("OwnerLogin.aspx");
string myStringVariable1 = string.Empty;
myStringVariable1 = "You are not authenticated. Plz try again once.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}}
protected void Button6_Click(object sender, EventArgs e)
{TextBox9.Text = "";}
protected void LinkButton4_Click(object sender, EventArgs e)
{
Panel3.Visible = true; Label11.Visible = true;
TextBox9.Visible = true; Label12.Visible = true;
Button5.Visible = true; Button6.Visible = true; Button7.Visible = false;
TextBox9.Text = (string)Session["rendomnum"];
string myStringVariable1 = string.Empty;
myStringVariable1 = "Your Login Public Key is : " + (string)Session["rendomnum"] ;
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
Panel3.Visible = false; Label11.Visible = false;
Label12.Visible = false; TextBox9.Visible = false;
Button5.Visible = false; Button6.Visible = false;
Button7.Visible = true; Panel2.Visible = true;
}
private string Encrypt(string clearText)
{
string EncryptionKey = "MAKV2SPBNI99212";
//byte[] Key = Encoding.UTF8.GetBytes("asdf!@#$1234ASDF");
byte[] clearBytes = Encoding.Unicode.GetBytes(clearText);
using (Aes encryptor = Aes.Create())
{
Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(EncryptionKey, new byte[] { 0x49,
0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76 });
encryptor.Key = pdb.GetBytes(32);
encryptor.IV = pdb.GetBytes(16);
using (MemoryStream ms = new MemoryStream())
{
using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateEncryptor(),
CryptoStreamMode.Write))
{cs.Write(clearBytes, 0, clearBytes.Length);
cs.Close();}
60
clearText = Convert.ToBase64String(ms.ToArray());
}}return clearText;}}
CloudReport.aspx
61
</center></div></div></div></div><!-- end page --><!-- start footer --><div id="footer">
</div></div></form></body></html>
CloudReport.aspx.cs
62
<div id="footer"></div></div>
</form></body></html>
Default.aspx
63
<asp:Image ID="Image6" runat="server"
style="position:absolute; top: 187px; left: 14px; width: 207px; height: 38px;"
ImageUrl="~/images/Architecture.png" />
<asp:Image ID="Image5" runat="server"
style="position:absolute; top: 478px; left: 16px; width: 207px; height: 38px;"
ImageUrl="~/images/Hierarchical RBAC.png" />
<asp:Image ID="Image7" runat="server"
style="position:absolute; top: 227px; left: 211px; width: 608px; height: 246px;"
ImageUrl="~/images/arcful11.png" />
<asp:Image ID="Image4" runat="server"
style="position:absolute; top: 695px; left: 365px; width: 379px; height: 152px;"
ImageUrl="~/images/Arc222tree.png" />
<asp:Image ID="Image2" runat="server"
style="position:absolute; top: 516px; left: 364px; width: 379px; height: 152px;"
ImageUrl="~/images/Arctrree333.png" />
<asp:Label ID="Label3" runat="server" Text="Trust Decision Engine"
style="position:absolute; top: 833px; left: 812px; width: 207px; height: 26px;"
Font-Bold="True" Font-Names="Imprint MT Shadow" Font-Size="Large"
ForeColor="Black" ></asp:Label>
<asp:Label ID="Label6" runat="server" Text="User Behavior Monitor"
style="position:absolute; top: 613px; left: 812px; width: 214px; height: 24px;"
Font-Bold="True" Font-Names="Imprint MT Shadow" Font-Size="Large"
ForeColor="Black" ></asp:Label>
<asp:Label ID="Label2" runat="server" Text="User Behavior Auditor"
style="position:absolute; top: 396px; left: 828px; width: 202px; height: 23px;"
Font-Bold="True" Font-Names="Imprint MT Shadow" Font-Size="Large"
ForeColor="Black" ></asp:Label>
<asp:Label ID="Label1" runat="server" Text="Cryptographic RBAC System"
style="position:absolute; top: 169px; left: 374px;" Font-Bold="True"
Font-Names="Imprint MT Shadow" Font-Size="X-Large" ForeColor="Black"
></asp:Label>
<%--<asp:Panel Style="position: absolute; top: 945px; left: 17px; height: 29px; width:
959px;"
ID="Panel1" runat="server">
<font size="6" face="Bookman old style" color="yellow">
<marquee style="position: absolute; top: -1px; left: 10px; width: 940px; height: 38px;"
behavior="scroll"
direction="left" scrollamount="15">WWW.chennaisunday.com</marquee>
</font>
<font size="6" face="Bookman old style" color="yellow">
<marquee style="position: absolute; top: 40px; left: 6px; width: 940px; height: 39px;"
behavior="scroll"
direction="right" scrollamount="15">Contact us:9566137117</marquee></font>
</asp:Panel><font size="4" face="Bookman old style" color="yellow">
<marquee style="position: absolute; top: 0px; left: 7px; width: 940px; height: 26px;"
behavior="alternate"direction="left" scrollamount="5">WWW.chennaisunday.com || Contact
us:9566137117</marquee></font>--%>
</div><hr /><!-- end header --><!-- start page --><div id="wrapper"><div id="page"><div
id="page-bgtop"><div id="page-bgbtm"></div></div></div></div><!-- end page -->
<!-- start footer --><div id="footer"></div></form>
64
</body>
</html>
Default2.aspx
65
Down.aspx
66
Down.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
public partial class down : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(@"Data Source=SHANKARI;Initial Catalog=Trust
Enhanced Cryptographic;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
protected void Page_Load(object sender, EventArgs e)
{
TextBox1.Visible = false; Button1.Visible = false;
con.Open();
SqlCommand cmd = new SqlCommand("select
fid,ffilename,fowner,fenccryptokey,fdatetime,filepath from filearchive where
keystatus='Sent'", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds); con.Close();
ggt.DataSource = ds;
ggt.DataBind(); }
protected void lnkDownload_Click(object sender, EventArgs e)
{
LinkButton lnkbtn = sender as LinkButton;
GridViewRow gvrow = lnkbtn.NamingContainer as GridViewRow;
string filePath = ggt.DataKeys[gvrow.RowIndex].Value.ToString();
Response.ContentType = "image/jpg";
Response.AddHeader("Content-Disposition", "attachment;filename=\"" + filePath + "\"");
Response.TransmitFile(filePath);
Response.End(); }
protected void Button1_Click1(object sender, EventArgs e)
{
//con.Open();
//SqlCommand cmd = new SqlCommand("select
fid,ffilename,fowner,fenccryptokey,fdatetime,filepath from filearchive where
keystatus='Sent'", con);
//SqlDataAdapter da = new SqlDataAdapter(cmd);
//DataSet ds = new DataSet();
//da.Fill(ds); //con.Close();
//ggt.DataSource = ds;
//ggt.DataBind();
}
67
protected void Button2_Click(object sender, EventArgs e)
{Response.Redirect("default.aspx");}}
Download.aspx
68
</asp:Content>
Download.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class Download : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where
keystatus='Sent'", con); DataSet ds1 = new DataSet(); adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{GridView1.DataSource = ds1; GridView1.DataBind();}
else
{MsgBox.Show("TPA doesn't sent any files to download");}
Session["owner"] = ds1.Tables[0].Rows[0]["fowner"].ToString();
Session["fid1"] = ds1.Tables[0].Rows[0]["fid"].ToString();
Session["fname"] = ds1.Tables[0].Rows[0]["ffilename"].ToString();}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{GridView1.PageIndex = e.NewPageIndex; bindgrid();}
public void bindgrid()
{SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where
keystatus='Sent'", con);
DataSet ds1 = new DataSet(); adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{GridView1.DataSource = ds1; GridView1.DataBind();}
else
{MsgBox.Show("TPA doesn't send any files to download");}
Session["owner"] = ds1.Tables[0].Rows[0]["fowner"].ToString();
Session["fid1"] = ds1.Tables[0].Rows[0]["fid"].ToString();
Session["fname"] = ds1.Tables[0].Rows[0]["ffilename"].ToString();}
protected void LinkButton1_Click(object sender, EventArgs e)
{LinkButton lnkbtn = sender as LinkButton;
GridViewRow gvrow = lnkbtn.NamingContainer as GridViewRow;
string filePath = GridView1.DataKeys[gvrow.RowIndex].Value.ToString();
Response.ContentType = "image/jpg";
Response.AddHeader("Content-Disposition", "attachment;filename=\"" + filePath + "\"");
69
Response.TransmitFile(Server.MapPath(filePath));
Response.End();}}
IntruderDetails.aspx
70
ForeColor="Black" PostBackUrl="~/Default.aspx"STYLE="position:absolute; top: 625px;
left: 755px; width: 149px;">Back to Home</asp:LinkButton></asp:Content>
IntruderDetails.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class Intruderdetails : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{
SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where
fmodify='Block'", con);
DataSet ds1 = new DataSet();
adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{
GridView1.DataSource = ds1;
GridView1.DataBind();
}
else
{MsgBox.Show("No Intruder Alerts Found");
}}
public void bindgrid()
{
SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where
fmodify='Block'", con);
DataSet ds1 = new DataSet();
adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{GridView1.DataSource = ds1;
GridView1.DataBind();}
else
{MsgBox.Show("No Intruder Alerts Found");}
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
71
bindgrid();
}}
KeyResponses.aspx
72
ForeColor="Black" PostBackUrl="~/AdminOwnerDetails.aspx"STYLE="position:absolute;
top: 555px; left: 755px; width: 161px;">Client Details</asp:LinkButton></asp:Content>
KeyResponses.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class KeyResponses : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{
SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where
serverview='View'", con);
DataSet ds1 = new DataSet();
adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{GridView1.DataSource = ds1;
GridView1.DataBind();
}
else
{
MsgBox.Show("No KeyResponse Found");
}}
public void bindgrid()
{
SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where
serverview='View'", con);
DataSet ds1 = new DataSet();
adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{GridView1.DataSource = ds1;
GridView1.DataBind();}
else
{MsgBox.Show("No KeyResponse Found");
}}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
73
bindgrid();
}}
OwnerCentralRepository.aspx
74
OwnerCentralRepository.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
public partial class OwnerCentralRepository : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (!IsPostBack)
{
SqlDataAdapter sda = new SqlDataAdapter("select
fid,fsubject,ffilename,fsizeinkb,fdatetime,fowner,tpaview,serverview,keystatus from
Registration", con);
DataSet ds = new DataSet();
sda.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
}}
catch (Exception ex)
{
MsgBox.Show("Time out");
}}
protected void btnlinkAccepted_Click(object sender, EventArgs e)
{
try
{
con.Open();
GridViewRow gr = ((sender as LinkButton).NamingContainer as GridViewRow);
Session["oid"] = gr.Cells[1].Text.Trim();
SqlCommand cmdA = new SqlCommand("Update filearchive set Black='Trust Data Black'
where oid='" + gr.Cells[1].Text.Trim() + "'", con);
cmdA.ExecuteNonQuery();
con.Close();
}
catch (Exception ex)
{
75
ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(),
Guid.NewGuid().ToString(), "alert(''Invalid Authenticate');", true);
}}}
OwnerFileUpload.aspx
76
Upload</asp:LinkButton><asp:Label ID="Label8" runat="server" Text="Label"
Visible="False"></asp:Label><asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager></asp:Content>
OwnerFileUpload.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Diagnostics;
using System.Text;
using System.Security.Cryptography;
using System.IO;
using System.Net;
using System.Net.Mail;
using System.Data.SqlClient;
public partial class OwnerFileUpload : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
Class1 cs = new Class1();
Cryptography cr = new Cryptography();
float sessionfilesize;
string totalbytes;
string gMailAccount = "[email protected]";
string password = "project5";
string to;
string subject = "Cryptography Encryption Key";
string message;
string ownerid, filePath, filename, filesize, fileext, date;
string cryptographykey, fileenccryptographykey;
float filesiz = 0f;
string splitfilesize, checkfilename, yes, yes1, binary1, binary1enc, singlefilesize,s1;
string fverify = "NO", fmodify = "", fdownload = "Block", keyrequest = "Null", emailid;
protected void Page_Load(object sender, EventArgs e)
{if (!IsPostBack){
Label4.Text = Convert.ToString(cs.idgeneration1());
Label7.Visible = false;}
ownerid = (string)Session["ownerid"];}
protected void Button3_Click(object sender, EventArgs e)
{if (Label1.Text == "OK"){
//Button2.Text = "Check..";
77
//Label7.Text = "File Uploaded Status..";
//Label7.ForeColor = System.Drawing.ColorTranslator.FromHtml("#B4045F");}
else{
filename = System.IO.Path.GetFileName(FileUpload1.FileName);
if (filename == ""){
string myStringVariable1 = string.Empty;
myStringVariable1 = "select any one file";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
//File Upload TextBox is Empty?
Else
{
//filePath = Request.PhysicalApplicationPath + "Uploads/" +
System.IO.Path.GetFileName(AsyncFileUpload1.FileName);
//AsyncFileUpload1.SaveAs(filePath);
//byte[] filebytes = new byte[AsyncFileUpload1.PostedFile.InputStream.Length + 1];
//AsyncFileUpload1.PostedFile.InputStream.Read(filebytes, 0, filebytes.Length);
////byte[] filebytes = new byte[AsyncFileUpload1.PostedFile.InputStream.Length];
//fileext = System.IO.Path.GetExtension(AsyncFileUpload1.PostedFile.FileName);
filePath = Request.PhysicalApplicationPath + "Uploads/" +
System.IO.Path.GetFileName(FileUpload1.FileName);
FileUpload1.SaveAs(filePath);
byte[] filebytes = new byte[FileUpload1.PostedFile.InputStream.Length];
FileUpload1.PostedFile.InputStream.Read(filebytes, 0, filebytes.Length);
//byte[] filebytes = new byte[AsyncFileUpload1.PostedFile.InputStream.Length];
fileext = System.IO.Path.GetExtension(FileUpload1.PostedFile.FileName);
filesiz = (float)FileUpload1.PostedFile.ContentLength / 1024;
filesize = Convert.ToString(filesiz) + " KB";
date = Convert.ToString(DateTime.Now.ToShortDateString());
totalbytes = Convert.ToString(FileUpload1.PostedFile.ContentLength);
Session["totalbytes"] = totalbytes;
sessionfilesize = (float)FileUpload1.PostedFile.ContentLength / 9;
Session["Filecontent"] = sessionfilesize;
singlefilesize = Convert.ToString(FileUpload1.PostedFile.ContentLength / 9);
s1 = Convert.ToString(singlefilesize);
Random val = new Random();
int rno = val.Next(12345, 54321);
cryptographykey = Convert.ToString(rno);
fileenccryptographykey = cr.Encrypt(cryptographykey);
//splitfilesize = Convert.ToString(filesiz);
//for (int i = 0; i < splitfilesize.Length; i++)
//{
// char c = splitfilesize[i];
// string binary = Convert.ToString(c, 2);
// binary1 = binary1 + binary;
//}
//binary1enc = cr.Encrypt(binary1);
//TextBox3.Text = binary1;
//Label9.Visible = true;
//TextBox3.Visible = true;
78
if (TextBox2.Text == ""){
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter File Subject.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
//File Subject TextBox is Empty?
else{
SqlDataAdapter adp = new SqlDataAdapter("select * from filearchive", con);
DataSet ds = new DataSet();
adp.Fill(ds);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++){
checkfilename = ds.Tables[0].Rows[i]["ffilename"].ToString();
if (checkfilename == filename)
{
yes = "yes";
goto Outer;}
else{
yes = "no";
}}
Outer:
yes1 = "yes";
if (yes != "yes")
{
con.Open();
SqlCommand cmd = new SqlCommand("insert into filearchive values('" + Label4.Text + "','"
+ TextBox2.Text + "','" + filePath + "',@files,'" + filename + "','" + fileext + "','" + filesize +
"','" + date + "','" + ownerid + "','" + fileenccryptographykey + "','" + binary1enc + "','" +
fverify + "','" + fmodify + "','" + fdownload + "','" + keyrequest + "','" + totalbytes + "','" +
sessionfilesize + "','" + singlefilesize + "','','','','','','','','','','','','','','','','','','','','','','')", con);
cmd.Parameters.AddWithValue("@files", filebytes);
cmd.ExecuteNonQuery();
con.Close();
//filename = "";
Session["fid1"] = Label4.Text;
Label7.Text = "File Uploaded Successfully..";
Label7.Visible = true;
//Button2.Text = "OK";
Label7.ForeColor = System.Drawing.ColorTranslator.FromHtml("#088A08");
//ModalPopupExtender1.Show();
//Panel3.Visible = true;
//SqlDataAdapter adp1 = new SqlDataAdapter("select * from Registration where ownerid='"
+ (string)Session["ownerid"] + "'", con);
//DataSet ds1 = new DataSet();
//adp1.Fill(ds1);
//emailid = ds1.Tables[0].Rows[0]["emailid"].ToString();
//message = "<hr><br>" + "File Name : <b>" + filename + " ! </b><br><br>" +
"Cryptography Encryption Key is : " + "<b>" + fileenccryptographykey + "</b>";
//to = emailid;
//NetworkCredential loginInfo = new NetworkCredential(gMailAccount, password);
//MailMessage msg = new MailMessage();
79
//msg.From = new MailAddress(gMailAccount);
//msg.To.Add(new MailAddress(to));
//msg.Subject = subject;
//msg.Body = message;
//msg.IsBodyHtml = true;
//try
//{
// Label6.Visible = true;
// Label6.ForeColor = System.Drawing.ColorTranslator.FromHtml("#226116");
// Label6.Text = "File Cryptography Encryption Key Sent To Mail !";
// SmtpClient client = new SmtpClient("smtp.gmail.com");
// client.EnableSsl = true;
// client.UseDefaultCredentials = false;
// client.Credentials = loginInfo;
// client.Send(msg);
//}
//catch (Exception ex)
//{
// Label6.Visible = true;
// Label6.ForeColor = System.Drawing.ColorTranslator.FromHtml("#fa0505");
// Console.WriteLine(ex);
// Label6.Text = "OFFLINE : Failure Sending Mail !";
//}
}
else{
string myStringVariable1 = string.Empty;
myStringVariable1 = "This File Name Already Exists.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}}
Page_Load(null, EventArgs.Empty);
}}}
protected void Button1_Click(object sender, EventArgs e)
{
TextBox2.Text = "";
//TextBox3.Visible = false;
}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
//Label6.Visible = false;
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Redirect("packetsending.aspx");
}
protected void LinkButton4_Click(object sender, EventArgs e)
{
Response.Redirect("Download.aspx");
}
80
}
OwnerInteractionHistory.aspx
81
PostBackUrl="~/Default.aspx">Back to Home</asp:LinkButton>
</asp:Content>
OwnerInteractionHistory.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
public partial class OwnerInteractionHistory : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (!IsPostBack)
{
SqlDataAdapter sda = new SqlDataAdapter("select
oid,ownerid,gender,age,mobile,emailid,date,Black,Rank,RolesAuditor from Registration",
con);
DataSet ds = new DataSet();
sda.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
}}
catch (Exception ex)
{
MsgBox.Show("Time out");
}}
protected void btnlinkAccepted_Click(object sender, EventArgs e)
{
try
{
con.Open();
GridViewRow gr = ((sender as LinkButton).NamingContainer as GridViewRow);
Session["oid"] = gr.Cells[1].Text.Trim();
SqlCommand cmdA = new SqlCommand("Update Registration set Black='Trust Decision
Black' where oid='" + gr.Cells[1].Text.Trim() + "'", con);
cmdA.ExecuteNonQuery();
con.Close();
}
catch (Exception ex)
{
82
ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(),
Guid.NewGuid().ToString(), "alert(''Invalid Authenticate');", true);
}}}
PacketSending.aspx
83
<asp:Label ID="Label25" runat="server" Font-Names="Courier New"
ForeColor="#FF3300"style="position:absolute; top: 50px; left: 485px; width: 124px; height:
20px;"></asp:Label>
<asp:Label style="position:absolute; top: 90px; left: 485px; width: 124px; height: 20px;"
ID="Label26"runat="server" Font-Names="Courier New"
ForeColor="#FF3300"></asp:Label><asp:Label style="position:absolute; top: 130px; left:
485px; width: 124px; height: 20px;" ID="Label27"runat="server" Font-Names="Courier
New" ForeColor="#FF3300"></asp:Label><asp:Label style="position:absolute; top: 170px;
left: 485px; width: 124px; height: 20px;" ID="Label28"runat="server" Font-Names="Courier
New" ForeColor="#FF3300"></asp:Label><asp:Label style="position:absolute; top: 210px;
left: 485px; width: 124px; height: 20px;" ID="Label29"runat="server" Font-Names="Courier
New" ForeColor="#FF3300"></asp:Label><asp:Label style="position:absolute; top: 250px;
left: 485px; width: 124px; height: 20px;" ID="Label30"runat="server" Font-Names="Courier
New" ForeColor="#FF3300"></asp:Label><asp:Label style="position:absolute; top: 290px;
left: 485px; width: 124px; height: 20px;" ID="Label31"runat="server" Font-Names="Courier
New" ForeColor="#FF3300"></asp:Label><asp:Label style="position:absolute; top: 330px;
left: 485px; width: 124px; height: 20px;" ID="Label32"runat="server" Font-Names="Courier
New" ForeColor="#FF3300"></asp:Label><asp:Label style="position:absolute; top: 370px;
left: 485px; width: 124px; height: 20px;" ID="Label33"runat="server" Font-Names="Courier
New" ForeColor="#FF3300"></asp:Label>
<asp:CheckBox style="position:absolute; top: 402px; left: 230px;"ID="CheckBox1"
runat="server" Text="Packet Loss" Font-Bold="true"Font-Italic="false" Visible="False"/>
<asp:Button ID="btnSend" runat="server"style="position:absolute; top: 427px; left: 231px;
width: 82px; height: 30px;"Text="Send" BackColor="#FFCCCC" ForeColor="#CC3300"
Font-Size="13"Font-Names="Bookman Old Style" onclick="btnSend_Click" Font-
Bold="true"/><asp:Label style="position:absolute; top: 447px; left: 35px;" ID="Label3"
runat="server" Text="Note:" ForeColor="Black" Font-Underline="True"></asp:Label>
<asp:Label style="position:absolute; top: 473px; left: 67px; height: 24px; width: 160px;"
ID="Label23"runat="server" Text="Each Level is: " Font-Size="Medium" Font-Bold="True"
Font-Names="Verdana"></asp:Label><asp:Label style="position:absolute; top: 471px; left:
226px; height: 24px; width: 160px;" ID="Label24" runat="server" Font-Size="13pt" Font-
Names="Times New Roman"ForeColor="Red"></asp:Label><asp:Label ID="Label1"
runat="server" Font-Size="Medium"style="position:absolute; top: 513px; left: 63px; height:
24px; width: 160px;"Text="Total Level is: " Font-Bold="True" Font-
Names="Verdana"></asp:Label><asp:Label style="position:absolute; top: 510px; left:
230px; height: 24px; width: 160px;" ID="Label2" runat="server" Font-Size="13pt" Font-
Names="Times New Roman"ForeColor="Red"></asp:Label><asp:TextBox ID="TextBox1"
runat="server"style="position:absolute; top: 50px; left: 143px; text-align: center;"
ontextchanged="TextBox1_TextChanged" AutoPostBack="True"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server"style="position:absolute; top: 90px; left:
143px; text-align: center;" AutoPostBack="True"ontextchanged="TextBox2_TextChanged">
</asp:TextBox><asp:TextBox ID="TextBox3" runat="server"style="position:absolute; top:
130px; left: 143px; text-align: center;"
AutoPostBack="True"ontextchanged="TextBox3_TextChanged" ></asp:TextBox>
<asp:TextBox ID="TextBox4" runat="server"style="position:absolute; top: 170px; left:
143px; text-align: center;" AutoPostBack="True"ontextchanged="TextBox4_TextChanged">
</asp:TextBox><asp:TextBox ID="TextBox5" runat="server"style="position:absolute; top:
210px; left: 143px; text-align: center;" AutoPostBack="True"
ontextchanged="TextBox5_TextChanged" ></asp:TextBox><asp:TextBox ID="TextBox6"
84
runat="server"style="position:absolute; top: 250px; left: 143px; text-align: center;"
AutoPostBack="True"ontextchanged="TextBox6_TextChanged" ></asp:TextBox>
<asp:TextBox ID="TextBox7" runat="server"style="position:absolute; top: 290px; left:
143px; text-align: center;" AutoPostBack="True"
ontextchanged="TextBox7_TextChanged" ></asp:TextBox>
<asp:TextBox ID="TextBox8" runat="server"
style="position:absolute; top: 330px; left: 143px; text-align: center;" AutoPostBack="True"
ontextchanged="TextBox8_TextChanged" ></asp:TextBox>
<asp:TextBox ID="TextBox9" runat="server"
style="position:absolute; top: 370px; left: 143px; text-align: center;" AutoPostBack="True"
ontextchanged="TextBox9_TextChanged" ></asp:TextBox>
<asp:Label style="position:absolute; top: 50px; left: 297px; width: 123px; height: 20px;"
ID="Label4"runat="server" Font-Names="Courier New"
ForeColor="#660033"></asp:Label>
<asp:Label style="position:absolute; top: 90px; left: 297px; width: 123px; height: 20px;"
ID="Label5"runat="server" Font-Names="Courier New"
ForeColor="#660033"></asp:Label>
<asp:Label style="position:absolute; top: 130px; left: 297px; width: 123px; height: 20px;"
ID="Label6" runat="server" Font-Names="Courier New"
ForeColor="#660033"></asp:Label>
<asp:Label style="position:absolute; top: 170px; left: 297px; width: 123px; height: 20px;"
ID="Label7" runat="server" Font-Names="Courier New"
ForeColor="#660033"></asp:Label>
<asp:Label style="position:absolute; top: 210px; left: 297px; width: 123px; height: 20px;"
ID="Label8" runat="server" Font-Names="Courier New"
ForeColor="#660033"></asp:Label>
<asp:Label style="position:absolute; top: 250px; left: 297px; width: 123px; height: 20px;"
ID="Label9" runat="server" Font-Names="Courier New"
ForeColor="#660033"></asp:Label>
<asp:Label style="position:absolute; top: 290px; left: 297px; width: 123px; height: 20px;"
ID="Label10" runat="server" Font-Names="Courier New"
ForeColor="#660033"></asp:Label>
<asp:Label style="position:absolute; top: 330px; left: 297px; width: 123px; height: 20px;"
ID="Label11" runat="server" Font-Names="Courier New"
ForeColor="#660033"></asp:Label>
<asp:Label style="position:absolute; top: 370px; left: 297px; width: 123px; height: 20px;"
ID="Label12" runat="server" Font-Names="Courier New"
ForeColor="#660033"></asp:Label></asp:Panel>
<asp:LinkButton ID="LinkButton1" runat="server"STYLE="position:absolute; top: 432px;
left: 1015px;" Font-Bold="True"ForeColor="Red" PostBackUrl="~/Default.aspx"
Font-Names="Imprint MT Shadow" Font-Size="X-Large" >Download</asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server"STYLE="position:absolute; top: 467px;
left: 1024px; margin-bottom: 0px;" Font-Bold="True"Font-Names="Imprint MT Shadow"
Font-Size="Large" Font-Underline="False"ForeColor="Red" PostBackUrl="~/Default.aspx"
>Signout</asp:LinkButton>
<asp:Label style="position:absolute; top: 205px; left: 139px; width: 906px; height: 26px;"
ID="Label37"runat="server" Font-Names="Verdana" ForeColor="Blue"
Font-Bold="True" Font-Size="Large">TRUST ISSUES IN USING CRYPTOGRAPHIC
RBAC SCHEMES IN SECURE CLOUD STORAGE</asp:Label>
<asp:Label style="position:absolute; top: 418px; left: 849px;" ID="Label36"
85
runat="server" Text="." Visible="false"></asp:Label>
</center>
</asp:Content>
PacketSending.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class packet_sending : System.Web.UI.Page
{
float addsplit=0;
string tr, binary1, binary1enc, binary1enc1, binary1enc2, binary1enc3, binary1enc4,
binary1enc5, binary1enc6, binary1enc7, binary1enc8;
int count = 0;
float eachfilesize = 0f;
float efsize = 0f;
string totalbytes;
string rannum;
string p1, binary2, binary3, binary4, binary5, binary6, binary7, binary8, binary9;
string p2,p3,p4,p5;
string splitfilesize, splitfilesize1, splitfilesize2, splitfilesize3, splitfilesize4, splitfilesize5,
splitfilesize6, splitfilesize7, splitfilesize8;
Cryptography cr = new Cryptography();
string cryptographykey, fileenccryptographykey;
float filesiz = 0f;
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{if (!IsPostBack)
{Label25.Visible = false;
Label26.Visible = false;
Label27.Visible = false;
Label28.Visible = false;
Label29.Visible = false;
Label30.Visible = false;
Label31.Visible = false;
Label32.Visible = false;
Label33.Visible = false;
TextBox1.Visible = false;
86
TextBox2.Visible = false;
TextBox3.Visible = false;
TextBox4.Visible = false;
TextBox5.Visible = false;
TextBox6.Visible = false;
TextBox7.Visible = false;
TextBox8.Visible = false;
TextBox9.Visible = false;}}
protected void btnSend_Click(object sender, EventArgs e)
{try{
totalbytes = Convert.ToString(Session["totalbytes"]);
Label2.Text = Convert.ToString(Session["totalbytes"]) + " bytes";
eachfilesize = (float)Session["Filecontent"];
Label24.Text = Convert.ToString(Session["Filecontent"]) + " bytes";
Session["c"] = count;
if (Label36.Visible == false)
{if (Label27.Visible == false)
{if (CheckBox1.Checked == false)
{if (Label25.Visible == false)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label13.BackColor = System.Drawing.Color.Green;
//Label25.Visible = true;
//Label25.Text = "Block1 Sent ";
System.Threading.Thread.Sleep(1000);
TextBox1.Visible = true;
goto outer;}
if (Label25.Visible == true)
{
if (Label14.BackColor != System.Drawing.Color.Green)
{
//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label14.BackColor = System.Drawing.Color.Green;
//Label26.Visible = true;
//Label26.Text = "Block2 Sent";
System.Threading.Thread.Sleep(1000);
TextBox2.Visible = true;
goto outer;}}
if (Label26.Visible == true)
{
//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label15.BackColor = System.Drawing.Color.Green;
//Label27.Visible = true;
//Label27.Text = "Block3 Sent";
System.Threading.Thread.Sleep(1000);
TextBox3.Visible = true;
//goto outer;}
CheckBox1.Enabled = true;
87
Label27.Visible = true;}
else
{
if (CheckBox1.Checked == true)
{count++;
update();
Random val = new Random();
int rno = val.Next(1, 3);
rannum = Convert.ToString(rno);
if (rannum == "1")
{Label13.BackColor = System.Drawing.Color.Red;
Label25.Visible = true;
Label25.Text = "Level1 Corrupted";
string myStringVariable1 = string.Empty;
myStringVariable1 = "First Level is Corrupted";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label13.BackColor = System.Drawing.Color.Green;
//Label25.Visible = true;
//Label25.Text = "Block1 sent";
System.Threading.Thread.Sleep(1000);
goto outer;}
if (rannum == "2")
{Label14.BackColor = System.Drawing.Color.Red;
Label26.Visible = true;
Label26.Text = "Level2 Corrupted";
string myStringVariable1 = string.Empty;
myStringVariable1 = "Second Level is Corrupted";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else{
//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label14.BackColor = System.Drawing.Color.Green;
//Label26.Visible = true;
//Label26.Text = "Block2 sent";
System.Threading.Thread.Sleep(1000);
goto outer;}
if (rannum == "3")
{Label15.BackColor = System.Drawing.Color.Red;
Label27.Visible = true;
Label27.Text = "Level3 Corrupted";
string myStringVariable1 = string.Empty;
myStringVariable1 = "Third Level is Corrupted";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else
88
{
//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label15.BackColor = System.Drawing.Color.Green;
//Label27.Visible = true;
//Label27.Text = "Block3 sent";
System.Threading.Thread.Sleep(1000);
goto outer;}
CheckBox1.Checked = false;
CheckBox1.Enabled = false;}}}
else
{if (Label30.Visible == false)
{if (CheckBox1.Checked == false)
{if (Label25.Visible == false)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label13.BackColor = System.Drawing.Color.Green;
//Label25.Visible = true;
//Label25.Text = "Block1 sent";
System.Threading.Thread.Sleep(1000);
goto outer;}
if (Label25.Visible == true)
{if (Label14.BackColor != System.Drawing.Color.Green){
//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label14.BackColor = System.Drawing.Color.Green;
//Label26.Visible = true;
//Label26.Text = "Block2 sent";
System.Threading.Thread.Sleep(1000);
TextBox2.Visible = true;
goto outer;}}
if (Label26.Visible == true)
{if (Label15.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label15.BackColor = System.Drawing.Color.Green;
//Label27.Visible = true;
//Label27.Text = "Block3 sent";
System.Threading.Thread.Sleep(1000);
TextBox3.Visible = true;
goto outer;}}
if (Label27.Visible == true)
{if (Label16.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label16.BackColor = System.Drawing.Color.Green;
//Label28.Visible = true;
//Label28.Text = "Block4 sent";
System.Threading.Thread.Sleep(1000);
TextBox4.Visible = true;
89
goto outer;}}
if (Label28.Visible == true)
{if (Label17.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label17.BackColor = System.Drawing.Color.Green;
//Label29.Visible = true;
//Label29.Text = "Block5 sent";
System.Threading.Thread.Sleep(1000);
TextBox5.Visible = true;
goto outer;}}
if (Label29.Visible == true){
if (Label18.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label18.BackColor = Syste
m.Drawing.Color.Green;
//Label30.Visible = true;
//Label30.Text = "Block6 sent";
System.Threading.Thread.Sleep(1000);
TextBox6.Visible = true;
goto outer;}}
CheckBox1.Enabled = true;
//Label36.Visible = true;}
else
{count++;
update();
Session["c"] = count;
Random val = new Random();
int rno = val.Next(1, 3);
rannum = Convert.ToString(rno);
if (Label25.Visible == false)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label13.BackColor = System.Drawing.Color.Green;
//Label25.Visible = true;
//Label25.Text = "Block1 sent";
System.Threading.Thread.Sleep(1000);
TextBox1.Visible = true;
goto outer;}
if (Label25.Visible == true)
{if (Label14.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label14.BackColor = System.Drawing.Color.Green;
//Label26.Visible = true;
//Label26.Text = "Block2 sent";
System.Threading.Thread.Sleep(1000);
TextBox2.Visible = true;
goto outer;}}
90
if (Label26.Visible == true)
{if (Label15.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label15.BackColor = System.Drawing.Color.Green;
//Label27.Visible = true;
//Label27.Text = "Block3 sent";
System.Threading.Thread.Sleep(1000);
TextBox3.Visible = true;
goto outer;}}
if (rannum == "1")
{Label16.BackColor = System.Drawing.Color.Red;
Label28.Visible = true;
Label28.Text = "Level4 Corrupted";
string myStringVariable1 = string.Empty;
myStringVariable1 = "Fourth Packet is Corrupted";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else
{if (Label16.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label16.BackColor = System.Drawing.Color.Green;
//Label28.Visible = true;
//Label28.Text = "Block4 Sent";
System.Threading.Thread.Sleep(1000);
TextBox4.Visible = true;
goto outer;}}
if (rannum == "2")
{Label17.BackColor = System.Drawing.Color.Red;
Label29.Visible = true;
Label29.Text = "Level5 Corrupted";
string myStringVariable1 = string.Empty;
myStringVariable1 = "Fifth Level is Corrupted";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else
{if (Label17.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label17.BackColor = System.Drawing.Color.Green;
//Label29.Visible = true;
//Label29.Text = "Block5 Sent";
System.Threading.Thread.Sleep(1000);
TextBox5.Visible = true;
goto outer;}}
if (rannum == "3")
{Label18.BackColor = System.Drawing.Color.Red;
Label30.Visible = true;
Label30.Text = "Level6 Corrupted";
91
string myStringVariable1 = string.Empty;
myStringVariable1 = "Sixth Level is Corrupted";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else{
if (Label18.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label18.BackColor = System.Drawing.Color.Green;
//Label30.Visible = true;
//Label30.Text = "Block6 Sent ";
System.Threading.Thread.Sleep(1000);
TextBox6.Visible = true;
goto outer;}}
CheckBox1.Checked = false;
CheckBox1.Enabled = false;}}
else
{if (Label36.Visible == false)
{if (CheckBox1.Checked == false)
{if (Label25.Visible == false)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label13.BackColor = System.Drawing.Color.Green;
//Label25.Visible = true;
//Label25.Text = "Block1 Sent";
System.Threading.Thread.Sleep(1000);
TextBox1.Visible = true;
goto outer;}
if (Label25.Visible == true)
{if (Label14.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label14.BackColor = System.Drawing.Color.Green;
//Label26.Visible = true;
//Label26.Text = "Block2 Sent";
System.Threading.Thread.Sleep(1000);
TextBox2.Visible = true;
goto outer;}}
if (Label26.Visible == true)
{if (Label15.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label15.BackColor = System.Drawing.Color.Green;
//Label27.Visible = true;
//Label27.Text = "Block3 Sent";
System.Threading.Thread.Sleep(1000);
TextBox3.Visible = true;
goto outer;}}
if (Label27.Visible == true)
{if (Label16.BackColor != System.Drawing.Color.Green)
92
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label16.BackColor = System.Drawing.Color.Green;
//Label28.Visible = true;
//Label28.Text = "Block4 Sent";
System.Threading.Thread.Sleep(1000);
TextBox4.Visible = true;
goto outer;}}
if (Label28.Visible == true)
{if (Label17.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label17.BackColor = System.Drawing.Color.Green;
//Label29.Visible = true;
//Label29.Text = "Block5 Sent";
System.Threading.Thread.Sleep(1000);
TextBox5.Visible = true;
goto outer;}}
if (Label30.Visible == false)
{if (Label18.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label18.BackColor = System.Drawing.Color.Green;
//Label30.Visible = true;
//Label30.Text = "Block6 Sent";
System.Threading.Thread.Sleep(1000);
TextBox6.Visible = true;
goto outer;}}
if (Label30.Visible == true)
{if (Label19.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label19.BackColor = System.Drawing.Color.Green;
//Label31.Visible = true;
//Label31.Text = "Block7 Sent";
System.Threading.Thread.Sleep(1000);
TextBox7.Visible = true;
goto outer;}}
if (Label31.Visible == true)
{if (Label20.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label20.BackColor = System.Drawing.Color.Green;
//Label32.Visible = true;
//Label32.Text = "Block8 Sent";
System.Threading.Thread.Sleep(1000);
TextBox8.Visible = true;
goto outer;}}
if (Label32.Visible == true)
{if (Label21.BackColor != System.Drawing.Color.Green)
93
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label21.BackColor = System.Drawing.Color.Green;
//Label33.Visible = true;
//Label33.Text = "Block9 Sent";
System.Threading.Thread.Sleep(1000);
TextBox9.Visible = true;
goto outer;}}
//con.Open();
//SqlDataAdapter adp = new SqlDataAdapter("select * from filearchive where fid='" +
(string)Session["fid1"] + "'", con);
//DataSet ds = new DataSet();
//adp.Fill(ds);
//p1 = ds.Tables[0].Rows[0]["fowner"].ToString();
////SqlCommand c1 = new SqlCommand("select * from Sentfiles where Sendornot='" +
sendornotnull + "'", con);
////p2 = Convert.ToString(c1.ExecuteScalar());
//p3 = ds.Tables[0].Rows[0]["FID"].ToString();
//if(count==0)
//{
//if ((int)Session["c"] > 0)
//{
// sendornotnull = "Corrupted";
//}
//else
//{
// sendornotnull = "Success";
//}
// }
//SqlCommand cmd1 = new SqlCommand("Update Sentfiles set Sendornot='" +
sendornotnull + "'where FID='" + (string)Session["f"] + "'", con);
//cmd1.ExecuteNonQuery();
CheckBox1.Enabled = true;
Label36.Visible = true;
con.Close();}
else{
count++;
update();
Random val = new Random();
int rno = val.Next(1, 3);
rannum = Convert.ToString(rno);
if (Label25.Visible == false)
{if (Label13.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label13.BackColor = System.Drawing.Color.Green;
//Label25.Visible = true;
//Label25.Text = "Block1 Sent";
System.Threading.Thread.Sleep(1000);
TextBox1.Visible = true;
94
goto outer;}}
if (Label25.Visible == true)
{if (Label14.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label14.BackColor = System.Drawing.Color.Green;
//Label26.Visible = true;
//Label26.Text = "Block2 Sent";
System.Threading.Thread.Sleep(1000);
TextBox2.Visible = true;
goto outer;}}
if (Label26.Visible == true)
{if (Label15.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label15.BackColor = System.Drawing.Color.Green;
//Label27.Visible = true;
//Label27.Text = "Block3 Sent";
System.Threading.Thread.Sleep(1000);
TextBox3.Visible = true;
goto outer; }}
if (Label27.Visible == true)
{if (Label16.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label16.BackColor = System.Drawing.Color.Green;
//Label28.Visible = true;
//Label28.Text = "Block4 Sent";
System.Threading.Thread.Sleep(1000);
TextBox4.Visible = true;
goto outer;}}
if (Label28.Visible == true)
{if (Label17.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label17.BackColor = System.Drawing.Color.Green;
//Label29.Visible = true;
//Label29.Text = "Block5 Sent";
System.Threading.Thread.Sleep(1000);
TextBox5.Visible = true;
goto outer;}}
if (Label30.Visible == false)
{if (Label18.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label18.BackColor = System.Drawing.Color.Green;
//Label30.Visible = true;
//Label30.Text = "Block6 Sent";
System.Threading.Thread.Sleep(1000);
TextBox6.Visible = true;
95
goto outer;}}
if (rannum == "1")
{Label19.BackColor = System.Drawing.Color.Red;
Label31.Visible = true;
Label31.Text = "Level7 Corrupted";
string myStringVariable1 = string.Empty;
myStringVariable1 = "Seventh Level is Corrupted";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true); }
else
{ if (Label19.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label19.BackColor = System.Drawing.Color.Green;
//Label31.Visible = true;
//Label31.Text = "Block7 Sent";
System.Threading.Thread.Sleep(1000);
TextBox7.Visible = true;
goto outer;}}
if (rannum == "2")
{Label20.BackColor = System.Drawing.Color.Red;
Label32.Visible = true;
Label32.Text = "Level8 Corrupted";
string myStringVariable1 = string.Empty;
myStringVariable1 = "Eighth Level is Corrupted";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true); }
else
{if (Label20.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label20.BackColor = System.Drawing.Color.Green;
//Label32.Visible = true;
//Label32.Text = "Block8 Sent";
System.Threading.Thread.Sleep(1000);
TextBox8.Visible = true;
goto outer;}}
if (rannum == "3")
{Label21.BackColor = System.Drawing.Color.Red;
Label33.Visible = true;
Label33.Text = "Level9 Corrupted";
string myStringVariable1 = string.Empty;
myStringVariable1 = "Ninth Level is Corrupted";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true); }
else{
if (Label21.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label21.BackColor = System.Drawing.Color.Green;
96
//Label33.Visible = true;
//Label33.Text = "Block9 Sent ";
System.Threading.Thread.Sleep(1000);
TextBox9.Visible = true;
goto outer;}}
//con.Open();
//SqlDataAdapter adp = new SqlDataAdapter("select * from Sentfiles", con);
//DataSet ds = new DataSet();
//adp.Fill(ds);
//SqlCommand c1 = new SqlCommand("select * from Sentfiles where Sendornot='" +
sendornotnull + "'", con);
//p4 = Convert.ToString(c1.ExecuteScalar());
//p5 = ds.Tables[0].Rows[0]["FID"].ToString();
//string senornot = "CORRUPTED";
//SqlCommand cmd1 = new SqlCommand("Update Sentfiles set Sendornot='" + senornot +
"'where FID='" + p3 + "'", con);
//cmd1.ExecuteNonQuery();
CheckBox1.Checked = false;
CheckBox1.Enabled = false;}}}}}
outer:
tr = "";}
catch(Exception ex)
{MsgBox.Show("Time Out, Go back Update Data");}}
public void update()
{
con.Open();
SqlCommand cmd1 = new SqlCommand("Update filearchive set Sendornot='Success',s1='" +
TextBox1.Text + "',s2='" + TextBox2.Text + "',s3='" + TextBox3.Text + "',s4='" +
TextBox4.Text + "',s5='" + TextBox5.Text + "',s6='" + TextBox6.Text + "',s7='" +
TextBox7.Text + "',s8='" + TextBox8.Text + "',s9='" + TextBox9.Text + "',m1='" +
Label4.Text + "',m2='" + Label5.Text + "',m3='" + Label6.Text + "',m4='" + Label7.Text +
"',m5='" + Label8.Text + "',m6='" + Label9.Text + "',m7='" + Label10.Text + "',m8='" +
Label11.Text + "',m9='" + Label12.Text + "' where fid='" + (string)Session["fid1"] + "'",
con);
cmd1.ExecuteNonQuery();
con.Close();}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
Random val = new Random();
int rno = val.Next(12345, 54321);
cryptographykey = Convert.ToString(rno);
fileenccryptographykey = cr.Encrypt(cryptographykey);
splitfilesize = TextBox1.Text;
for (int i = 0; i < splitfilesize.Length; i++)
{char c = splitfilesize[i];
string binary = Convert.ToString(c, 2);
binary1 = binary1 + binary;}
binary1enc = cr.Encrypt(binary1);
Label4.Text = binary1;
System.Threading.Thread.Sleep(1000);
97
Label25.Visible = true;
Label25.Text = "Block1 Sent ";}
protected void TextBox2_TextChanged(object sender, EventArgs e)
{splitfilesize1 = TextBox2.Text;
for (int i1 = 0; i1 < splitfilesize1.Length; i1++)
{char c1 = splitfilesize1[i1];
string binar1 = Convert.ToString(c1, 2);
binary2 = binary2 + binar1;}
binary1enc1 = cr.Encrypt(binary2);
Label5.Text = binary2;
System.Threading.Thread.Sleep(1000);
Label26.Visible = true;
Label26.Text = "Block2 Sent";}
protected void TextBox3_TextChanged(object sender, EventArgs e)
{splitfilesize2 = TextBox3.Text;
for (int i2 = 0; i2 < splitfilesize2.Length; i2++)
{char c2 = splitfilesize2[i2];
string binar2 = Convert.ToString(c2, 2);
binary3 = binary3 + binar2;}
binary1enc2 = cr.Encrypt(binary3);
Label6.Text = binary3;
System.Threading.Thread.Sleep(1000);
Label27.Visible = true;
Label27.Text = "Block3 Sent";
//System.Threading.Thread.Sleep(1000);
//string myStringVariable1 = string.Empty;
//myStringVariable1 = "First part is Completed.Currently " + addsplit + " bytes are sent
successfully. ";
//ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1
+ "');", true);}
protected void TextBox4_TextChanged(object sender, EventArgs e)
{splitfilesize3 = TextBox4.Text;
for (int i3 = 0; i3 < splitfilesize3.Length; i3++)
{char c3 = splitfilesize3[i3];
string binar3 = Convert.ToString(c3, 2);
binary4 = binary4 + binar3;}
binary1enc3 = cr.Encrypt(binary4);
Label7.Text = binary4;
System.Threading.Thread.Sleep(1000);
Label28.Visible = true;
Label28.Text = "Block4 Sent";}
protected void TextBox5_TextChanged(object sender, EventArgs e)
{splitfilesize4 = TextBox5.Text;
for (int i4 = 0; i4 < splitfilesize4.Length; i4++)
{char c4 = splitfilesize4[i4];
string binar4 = Convert.ToString(c4, 2);
binary5 = binary5 + binar4;}
binary1enc4 = cr.Encrypt(binary5);
Label8.Text = binary5;
System.Threading.Thread.Sleep(1000);
98
Label29.Visible = true;
Label29.Text = "Block5 Sent";}
protected void TextBox6_TextChanged(object sender, EventArgs e)
{splitfilesize5 = TextBox6.Text;
for (int i5 = 0; i5 < splitfilesize5.Length; i5++)
{char c5 = splitfilesize5[i5];
string binar5 = Convert.ToString(c5, 2);
binary6 = binary6 + binar5;}
binary1enc5 = cr.Encrypt(binary6);
Label9.Text = binary6;
System.Threading.Thread.Sleep(1000);
Label30.Visible = true;
Label30.Text = "Block6 Sent";
//System.Threading.Thread.Sleep(1000);
//string myStringVariable3 = string.Empty;
//myStringVariable3 = "Second part is Completed.Currently " + addsplit + " bytes are sent
successfully. ";
//ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable3
+ "');", true);}
protected void TextBox7_TextChanged(object sender, EventArgs e)
{splitfilesize6 = TextBox7.Text;
for (int i6 = 0; i6 < splitfilesize6.Length; i6++)
{char c6 = splitfilesize6[i6];
string binar6 = Convert.ToString(c6, 2);
binary7 = binary7 + binar6;}
binary1enc6 = cr.Encrypt(binary7);
Label10.Text = binary7;
System.Threading.Thread.Sleep(1000);
Label31.Visible = true; Label31.Text = "Block7 Sent";}
protected void TextBox8_TextChanged(object sender, EventArgs e)
{splitfilesize7 = TextBox8.Text;
for (int i7 = 0; i7 < splitfilesize7.Length; i7++)
{char c7 = splitfilesize7[i7];
string binar7 = Convert.ToString(c7, 2);
binary8 = binary8 + binar7;}
binary1enc7 = cr.Encrypt(binary8); Label11.Text = binary8;
System.Threading.Thread.Sleep(1000);
Label32.Visible = true; Label32.Text = "Block8 Sent";}
protected void TextBox9_TextChanged(object sender, EventArgs e)
{splitfilesize8 = TextBox9.Text;
for (int i8 = 0; i8 < splitfilesize8.Length; i8++)
{char c8 = splitfilesize8[i8];
string binar8 = Convert.ToString(c8, 2);
binary9 = binary9 + binar8;} binary1enc8 = cr.Encrypt(binary9);
Label12.Text = binary9;
System.Threading.Thread.Sleep(1000);
Label33.Visible = true; Label33.Text = "Block9 Sent";
System.Threading.Thread.Sleep(1000);
MsgBox.Show("File Sent to Server with Metadata key & Alert Sent to TPA ");update();
//string myStringVariable3 = string.Empty;
99
//myStringVariable3 = "File Sent to Server with Metadata key \n Alert Sent to TPA";
//ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable3
+ "');", true);}}
RolesLogin.aspx
100
<cc1:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender2" runat="server"
WatermarkCssClass="watermarked" WatermarkText="Password"
TargetControlID="Textbox2"></cc1:TextBoxWatermarkExtender>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</asp:Content>
RolesLogin.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class Roleslogin : System.Web.UI.Page
{ string upid, uppwd;
protected void Button1_Click(object sender, EventArgs e)
{
upid = TextBox1.Text.ToUpper();
uppwd = TextBox2.Text.ToUpper();
if (TextBox1.Text == "")
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Roles ID";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}
else
{
if (TextBox2.Text == "")
{string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Roles Password";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else
{
if (upid == "ROLES" && uppwd == "ROLES")
{Response.Redirect("tpaverify.aspx");}
else
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Roles ID/Password Correcly.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
101
}}}}
protected void Button2_Click(object sender, EventArgs e)
{
TextBox1.Text = "";
TextBox2.Text = "";
}}
RolesUserAccountAuditor.aspx
102
runat="server" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 199px; left: 45px;" ID="Label12"
runat="server" Text="Age" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 199px; left: 180px;" ID="Label13"
runat="server" Text=":" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 199px; left: 240px;" ID="Label14"runat="server"
Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 252px; left: 45px;" ID="Label15"
runat="server" Text="Mobile" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 252px; left: 180px;" ID="Label16"
runat="server" Text=":" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 252px; left: 240px;" ID="Label17"
runat="server" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 305px; left: 45px;" ID="Label18"
runat="server" Text="Emailid" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 305px; left: 180px;" ID="Label19"
runat="server" Text=":" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 305px; left: 240px;" ID="Label20"
runat="server" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 358px; left: 45px;" ID="Label21"
runat="server" Text="Date" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 388px; left: 45px;" ID="Label25"
runat="server" Text="Roles" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 358px; left: 180px;" ID="Label22"
runat="server" Text=":" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 388px; left: 180px; right: 248px;" ID="Label26"
runat="server" Text=":" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 358px; left: 240px;" ID="Label23"
runat="server" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:Label style="position: absolute; top: 388px; left: 240px; height: 19px; width: 139px;"
ID="Label27"runat="server" Font-Names="Rockwell" Font-Size="Large"></asp:Label>
<asp:LinkButton ID="LinkButton7" runat="server"style="position:absolute; top: 450px; left:
-30px;" Font-Bold="True"Font-Names="Imprint MT Shadow" ForeColor="#0000CC"
onclick="LinkButton7_Click" Font-Size="X-Large" >RolesAuditor(True)</asp:LinkButton>
<asp:LinkButton ID="LinkButton8" runat="server"style="position:absolute; top: 450px; left:
220px; height: 26px; width: 243px;" Font-Bold="True"Font-Names="Imprint MT Shadow"
ForeColor="#0000CC"onclick="LinkButton8_Click" Font-Size="X-Large" >Roles
Auditor(Fales)</asp:LinkButton></asp:Panel>
<asp:LinkButton ID="LinkButton2" runat="server"STYLE="position:absolute; top: 435px;
left: 755px;" Font-Bold="True"Font-Names="Imprint MT Shadow" Font-Size="Large" Font-
Underline="False"ForeColor="Black" PostBackUrl="~/tpaverify.aspx" >Alert
Message</asp:LinkButton>
<asp:LinkButton ID="LinkButton1" runat="server" Font-Bold="True"Font-Names="Imprint
MT Shadow" Font-Size="Large" Font-Underline="False"ForeColor="Black"
PostBackUrl="~/KeyResponses.aspx"STYLE="position:absolute; top: 475px; left: 755px;
width: 161px;">Key Responses</asp:LinkButton>
<asp:LinkButton ID="LinkButton5" runat="server" Font-Bold="True"Font-Names="Imprint
MT Shadow" Font-Size="Large" Font-Underline="False"ForeColor="Black"
PostBackUrl="~/Intruderdetails.aspx"STYLE="position:absolute; top: 515px; left: 755px;
width: 176px;">Intruder Details</asp:LinkButton>
103
<asp:LinkButton ID="LinkButton4" runat="server" Font-Bold="True"Font-
Names="ImprintMT Shadow" Font-Size="Large" Font-Underline="False"
ForeColor="Black" PostBackUrl="~/AdminOwnerDetails.aspx"STYLE="position:absolute;
top: 555px; left: 755px; width: 161px;">ClientDetails</asp:LinkButton>
</asp:Content>
RolesUserAccountAuditor
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class RolesUseraccountauditor : System.Web.UI.Page
{SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{try
{if (!IsPostBack){Label24.Visible = false;
SqlDataAdapter adp = new SqlDataAdapter("Select ownerid from Registration", con);
DataSet ds = new DataSet();adp.Fill(ds);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{DropDownList1.Items.Add(ds.Tables[0].Rows[i]["ownerid"].ToString());}}}
catch (Exception ex)
{MsgBox.Show("Time Out");}}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{if (DropDownList1.SelectedItem.Text == "--Select--")
{Panel2.Visible = false;}else{
Panel2.Visible = true;
SqlDataAdapter adp = new SqlDataAdapter("Select * from Registration where ownerid='" +
DropDownList1.SelectedItem.Text + "'", con);
DataSet ds = new DataSet();adp.Fill(ds);
Label5.Text = ds.Tables[0].Rows[0]["oid"].ToString();
Label8.Text = ds.Tables[0].Rows[0]["ownerid"].ToString();
Label11.Text = ds.Tables[0].Rows[0]["gender"].ToString();
Label14.Text = ds.Tables[0].Rows[0]["age"].ToString();
Label17.Text = ds.Tables[0].Rows[0]["mobile"].ToString();
Label20.Text = ds.Tables[0].Rows[0]["emailid"].ToString();
Label23.Text = ds.Tables[0].Rows[0]["date"].ToString();
Label27.Text = ds.Tables[0].Rows[0]["RolesAuditor"].ToString();}}
protected void LinkButton7_Click(object sender, EventArgs e)
{con.Open();
104
SqlCommand bla = new SqlCommand("Update Registration set RolesAuditor='Roles Auditor
Successfully' where oid='" + Label5.Text + "'", con);
bla.ExecuteNonQuery();
Label24.Visible = true;
Label24.Text = "Hi "+Label8.Text+ " Roles Auditor Successfully";
con.Close();}}
ServerVerify.aspx
105
Underline="False"ForeColor="Black"STYLE="position:absolute; top: 542px; left: 895px;
width: 149px;"PostBackUrl="~/CloudReport.aspx">User Report</asp:LinkButton>
<asp:LinkButton ID="LinkButton3" runat="server" Font-Bold="True"
Font-Names="Imprint MT Shadow" Font-Size="Large" Font-Underline="False"
ForeColor="Black"STYLE="position:absolute; top: 582px; left: 895px; width: 149px;"
PostBackUrl="~/Default.aspx">Back to Home</asp:LinkButton>
</asp:Content>
ServerVerify.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class serververify : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{
SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where tpaview
='View'", con);
DataSet ds1 = new DataSet();
adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{
GridView1.DataSource = ds1;
GridView1.DataBind();
}
else
{
MsgBox.Show("No Request Found");
}}
public void bindgrid()
{
SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where tpaview
='View'", con);
DataSet ds1 = new DataSet();
adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{GridView1.DataSource = ds1;
GridView1.DataBind();}
106
else
{MsgBox.Show("No Request Found");}}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
bindgrid();
}}
TpaVerify.aspx
107
STYLE="position:absolute; top: 515px; left: 755px; width: 172px;">Intruder
Details</asp:LinkButton><asp:LinkButton ID="LinkButton4" runat="server" Font-
Bold="True"Font-Names="Imprint MT Shadow" Font-Size="Large" Font-Underline="False"
ForeColor="Black" PostBackUrl="~/AdminOwnerDetails.aspx"
STYLE="position:absolute; top: 555px; left: 755px; width: 161px;">Client
Details</asp:LinkButton>
</asp:Content>
TpaVerify.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class tpaverify : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{
SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where tpaview!
='View'", con);
DataSet ds1 = new DataSet();
adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{GridView1.DataSource = ds1;
GridView1.DataBind();}
else
{MsgBox.Show("No Request Found");}}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{GridView1.PageIndex = e.NewPageIndex;
bindgrid();
update();}
public void bindgrid()
{SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where tpaview!
='View'", con);
DataSet ds1 = new DataSet();
adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{GridView1.DataSource = ds1;
GridView1.DataBind();}
else
108
{MsgBox.Show("No Request Found");}}
public void update()
{SqlCommand cmd = new SqlCommand("update filearchieve set keystatus='sent' where
tpaview!=view", con);
cmd.ExecuteNonQuery();
con.Close();
}}
UserttoRolesauditor.aspx
109
Font-Names="Times New Roman" Font-Size="Large" Font-Underline="False"
ForeColor="Red"STYLE="position:absolute; top: 575px; left: 755px; width: 149px;"
PostBackUrl="~/Default.aspx">Back to Home</asp:LinkButton>
<asp:Label ID="Label8" runat="server" Text="Label" Visible="False"></asp:Label>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</asp:Content>
UserttoRolesauditor.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Diagnostics;
using System.Text;
using System.Security.Cryptography;
using System.IO;
using System.Net;
using System.Net.Mail;
using System.Data.SqlClient;
public partial class UserttoRolesauditor : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
string ownerid;
protected void Page_Load(object sender, EventArgs e)
{
try{
if (!IsPostBack)
{
ownerid = (string)Session["ownerid"];
SqlDataAdapter sda = new SqlDataAdapter("select * from Registration where ownerid ='" +
ownerid + "'", con);
DataSet ds = new DataSet();
sda.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
}}
catch (Exception ex)
{
MsgBox.Show("Time out");
}}
110
protected void LinkButton2_Click(object sender, EventArgs e)
{Response.Redirect("OwnerFileUpload.aspx");}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Redirect("packetsending.aspx");
}}
9. TESTING
DEFINITION
Specification
Functionality
Performance
Debugging is that activity which is performed after executing a successful test case.
Debugging consists of determining the exact nature and location of the suspected
error and fixing the error. Debugging is probably the most difficult activity in software
development from a psychological point of view for the following reasons: Debugging is
done by the person who developed the software, and it is hard for that person to acknowledge
that an error was made. Compared to the other software-development activities,
comparatively little research, literature, and formal instruction exist on the process of
debugging of the two aspects of debugging, locating the error represents about 95% of the
activity. Hence, the rest of this section concentrates on the process of finding the location of
an error, given a suspicion that an error exists, based on the results of a successful test case.
111
9.1 OBJECTIVES
112
9.2 TEST PROCESS
To review the test basis. (The test basis is the information we need in order to start
the test analysis and create our own test cases. Basically it’s a documentation on which test
cases are based, such as requirements, design specifications, product risk analysis,
architecture and interfaces. We can use the test basis documents to understand what the
system should do once built.)
To check the test logs against the exit criteria specified in test planning.
To assess if more test are needed or if the exit criteria specified should be changed.
To check which planned deliverables are actually delivered and to ensure that all
incident reports have been resolved.
To finalize and archive test ware such as scripts, test environments, etc. for later
reuse.
114
As far as possible, write test cases in such a way that you test only one thing at a time.
Do not overlap or complicate test cases. Attempt to make your test cases ‘atomic’. Ensure
that all positive scenarios and negative scenarios are covered.
Language
Write in simple and easy to understand language.
Use active voice: Do this, do that.
Use exact and consistent names (of forms, fields, etc)
Characteristics of a good test case
Accurate: Exacts the purpose.
Economical: No unnecessary steps or words.
Traceable: Capable of being traced to requirements.
Repeatable: Can be used to perform the test over and over.
115
This method is named so because the software program, in the eyes of the tester, is
like a black box; inside which one cannot see.This method of attempts to find errors in the
following categories:
Boundary Value Analysis is a software test design technique that involves determination of
boundaries for input values and selecting values that are at the boundaries and just
inside/outside of the boundaries as test data.
116
Black box testing advantages
Tests are done from a user’s point of view and will help in exposing discrepancies in
the specifications
Tester need not know programming languages or how the software has been
implemented
Black box testing disadvantages
Only a small number of possible inputs can be tested and many program paths will be
left untested.
White Box Testing is contrasted with Black Box Testing. View Differences between
Black Box Testing and White Box Testing.
Example
A tester, usually a developer as well, studies the implementation code of a certain
field on a webpage, determines all legal (valid and invalid) AND illegal inputs and verifies
the outputs against the expected outcomes, which is also determined by studying the
implementation code.
117
White box testing disadvantages
Since tests can be very complex, highly skilled resources are required, with thorough
knowledge of programming and implementation.
Verification and validation are independent procedures that are used together for
checking that a product, service, or system meets requirements and specifications and that it
fulfills its intended purpose. These are critical components of a quality management
system such as ISO 9000. The words "verification" and "validation" are sometimes
preceded with "independent", indicating that the verification and validation is to be
performed by a disinterested third party.
The PMBOK guide, a standard adopted by IEEE, defines them as follows in its 4th
edition:
"Validation. The assurance that a product, service, or system meets the needs of the
customer and other identified stakeholders. It often involves acceptance and suitability
with external customers. Contrast with verification."
"Verification. The evaluation of whether or not a product, service, or system complies
with a regulation, requirement, specification, or imposed condition. It is often an internal
process. Contrast with validation."
118
Figure: 9.4.3.1 Required Field Validator Control
119
10.REPORT
120
11.CONCLUSION
This project addressed trust issues in cryptographic Role Based Access Control
systems for securing data storage in a cloud Environment. It proposed trust models for
owners and roles in Role Based Access Control systems which are using cryptographic Role
Based Access Control schemes to secure stored data. These trust models assist owners and
roles to create flexible access policies, and cryptographic Role Based Access Control
schemes ensure that these policies are enforced in the cloud. The trust models enable the
owners and roles to determine the trustworthiness of individual roles and users in the Role
Based Access Control system respectively. They allow the data owners to use the trust
evaluation to decide whether or not to store their encrypted data in the cloud for a particular
role. The models also enable the role managers to use the trust evaluation in their decision to
grant the membership to a particular user. Another significant contribution of this paper is
that the proposed trust models take into account role inheritance and hierarchy in the
evaluation of trustworthiness of roles. As far as we are aware, this is the first time such a trust
model for role-based access control system taking into account role inheritance has been
proposed. It described the application of the trust models by considering a practical scenario
and illustrating how the trust evaluations can be used to reduce the risks and enhance the
quality of decision making by data owners and role managers of the cloud storage service.
121
12.FUTURE ENHANCEMENTS
There have only been some related works which have addressed only trust on users in
Role Based Access Control systems proposed a trust model for Role Based Access Control
system which considers users’ trust by assigning trust levels to users. These trust levels are
based on a number of factors such as user credentials, user behavior history and
recommendations from other users. Trust levels are then mapped to roles. In a trust model
for Role Based Access Control was introduced which evaluates the trust in users based on
user behaviors and context, in a context-aware access control model. Another trust model
was discussed in which also uses trust level to determine the access privileges of users. All
these trust models only consider the trust of users in a Role Based Access Control system.
None of these works address the trust for data owners on the Role Based Access Control
system itself thereby determining the trust of the roles in the Role Based Access Control
system with which they want to interact. The trust for data owners is critical in cloud
storage systems which has been addressed in this paper. As an extension of the owners’ R
Role Based Access Control trust model, our trust models have also addressed the roles’
trust on users. The existing works control the access privileges of a user depending on his
or her trust level.
122
13.REFERENCES
[1] D. F. Ferraiolo and D. R. Kuhn, “Role-based access controls,” in Proceedings of the 15th
NIST-NCSC National Computer Security Con- ference. NIST, National Computer Security
Center, October 10-13 1992, pp. 554 – 563.
[2] S. D. C. di Vimercati, S. Foresti, S. Jajodia, S. Paraboschi, and P. Samarati, “A data
outsourcing architecture combining cryptography and access control,” in Proceedings of
CSAW 2007. ACM, November 2 2007, pp. 63–69.
[3] S. D. C. D. Vimercati, S. Foresti, S. Jajodia, S. Paraboschi, and P. Samarati, “Over-
encryption: Management of access control evolution on outsourced data,” in VLDB. ACM,
September 23-27 2007, pp. 123– 134.
[4] S. Yu, C. Wang, K. Ren, and W. Lou, “Achieving Secure, Scalable, and Fine-grained
Data Access Control in Cloud Computing,” in INFOCOM. IEEE, March 15-19 2010, pp.
534–542.
[5] Y. Zhu, H. Hu, G.-J. Ahn, H. Wang, and S.-B. Wang, “Provably secure role-based
encryption with revocation mechanism,” Journal of Computer Science and Technology, vol.
26, no. 4, pp. 697–710, 2011.
[6] L. Zhou, V. Varadharajan, and M. Hitchens, “Enforcing role-based access control for
secure data storage in the cloud,” The Computer Journal, vol. 54, no. 13, pp. 1675–1687,
October 2011.
[7] L. Zhou, V. Varadharajan, and M. Hitchens, “Integrating trust with cryptographic role-
based access control for secure cloud data storage,” in TrustCom 2013. IEEE, July 2013, pp.
560–569.
[8] L. Zhou, V. Varadharajan, and M. Hitchens, “Achieving Secure Role- Based Access
Control on Encrypted Data in Cloud Storage,” IEEE Transactions on Information Forensics
and Security, vol. 8, no. 12, pp. 1947–1960, 2013.
[9] R. S. Sandhu, E. J. Coyne, H. L. Feinstein, and C. E. Youman, “Role- based access
control models,” IEEE Computer, vol. 29, no. 2, pp. 38–47, 1996.
[10] R. S. Sandhu, D. F. Ferraiolo, and D. R. Kuhn, “The NIST model for role-based access
control: towards a unified standard,” in RBAC00, ACM, 2000, pp. 47–
123