Data Storage And Retrieval In Sensor Networks Computer Science Essay

Published: Last Edited:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

Client module:

This module deals with the functionality of the clients. It sends request to the server to connect and gets all the services from the server.

Fileserver module:

This module has the functionality of the server which after getting the connection from the client it also connects to the Metadata Server to get the information from database where the actual files are stored.

Metadata Server module:

This module performs the functionality of the data repository it contains all the data storage in the database (which is the MS Access database) for this system. It adds, reads, writes and also deletes the data and files from the database.

Then the data will be flown like, shown below figure.

This is basic data flow in project. Which means that Client will send the request to the Fileserver and it will send that request through the Metadata Server and it is connected to Database in the Database the data will be stored in File Directory (Which Directory you created in the project), Location of that file and Key value will be stored.

So according to this Functionality we have Used Different kind of Technologies.

What is the input and output of the project?

The Main AIM of this Project is, Secure the data (Some Secret Data).

Which means the data will be encrypted and decrypted by using KEY value.

In this we have to maintain some operations like,

Data Write --- New File will be Created

Data Read --- Existing File to be Read

Data Delete --- Existing File to be Deleted

Encryption is the conversion of data into a form, called a ciphertext that cannot be easily understood by unauthorized people. -----Output

Decryption to convert an encrypted or coded text or message into plain text.

We create one file like Aspire.txt and enter some text here. Then that data will be transferred to Fileserver. And in Fileserver the data will be converted into encrypted format and that file location is stored in the database i.e. Metadata Server.

First Create one file with any name with extension must be .txt and enter some Text regarding that file and execute the program, in this the given data will be encrypted. After saving the .txt file in Metadata Server open that file, the data will not be in readable format..It is nothing but Encryption.

And then when we want to read that particular file, want to perform READ operation and that data will be converted into decrypted (understandable) data and displayed on console.

3) Applications of the project

Swings, IOStreams, Files, JDBC (Java Database Connectivity) for connect to MS-Access

4) Which Algorithm is used to performing Encryption and decryption Process?

In cryptography, a cipher (or cypher) is an algorithm for performing encryption or

Decryption -- a series of well-defined steps that can be followed as a procedure.


In cryptography, encryption is the process of transmitting the data (referred as plaintext) using an algorithm (called cipher) to make it unreadable to unknown persons.

When using a cipher the actual data is known as plaintext, and the encrypted form is called as ciphertext. The ciphertext message contains all the information of the plaintext message, but it is not in readable format by a human being or computer without the proper mechanism to decrypt; it should resemble random garbage to those not intended to read it.

The encrypting procedure varies depending on the key, which changes the detailed operation of the algorithm. A key must be selected before using a cipher to encrypt a message. Without the knowledge of a key, it should be difficult, to decrypt the resulting ciphertext into readable plaintext.

Types of cipher:

Historical ciphers

Historical pen and paper ciphers used in the past are sometimes known as classical ciphers. They include simple substitution ciphers and transposition ciphers. For example "GOOD DOG" can be encrypted as "PLLX XLP" where "L" substitutes for "O", "P" for "G", and "X" for "D" in the message. Transposition of the letters "GOOD DOG" can result in "DGOGDOO". These simple ciphers and examples are easy to crack, even without plaintext-ciphertext pairs.

Because of this dis-advantage we can go for Modern Cipher.

Modern ciphers

Modern encryption methods can be divided by two criteria: by type of key used, and by type of input data.

By type of key used ciphers are divided into:

symmetric key algorithms (Private-key cryptography), where the same key is used for encryption and decryption, and

Asymmetric key algorithms (Public-key cryptography), where two different keys are used for encryption and decryption.

In a symmetric key algorithm (e.g., DES and AES), the sender and receiver must have a shared key set up in advance and kept secret from all other parties; the sender uses this key for encryption, and the receiver uses the same key for decryption.

AES stands for Advanced Encryption Standard

The Feistel cipher uses both substitution and transposition techniques. Most block cipher algorithms are based on this structure.

In an asymmetric key algorithm (e.g., RSA), there are two separate keys:

A public key is published and enables any sender to perform encryption,

A private key is kept secret by the receiver and enables only him to perform correct decryption.

Type of input ciphers data can be distinguished into two types:

block ciphers - which encrypt block of data of fixed size, and

stream ciphers - which encrypt continuous streams of data

In java, Cipher is a Class and it is subclass of Object Class. (Java API)



It supports the cryptography concept in JAVA i.e. encryption and decryption. (Sample code)

//Data which is decrypted

Cipher cipher = Cipher.getInstance ("AES");

cipher.init(Cipher.DECRYPT_MODE, sks);

int length = con.getLen();

byte data[] = new byte[length];

data = con.getContent();

byte[] decrypted = cipher.doFinal(data); (Sample code)

//Data which is encrypted

Cipher cipher = Cipher.getInstance ("AES");

cipher.init (Cipher.ENCRYPT_MODE, sks);

byte data2[] = new byte[l]; (data2);

byte encrpt[] = cipher.doFinal (data2);

5) Hashing functions:

In this project following hashing mechanisms are used :

Simple Hash-Based (SHB)

Enhanced Hash-Based (EHB)

Adaptive Polynomial-Based (APB)