Doubble Encription
Doubble Encription
Doubble Encription
INTRODUCTION
PROJECT DESCRIPTION
In this project Encryption is the conversion of data into a form, called a
cipher text that cannot be easily understood by unauthorized people. Decryption is the
process of converting encrypted data back into its original form, so it can be understood.
The use of encryption/decryption is as old as the art of communication. In wartime, a
cipher, often incorrectly called a "code," can be employed to keep the enemy from obtaining
the contents of transmissions. (Technically, a code is a means of representing a signal without
the intent of keeping it secret; examples are Morse code and ASCII.) Simple ciphers include
the substitution of letters for numbers, the rotation of letters in the alphabet, and the
"scrambling" of voice signals by inverting the sideband frequencies. More complex ciphers
work according to sophisticated computer a algorithm that rearranges the data bits in digital
signals.
In order to easily recover the contents of an encrypted signal, the correct decryption
key is required. The key is an algorithm that "undoes" the work of the encryption algorithm.
Alternatively, a computer can be used in an attempt to "break" the cipher. The more complex
the encryption algorithm, the more difficult it becomes to eavesdrop on the communications
without access to the key.
Encryption/decryption is especially important in wireless communications. This is
because wireless circuits are easier to "tap" than their hard-wired counterparts. Nevertheless,
encryption/decryption is a good idea when carrying out any kind of sensitive transaction,
such as a credit-card purchase online, or the discussion of a company secret between different
departments in the organization. The stronger the cipher that is, the harder it is for
unauthorized people to break it the better, in general. However, as the strength of
encryption/decryption increases, so does the cost.
In recent years, a controversy has arisen over so-called strong encryption. This refers
to ciphers that are essentially unbreakable without the decryption keys. While most
companies and their customers view it as a means of keeping secrets and minimizing fraud,
some governments view strong encryption as a potential vehicle by which terrorists might
evade authorities.
Decryption keys would be stored in a supposedly secure place, used only by
authorities, and used only if backed up by a court order. Opponents of this scheme argue that
criminals could hack into the key-escrow database and illegally obtain, steal, or alter the
keys..
3. Public Key
RSA Algorithm
Symmetric Key
AES (Advanced Encryption Standard)
In cryptography, the Advanced Encryption Standard (AES) is a symmetric-key
encryption standard adopted by the U.S. government. The standard comprises three block
ciphers, AES-128, AES-192 and AES-256, adopted from a larger collection originally
published as Rijndael. Each of these ciphers has a 128-bit block size, with key sizes of 128,
192 and 256 bits, respectively.
AES was announced by National Institute of Standards and Technology (NIST) as U.S.
FIPS PUB 197 (FIPS 197) on November 26, 2001 after a 5-year standardization process in
which fifteen competing designs were presented and evaluated before Rijndael was selected
as the most suitable (see Advanced Encryption Standard process for more details). It became
effective as a Federal government standard on May 26, 2002 after approval by the Secretary
of Commerce.
The Rijndael cipher was developed by two Belgian cryptographers, Joan Daemen
and Vincent Rijmen, and submitted by them to the AES selection process.[4] Rijndael (Dutch
pronunciation: [rindal][5]) is a wordplay based upon the names of the two inventors.
generate a pseudo-random stream which is XOR-end with the plaintext to give the cipher
text. Each element in the state table is swapped at least once.
The RC4 key is often limited to 40 bits, because of export restrictions but it is
sometimes used as a 128 bit key. It has the capability of using keys between 1 and 2048 bits.
RC4 is used in many commercial software packages such as Lotus Notes and Oracle Secure
SQL. It is also part of the Cellular Specification.
ALGORITHM DESCRIPTION
The RC4 algorithm works in two phases:
1. Key Setup
2. Ciphering.
Key setup
Key setup is the first and most difficult phase of this algorithm. During a N-bit key
setup (N being your key length), the encryption key is used to generate an encrypting variable
using two arrays, state and key, and N-number of mixing operations.
In the attached project you can see how I do it in the EncryptionKey set property
Once the encrypting variable is produced from the key setup, it enters the ciphering phase,
where it is XOR-ed with the plain text message to create an encrypted message. If the bits are
the same, the result is 0. Once the receiver gets the encrypted message, he decrypts it by
XOR-ing the encrypted message with the same encrypting variable.In the attached project
you can see how I do it in the RC4Engine class:
I want to remark that the cripted message comes decrypted using the algorithm used in the
encryption phase.
Triple DES:
Triple DES is simply another mode of DES operation. It takes three 64-bit keys, for
an overall key length of 192 bits. In Private Encryptor, you simply type in the entire 192-bit
(24 character) . The Triple DES DLL then breaks the user provided key into three subkeys,
padding the keys if necessary so they are each 64 bits long. The procedure for encryption is
exactly the same as regular DES, but it is repeated three times key.
Consequently, Triple DES runs three times slower than standard DES, but is much
more secure if used properly. The procedure for decrypting something is the same as the
procedure for encryption, except it is executed in reverse. Like DES, data is encrypted and
decrypted in 64-bit chunks. Unfortunately, there are some weak keys that one should be
aware of: if all three keys, the first and second keys, or the second and third keys are the
same, then the encryption procedure is essentially the same as standard DES.. Note that
although the input key for DES is 64 bits long, the actual key used by DES is only 56 bits in
length. These parity bits are ignored, so only the seven most significant bits of each byte are
used, resulting in a key length of 56 bits. This means that the effective key strength for Triple
DES is actually 168 bits because each of the three keys contains 8 parity bits that are not used
during the encryption process.
Public Key
RSA Algorithm
The RSA algorithm is named after Ron Rivest, Adi Shamir and Len Adleman, who
invented it in 1977 [RIVE78]. The basic technique was first discovered in 1973 by Clifford
Cocks [COCK73] of CESG (part of the British GCHQ) but this was a secret until 1997. The
patent taken out by RSA Labs has expired.
The RSA algorithm can be used for both public key encryption and digital signatures.
Its security is based on the difficulty of factoring large integers.
Key Generation Algorithm
1. Generate two large random primes, p and q, of approximately equal size such that their
product n = pq is of the required bit length, e.g. 1024 bits. [See note 1].q
2. Compute n = pq and () phi = (p-1)(q-1).
3. Choose an integer e, 1 < e < phi, such that gcd (e, phi) = 1. [See note 2].
4. Compute the secret exponent d, 1 < d < phi, such that Ed 1 (mod phi). [See note 3].
5. The public key is (n, e) and the private key is (n, d). Keep all the values d, p, q and phi
secret.
n is known as the modulus.
e is known as the public exponent or encryption exponent or just the exponent.
d is known as the secret exponent or decryption exponent.
Encryption
Sender A does the following:
Decryption
Recipient B does the following:-
Signature verification
Recipient B does the following:
CHAPTER -2
SOFTWARE PROJECT PLAN
7
This chapter discusses about that time schedule for the project and it contains the various
phases of the project.
TASK
DURATION
Requirement Specification
Requirement document
specification
Design analysis
Design Documentation
Design Review
Coding
10 Days
10 Days
20 Days
15 Days
20 Days
15 Days
90 Days
Total
CHAPTER-3
CUSTOMER REQUIREMENTS DETERMINATION
8
Drawbacks
Some of the drawbacks are:
1. Lack of security
2. Key byte is generated without user interaction
Benefits
1. Security is enhanced in well manner.
2. Users set the byte key manually.
CHAPTER 4
Start
Authentication
User
Symmetric Key
RC4
Algorithm
AES
Algorithm
Public Key
Triple DES
Algorithm
11
RSA
Algorithm
The project must the end user requirements. Accuracy and fast must be imposed in the
Project.
The project is development as easy as possible for the sake of end user. The project
has to be developed with view of satisfying the future requirements and future enhancement.
The tool has been finally implemented satisfying the needs specified by the company.
As per the performance is concerned this system said is performing This processing as well
as tine taken to generate well reports where also even when large amount of data was used.
PROCESSOR
RAM
128 MD SD RAM
MONITOR
15 COLOR
HARD DISK
20 GB
FLOPPY DRIVE
1.44 MB
CD DRIVE
LG 52X
KEYBOARD
MOUSE
3 BUTTONS
Windows XP Professional
ENVIRONMENT
.NET FRAMEWORK
Version 3.5
LANGUAGE
C#.NET
WEB TECHNOLOGY
ASP.NET
BACKEND
Web application are available via network access, it is a difficult. If not possible, to
limit the population of the end-user who may access the applications? In order to product
sensitive connect and provide secure mode be implemented throughout the infrastructure
that the supports web application and within the application itself.
Web Application have become heavy integrated with critical corporate and database.
E-commerce application extracts and then store sensitive customer information.
Error recovery
Quality
CHAPTER-5
14
SYSTEM ANALYSIS
In this section discussed about data flow diagram, Entity relationship diagram. These
things are represented as diagrams with proper notation.
5.1.1. Process
Process show what system does. Each process has one or more data inputs and
produce one or more data output, Circles in a data flow diagram represent process. Each
process has unique name and number. This name and number appear inside the circle that
represents the processes in a data flow diagram.
This process is represented as circle
15
DFD-Level-1
Login
16
Symmetric Key
RC4
Algorithm
Encryption
AES
Algorithm
Decryption
Encryption
Triple DES
Algorithm
Encryption
Decryption
Salt Value
Decryption
Setting
Hash
Algorithm
Password
Iteration
DFD-Level-2
Login
Public Key
Encryption
Key Pair
Generation
Decryption
Public Key
17
Private Key
Key Size
5.2 ER Diagram
Start
Authentication
User
Symmetric Key
RC4
Algorithm
Public Key
Triple DES
Algorithm
AES
Algorithm
18
RSA
Algorithm
Select a Algorithm
Setup a Algorithm
Encryption
View Encrypt Text
Select a Algorithm
Setup a Algorithm
Decryption
View Output Text File
19
Title
Submission
Authorization
Certificate
Students
DB
Learning
Process
Training
Problem Analysis:
ENCRYPTION
Authorization
Signatory
Front-end Asp.net
Back-end: SQL Server
Code behind: C#.net
Networking Design:
Internet Explorer 6.0
Coding
Validation
Testing
Docume
nt
Reports
Certificate
Complete Certificate
Programmer Training
Certificate
20
CHAPTER 6
SYSTEM DESIGN
6.1 INPUT DESIGN
Input design is the process of converting user-originated inputs to a computer-based
format. Input design is one of the most expensive phases of the operation of computerized
system and is often the major problem of a system.
In the project, the input design is made in various window forms with
various methods. This project consist of Encryption is the conversion of data into a form,
called a cipher text, that cannot be easily understood by unauthorized people. Decryption is
the process of converting encrypted data back into its original form, so it can be understood.
21
6.4.1 Normalization:
Normalization is the process of strutting relational database schema such that most
ambiguity is removed. The stage of normalization are referred to as forms and progress from
the least restrictive(first normal form)through the most restrictive(Fifth normal form),
generally , most database designers do not attempt to implement anything higher then normal
form of Boyce code Normal Form.
22
TABLE DESIGN:
Introduction
C# is one of the families of languages Microsoft has designed to be part of its .NET
framework. This paper gives a comprehensive introduction to C#, but before we start it is
necessary to outline some of the .NET concepts that will underpin the discussion in this
paper.
C# is part of the .NET Common Language Infrastructure (CLI). The CLI is a
framework that enables the multiple .NET languages to talk to each other, and is specifically
designed for strongly types languages.
The CLI is comprised of the Common Intermediate Language (CIL) a common
machine independent language into which all .NET applications are compiled, the
Common Type System (CTS) a set of types that can be used interchangeably between
23
the .NET languages and the Virtual Execution System (VES) which just-in-time compiles
the CIL into native assembly code. The complete set of rules that enable all .NET language to
talk to each other is called the Common Language System (CLS).
A compiled C# program also contains a block of metadata (data about the program
itself) called a manifest. This metadata allows reflection and effectively eliminates the need
for the registry.
The common language runtime is the foundation of the .NET Framework. It manages
code at execution time, providing important services such as memory management, thread
management, and remoting and also ensures more security and robustness. The concept of
code management is a fundamental principle of the runtime. Code that targets the runtime is
known as managed code, while code that does not target the runtime is known as unmanaged
code.
24
Security.
Robustness.
Productivity.
Performance.
SECURITY
The runtime enforces code access security. The security features of the
runtime thus enable legitimate Internet-deployed software to be exceptionally feature rich.
With regards to security, managed components are awarded varying degrees of trust,
depending on a number of factors that include their origin to perform file-access operations,
registry-access operations, or other sensitive functions.
25
ROBUSTNESS:
The runtime also enforces code robustness by implementing a strict typeand code-verification infrastructure called the common type system (CTS). The CTS ensures
that all managed code is self-describing. The managed environment of the runtime eliminates
many common software issues.
PRODUCTIVITY:
ASP.NET
ASP.NET is the next version of Active Server Pages (ASP); it is a unified Web
development platform that provides the services necessary for developers to build enterpriseclass Web applications. While ASP.NET is largely syntax compatible, it also provides a new
programming model and infrastructure for more secure, scalable, and stable applications.
ASP.NET is a compiled, NET-based environment, we can author applications in any
.NET compatible language, including Visual Basic .NET, C#, and JScript .NET. Additionally,
the entire .NET Framework is available to any ASP.NET application. Developers can easily
access the benefits of these technologies, which include the managed common language
runtime environment (CLR), type safety, inheritance, and so on.
ASP.NET has been designed to work seamlessly with WYSIWYG HTML editors and
other programming tools, including Microsoft Visual Studio .NET. Not only does this make
26
Web development easier, but it also provides all the benefits that these tools have to offer,
including a GUI that developers can use to drop server controls onto a Web page and fully
integrated debugging support.
Developers can choose from the following two features when creating an ASP.NET
application. Web Forms and Web services, or combine these in any way they see fit. Each is
supported by the same infrastructure that allows you to use authentication schemes; cache
frequently used data, or customizes your application's configuration, to name only a few
possibilities.
Web Forms allows us to build powerful forms-based Web pages. When building these
pages, we can use ASP.NET server controls to create common UI elements, and program
them for common tasks. These controls allow we to rapidly build a Web Form out of reusable
built-in or custom components, simplifying the code of a page.
An XML Web service provides the means to access server functionality remotely. Using
Web services, businesses can expose programmatic interfaces to their data or business logic,
which in turn can be obtained and manipulated by client and server applications. XML Web
services enable the exchange of data in client-server or server-server scenarios, using
standards like HTTP and XML messaging to move data across firewalls. XML Web services
are not tied to a particular component technology or object-calling convention. As a result,
programs written in any language, using any component model, and running on any operating
system can access XML Web services
Each of these models can take full advantage of all ASP.NET features, as well as
the power of the .NET Framework and .NET Framework common language runtime.
Accessing databases from ASP.NET applications is an often-used
technique for displaying data to Web site visitors. ASP.NET makes it easier than ever to
access databases for this purpose. It also allows us to manage the database from your code.
ASP.NET provides a simple model that enables Web developers to write logic that
runs at the application level. Developers can write this code in the global.aspx text file or in a
compiled class deployed as an assembly. This logic can include application-level events, but
developers can easily extend this model to suit the needs of their Web application.
ASP.NET provides easy-to-use application and session-state facilities that are
familiar to ASP developers and are readily compatible with all other .NET Framework APIs.
27
28
The OLAP Services feature available in SQL Server version 7.0 is now called
SQL Server 2000 Analysis Services. The term OLAP Services has been replaced with the
term Analysis Services. Analysis Services also includes a new data mining component. The
Repository component available in SQL Server version 7.0 is now called Microsoft SQL
Server 2000 Meta Data Services. References to the component now use the term Meta Data
Services. The term repository is used only in reference to the repository engine within Meta
Data Services
SQL-SERVER database consist of six type of objects,
They are,
1. TABLE
2. QUERY
3. FORM
4. REPORT
5. MACRO
TABLE:
29
A query is a question that has to be asked the data. Access gathers data that answers
the question from one or more table. The data that make up the answer is either dynaset (if
you edit it) or a snapshot(it cannot be edited).Each time we run query, we get latest
information in the dynaset. Access either displays the dynaset or snapshot for us to view or
perform an action on it ,such as deleting or updating.
FORMS:
A form is used to view and edit information in the database record by record .A form
displays only the information we want to see in the way we want to see it. Forms use the
familiar controls such as textboxes and checkboxes. This makes viewing and entering data
easy.
Views of Form:
We can work with forms in several primarily there are two views,
They are,
1. Design View
2. Form View
Design View
To build or modify the structure of a form, we work in forms design view. We can
add control to the form that are bound to fields in a table or query, includes textboxes, option
buttons, graphs and pictures.
Form View
The form view which display the whole design of the form.
REPORT:
A report is used to vies and print information from the database. The report can
ground records into many levels and compute totals and average by checking values from
many records at once. Also the report is attractive and distinctive because we have control
over the size and appearance of it.
MACRO:
A macro is a set of actions. Each action in macros does something. Such as opening a form
or printing a report .We write macros to automate the common tasks the work easy and save
the time
30
6.7Algorithm:
Step1: Enter correct username and password
Step 2: Enter the encrypt text in notepad view
Step 3: Select any one symmetric key or public key algorithm
Step4: Setup the AES Algorithm Value
Step5: Save as Private Key for RSA Algorithm
Step6: Save as Public Key for RSA Algorithm
Step7: Select Encrypt Text and Decrypt any one algorithm
Step8: Select the save file and decrypt it.
Step9: Successfully Closed the Application
31
CHAPTER 7
CODING
Main Form
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Windows.Forms;
namespace EncryptionAlgorithms
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Login());
}
}
}
AES Algorithm
using
using
using
using
using
using
System;
System.IO;
System.Collections.Generic;
System.Linq;
System.Text;
System.Security.Cryptography;
namespace EncryptionAlgorithms
{
public class AESEngine
{
public static string Encrypt(string plainText,
string passPhrase,
string saltValue,
string hashAlgorithm,
int passwordIterations,
string initVector,
int keySize)
{
PasswordDeriveBytes password = new PasswordDeriveBytes(
passPhrase,
32
saltValueBytes,
hashAlgorithm,
passwordIterations);
// Use the password to generate pseudo-random bytes for the
encryption
// key. Specify the size of the key in bytes (instead of bits).
byte[] keyBytes = password.GetBytes(keySize / 8);
// Create uninitialized Rijndael encryption object.
RijndaelManaged symmetricKey = new RijndaelManaged();
// It is reasonable to set encryption mode to Cipher Block
Chaining
// (CBC). Use default options for other symmetric key
parameters.
symmetricKey.Mode = CipherMode.CBC;
// Generate encryptor from the existing key bytes and
initialization
// vector. Key size will be defined based on the number of the
key
// bytes.
ICryptoTransform encryptor =
symmetricKey.CreateEncryptor(keyBytes,initVectorBytes);
// Define memory stream which will be used to hold encrypted
data.
MemoryStream memoryStream = new MemoryStream();
// Define cryptographic stream (always use Write mode for
encryption).
CryptoStream cryptoStream = new
CryptoStream(memoryStream,encryptor,CryptoStreamMode.Write);
byte[] cipherTextBytes = memoryStream.ToArray();
// Close both streams.
memoryStream.Close();
cryptoStream.Close();
// Convert encrypted data into a base64-encoded string.
string cipherText = Convert.ToBase64String(cipherTextBytes);
// Return encrypted string.
return cipherText;
}
public static string Decrypt(string cipherText,
string passPhrase,
string saltValue,
string hashAlgorithm,
int passwordIterations,
string initVector,
int keySize)
{
33
34
RC4 Algorithm
using
using
using
using
using
using
System;
System.Collections;
System.Security.Cryptography;
System.Text;
System.Threading;
System.Windows.Forms;
namespace EncryptionAlgorithms
{
public class EncryptionThread
{
private ContainerControl containerControl = null;
private Delegate finishedProcessDelegate = null;
private Delegate updateTextDelegate = null;
public void Encrypt( object inputObject )
{
object[] inputObjects = ( object[] )inputObject;
containerControl = ( Form ) inputObjects[ 0 ];
finishedProcessDelegate = ( Delegate )
inputObjects[ 1 ];
updateTextDelegate = ( Delegate )inputObjects[ 2 ];
string encryptedString = EncryptString( ( string )
inputObjects[ 3 ], ( int )inputObjects[ 4 ], ( string )inputObjects[ 5 ] );
containerControl.Invoke( updateTextDelegate, new
object[] { encryptedString } );
containerControl.Invoke( finishedProcessDelegate );
}
public void Decrypt( object inputObject )
{
object[] inputObjects = ( object[] )inputObject;
containerControl = ( Form )inputObjects[ 0 ];
finishedProcessDelegate = ( Delegate )inputObjects[ 1 ];
updateTextDelegate = ( Delegate )inputObjects[ 2 ];
string decryptedString = DecryptString( ( string )
inputObjects[ 3 ], ( int )inputObjects[ 4 ], ( string )inputObjects[ 5 ] );
containerControl.Invoke( updateTextDelegate, new
object[] { decryptedString } );
containerControl.Invoke( finishedProcessDelegate );
}
public string EncryptString( string inputString, int dwKeySize,
string xmlString )
{
// TODO: Add Proper Exception Handlers
RSACryptoServiceProvider rsaCryptoServiceProvider = new
RSACryptoServiceProvider( dwKeySize );
rsaCryptoServiceProvider.FromXmlString( xmlString );
int keySize = dwKeySize / 8;
byte[] bytes = Encoding.UTF32.GetBytes( inputString );
35
36
System;
System.IO;
System.Collections.Generic;
System.Linq;
System.Text;
System.Security.Cryptography;
namespace EncryptionAlgorithms
{
public class TripleDESEngine
{
public string EncryptString(string Message, string Passphrase)
{
byte[] Results;
System.Text.UTF8Encoding UTF8 = new System.Text.UTF8Encoding();
// Step 1. We hash the passphrase using MD5
// We use the MD5 hash generator as the result is a 128 bit
byte array
// which is a valid length for the TripleDES encoder we use
below
MD5CryptoServiceProvider HashProvider = new
MD5CryptoServiceProvider();
byte[] TDESKey =
HashProvider.ComputeHash(UTF8.GetBytes(Passphrase));
// Step 2. Create a new TripleDESCryptoServiceProvider object
TripleDESCryptoServiceProvider TDESAlgorithm = new
TripleDESCryptoServiceProvider();
// Step 3. Setup the encoder
TDESAlgorithm.Key = TDESKey;
TDESAlgorithm.Mode = CipherMode.ECB;
TDESAlgorithm.Padding = PaddingMode.PKCS7;
// Step 4. Convert the input string to a byte[]
byte[] DataToEncrypt = UTF8.GetBytes(Message);
// Step 5. Attempt to encrypt the string
try
{
ICryptoTransform Encryptor =
TDESAlgorithm.CreateEncryptor();
Results = Encryptor.TransformFinalBlock(DataToEncrypt, 0,
DataToEncrypt.Length);
}
finally
{
// Clear the TripleDes and Hashprovider services of any
sensitive information
TDESAlgorithm.Clear();
HashProvider.Clear();
37
}
// Step 6. Return the encrypted string as a base64 encoded
string
return Convert.ToBase64String(Results);
}
public string DecryptString(string Message, string Passphrase)
{
byte[] Results;
System.Text.UTF8Encoding UTF8 = new System.Text.UTF8Encoding();
// Step 1. We hash the passphrase using MD5
// We use the MD5 hash generator as the result is a 128 bit
byte array
// which is a valid length for the TripleDES encoder we use
below
MD5CryptoServiceProvider HashProvider = new
MD5CryptoServiceProvider();
byte[] TDESKey =
HashProvider.ComputeHash(UTF8.GetBytes(Passphrase));
// Step 2. Create a new TripleDESCryptoServiceProvider object
TripleDESCryptoServiceProvider TDESAlgorithm = new
TripleDESCryptoServiceProvider();
// Step 3. Setup the decoder
TDESAlgorithm.Key = TDESKey;
TDESAlgorithm.Mode = CipherMode.ECB;
TDESAlgorithm.Padding = PaddingMode.PKCS7;
// Step 4. Convert the input string to a byte[]
byte[] DataToDecrypt = Convert.FromBase64String(Message);
// Step 5. Attempt to decrypt the string
try
{
ICryptoTransform Decryptor =
TDESAlgorithm.CreateDecryptor();
Results = Decryptor.TransformFinalBlock(DataToDecrypt, 0,
DataToDecrypt.Length);
}
finally
{
// Clear the TripleDes and Hashprovider services of any
sensitive information
TDESAlgorithm.Clear();
HashProvider.Clear();
}
// Step 6. Return the decrypted string in UTF8 format
return UTF8.GetString(Results);
}
38
RSA Algorithm
using
using
using
using
using
System;
System.Drawing;
System.Collections;
System.ComponentModel;
System.Windows.Forms;
namespace Encryption
{
public class KeyPairGeneratorForm: System.Windows.Forms.Form
{
private System.Windows.Forms.Button generateKeysButton;
private System.Windows.Forms.NumericUpDown numericUpDown;
private System.Windows.Forms.PictureBox keyPictureBox;
private System.ComponentModel.Container components = null;
public KeyPairGeneratorForm()
{ InitializeComponent(); }
protected override void Dispose( bool disposing )
{
if( disposing )
{
if( components != null )
{ components.Dispose(); }
}
base.Dispose( disposing );
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new
System.ComponentModel.ComponentResourceManager(typeof(KeyPairGeneratorForm)
);
this.generateKeysButton = new System.Windows.Forms.Button();
this.keyPictureBox = new System.Windows.Forms.PictureBox();
this.numericUpDown = new System.Windows.Forms.NumericUpDown();
((System.ComponentModel.ISupportInitialize)
(this.keyPictureBox)).BeginInit();
((System.ComponentModel.ISupportInitialize)
(this.numericUpDown)).BeginInit();
this.SuspendLayout();
//
// generateKeysButton
//
this.generateKeysButton.BackColor
=
System.Drawing.SystemColors.Control;
this.generateKeysButton.Font
=
new
System.Drawing.Font("Georgia",
8.25F,
System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.generateKeysButton.ForeColor = System.Drawing.Color.Black;
this.generateKeysButton.Location
=
new
System.Drawing.Point(183, 119);
this.generateKeysButton.Name = "generateKeysButton";
39
40
//
// KeyPairGeneratorForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(8, 19);
this.BackColor = System.Drawing.SystemColors.ActiveBorder;
this.ClientSize = new System.Drawing.Size(366, 205);
this.Controls.Add(this.numericUpDown);
this.Controls.Add(this.keyPictureBox);
this.Controls.Add(this.generateKeysButton);
this.Font = new System.Drawing.Font("Georgia", 12F,
System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point,
((byte)(0)));
this.ForeColor = System.Drawing.Color.White;
this.FormBorderStyle
=
System.Windows.Forms.FormBorderStyle.Fixed3D;
this.Icon
=
((System.Drawing.Icon)
(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "KeyPairGeneratorForm";
this.ShowInTaskbar = false;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition
=
System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Generate Keys";
this.Load
+=
new
System.EventHandler(this.KeyPairGeneratorForm_Load);
((System.ComponentModel.ISupportInitialize)
(this.keyPictureBox)).EndInit();
((System.ComponentModel.ISupportInitialize)
(this.numericUpDown)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
private
void
generateKeysButton_Click(
System.EventArgs e )
{
Encryption.MainForm.SetBitStrength(
Convert.ToInt32( numericUpDown.Value ) );
this.DialogResult = DialogResult.OK;
this.Dispose( true );
}
object
sender,
private
void
KeyPairGeneratorForm_Load(
object
EventArgs e )
{ Encryption.MainForm.SetBitStrength( 1024 ); }
}
}
sender,
41
CHAPTER 8
SYSTEM TESTING
System testing involves user training system testing and successful running of the
developed proposed system. The user tests the developed system and changes are made
according to their needs. The testing phase involves the testing of developed system using
various kinds of data.
An elaborate testing of data is prepared and the system is tested using the test data.
While testing, errors are noted and the corrections are made. The corrections are also noted
for the future use. The users are trained to operate the developed system.
TESTING:
System testing is the stage of implementation that is aimed at ensuring that the
system works accurately and efficiently before live operation commences. Testing is vital to
the success of the system. System testing makes logical assumption that if all the parts of the
system are correct, then the goal will be successfully achieved. A series of testing are done
for the proposed system before the system is ready for the user acceptance testing.
The following are the types of Testing:
1. Unit Testing
2. Integration Testing
3. Validation Testing
4. Verification testing
5. User acceptance testing
8.1 UNIT TESTING
The procedure level testing is made first. By giving improper inputs, the errors
occurred are noted and eliminated. Then the web form level testing is made. For example
storage of data to the table in the correct manner.
42
In the company as well as seeker registration form, the zero length username and
password are given and checked. Also the duplicate username is given and checked. In the
job and question entry, the button will send data to the server only if the client side
validations are made.
The dates are entered in wrong manner and checked. Wrong email-id and web site
URL (Universal Resource Locator) is given and checked.
8.2 INTEGRATION TESTING
Testing is done for each module. After testing all the modules, the modules are
integrated and testing of the final system is done with the test data, specially designed to
show that the system will operate successfully in all its aspects conditions. Thus the system
testing is a confirmation that all is correct and an opportunity to show the user that the system
works.
8.3 VALIDATION TESTING
The final step involves Validation testing, which determines whether the software function as
the user expected. The end-user rather than the system developer conduct this test most
software developers as a process called Alpha and Beta Testing to uncover that only the
end user seems able to find.
8.4 VERIFICATION TESTING
User acceptance testing of a system is the key factor of the success of any system.
The system under study is tested for the user acceptance by constantly keeping in touch with
the prospective system users at any time of developing and making changes whenever
required.
43
SYSTEM IMPLEMENTATION
Implementation is the most crucial stage in achieving a successful system and
giving the users confidence that the new system is workable and effective. Implementation
of a modified application to replace an existing one. This type of conversation is relatively
easy to handle, provide there are no major changes in the system.
Each program is tested individually at the time of development using the data
and has verified that this program linked together in the way specified in the programs
specification, the computer system and its environment is tested to the satisfaction of the user.
The system that has been developed is accepted and proved to be satisfactory for the user.
And so the system is going to be implemented very soon. A simple operating procedure is
included so that the user can understand the different functions clearly and quickly.
Initially as a first step the executable form of the application is to be created and
loaded in the common server machine which is accessible to all the user and the server is to
be connected to a network. The final stage is to document the entire system which provides
components and the operating procedures of the system.
44
CHAPTER 9
PROBLEMS FACED
When there is a clear goal in sight but no clear set of directions or means to attain
that goal, then it is called a problem. Problems can be broken down into four aspects; goal,
givens, means of transforming conditions, and obstacles.
Goal the goal is the desired end state which the problem solving is being directed toward.
The hope is to reach that end state and be able to assess whether or not you achieved what
you wanted.
Givens- these are the objects, conditions, and constraints that accompany a problem, and can
be either explicit or implicit.
Means of transforming conditions- there should be a way of changing the initial state of the
problem. this is most usually a persons knowledge or skill level. For instance ,a computer
programmer presented with a problem would utilize his or her knowledge of programming
language to transform the state of the problem.
Obstacles- the problem should present a challenge. If there are no challenges involved and
the situation can be easily solved then it is not so a problem so much as a routines task.
Every problem has a problem faced, which is the whole range of possible states and
operators. only some of these states and operators will bring the person closer to the goal
state. The problem starts at the initial state and operators are applied to change the state,
creating a series of intermediate states that should hopefully lead to the final goal state
45
CHAPTER-10
FUTURE PLANS
Every application has its own merits and demerits. The project has covered
almost all the requirements. Further requirements and improvements can easily be done since
the coding is mainly structured or modular in nature. Changing the existing modules or
adding new modules can append improvements. Further enhancements can be made to the
application, so that the web site functions very attractive and useful manner than the present
one.
46
CONCLUSION
It is concluded that the application works well and satisfy the users. The
application is tested very well and errors are properly debugged. The site is simultaneously
accessed from more than one system. Simultaneous login from more than one place is tested.
The application works according to the restrictions provided in their
respective system. Further enhancements can be made to the application, so that the
application functions very attractive and useful manner than the present one. The speed of the
transactions become more enough now.
47
APPENDIX
SCREEN SHOTS
Login
Fig1Login
48
Main Page
49
Encryption Content
50
RC4 Algorithm
51
Fig5AESAlgorithmSetup
52
AES Algorithm
53
54
55
56
57
RSA Algorithm
58
REFERENCES
BOOKS
Professional ASP.NET MVC 1.0 (Wrox Programmer to Programmer) / Rob Conery, Scott
Hanselman, Phil Haack, Scott Guthrie Publisher: Wrox
ASP.NET 3.5 Unleashed / Stephen Walther Publisher: Sams
Programming ASP.NET 3.5 / Jesse Liberty, Dan Maharry, Dan Hurwitz Publisher:
O'Reilly Media, Inc.
59
BIBLIOGRAPHY
www.codeproject.com/KB/custom-controls/asppopup.aspx
http://www.developerfusion.com/code/4673/programatically-load-user-controls/
http://www.developerfusion.com/code/4596/how-to-access-a-mysql-database-withnet/
http://www.developerfusion.com/code/3826/adding-controls-to-placeholdersdynamically/
http://aspalliance.com/1125_Dynamically_Templated_GridView_with_Edit_Delete_a
nd_Insert_Options
http://www.15seconds.com/issue/041020.htm
http://www.a1vbcode.com/app-3619.asp
http://www.aspcode.net/ASPNET-301-redirect.aspx
http://www.aspcode.net/Master-pages-in-ASP-free-template-engine.aspx
60