SlideShare a Scribd company logo
A
PROJECT REPORT ON
“Image and Text Encryption and Decryption”
In the fulfillment of theRequirement for the Degree of
BachelorofComputerApplication(B.C.A.)
Submitted By
Mr. PATIL PIYUSH ANIL
To
G. H. Raisoni Institute of Business Management, Jalgaon
Affiliated To
Kavayitri Bahinabai Chaudhari, North
Maharashtra University, Jalgaon
2019-2020
ACKNOWLEDGEMENT
A successful project is the result of a good team- work
whichconsistsofnotonlythepartnerswhoputin their long
and hard work but also those who guided them. Indeed, a
truesaying.
I would like to thanks to ______ and Hon. _________and
our Project guide “_______” all my college Faculty
members for providing me with valuable support and guiding
me throughout my college days.
Thanks andRegards
Mr. PATIL PIYUSH ANIL
Index
Chapter Sr. No Topic Pages
1 Introduction
1.1 Introduction to Project 1
1.2 Introduction to Project Existing System and Need for
New System
1-2
1.3 PROBLEM STATEMENT 2
1.4 OBJECTIVE 3
2 Project Details
2.1 Hardware/ Software Specification 4
3 Feasibility study
3.1 What is feasibility? 5
3.2 Technical feasibility 5
3.3 Economic feasibility 5
3.4 Operational feasibility 6
4 Preliminary Design
4.1 Introduction 7
4.2 Preliminary Design 7
4.3 Entity Relationship Diagram 10
4.4 Data Flow Diagram 11
5 Screen Layout 14
6 Testing
7.1 Introduction 18
7.2 White Box Testing 19
7.3 Black Box Testing 20
7 Implementation 22
8 Future Enhancement 31
9 Conclusion 32
10 Bibliography 33
Page | 1
Chapter 1
Introduction to project
Encryption software has become important when it comes to protecting your
Data. Hack attempts and privacy intrusions mean that it's become easier than ever
for complete strangers to access your most personal details stored on your computer.
For businesses its worse, as the exposure of sensitive or confidential records can
result in financial losses as well as heavy fines.
While there are a number of security solutions available, everything from free
anti-malware tools for home consumers and cloud anti-virus for business, even
simple human error can undermine these attempts to secure data.
Encryption software is already deployed by some large corporations and
government agencies to protect data, but it's also available and now accessible for a
wider range of users.
Once properly setup, even if your security software fails,
thieves/hackers/snoopers would still find it almost impossible to do anything with
any encrypted data that might be exposed.
1.1Existing System:-
There may exist many applications of encryption and decryption of varies type
of file formats .this software are paid software and mainly available as web
applications so they required high speed internet connection.
Page | 2
New System:-
The proposed system suggest a new concept that is free desktop application.
It means user can use this application free of cost .whale in existed system user has
to pay some amount to use the services.
The new system will work in offline mode. Manse user can use it any time
without any problem. The proposed system uses RSA (Rivest–Shamir–Adleman)
algorithm. RSA is known to be the strongest publicly available encryption method.
This algorithm works with both private key and public key. The only way of
decrypting the files which are encrypted with the public key is to use the private key.
Users’ file will be encrypted and saved to desktop .Then, user has to enter the private
key to decrypt the file.
The proposed study is enriched with Waterfall Development Methodology
which implements a sequential based stage by stage concept.
1.2. PROBLEM STATEMENT:-
The underlying respective architecture of most IT systems, including the
desktop computer and internet, does not guarantee security. Users with malicious
intents have always found a way of exploiting one vulnerability or the other. An
attack that affects the confidentiality of information often presents the platform for
the integrity of such information to be compromised. Intercepted information on
transit would make little or no sense to an interceptor if he is not able to decipher the
content of the information. This explains why it is very necessary to ensure
that even when an intruder or unauthorized user successfully obtains access to
some information the confidentiality and integrity of the information remain
uncompromised.
Page | 3
1.3. OBJECTIVE:-
The objective of this project is to design and implement an application that
encrypts and decrypts plain text and images using R.S.A algorithm. EXISTING
SYSTEM Designing an encryption/decryption system, amongst other things,
requires decision on the basic functionality of the software, and the choice of
cryptographic algorithm to be used. While the functionality supports the
attractiveness of the system, the type of cryptographic algorithm actually determines
how much security the system would actually provide. Hence, this forms the major
component in the system design
Page | 4
Chapter 2
Hardware/Software Details
Hardware/Software Hardware/Software
Element
Specification/version
Hardware Processor Intel core to duo
RAM 4 GB
Hard Disk 100 GB
Software OS Windows
Java and Net beans IDE
Page | 5
Chapter 3
Feasibility Study
3.1 What is Feasibility:-
A feasibility study is an analysis that takes all of a project's relevant factors
into account—including economic, technical, legal, and scheduling considerations
to ascertain the likelihood of completing the project successfully. Project managers
use feasibility studies to discern the pros and cons of undertaking a project before
they invest a lot of time and money into it.
3.2Technical Feasibility:-
It is always essential to evaluate the various aspects before
we develop a system. Evaluation should always justify the cost and
benefits ratio. If it is found that benefits are less compare to the cost of
project, thenitisbettertoavoidgoinginforcomputerization. So technical
feasibility is analysed. It has taken 2 days.
Page | 6
3.3Operational Feasibility:-
If you plan to change something inside the company that will affect how
the organization runs or when a client asks you to explore a new product or
process that will affect elements within their own organization. So, it has taken
2 days.
Page | 7
Chapter 4
Preliminary Design
4.1 Introduction:-
About RSA
RSA is an encryption algorithm.
Developed in: 1977.
Developed by: Ron Rivest, Adi Shamir, and Leonard Adleman.
The RSA algorithm is the most commonly used public key encryption algorithm.
Encryption and Decryption
Public Key Encryption:-
It is also known as asymmetric cryptography.
Page | 8
Two keys are used: Public Key and Private Key.
Public Key: For encryption.
Private Key: For decryption, also known as a secret key.
Public Key: Shared with the public that wants to send us data.
Private Key: Kept secret so that when someone sends us data encrypted by our
Public Key, we can decrypt the data using the Private Key.
HOW RSA WORKS:-
Both users (sender and receiver) generates a public and private key.
Flowchart of Generation of Public and Private Key in RSA.
Page | 9
After getting the public and private key the main thing isto encrypt and decrypt File
using RSA.
Text Encryption and Decryption in RSA:-
RSA Algorithm:-
The public and the private key-generation algorithm is the most complex part
of RSA cryptography. Two large prime numbers, p and q, are generated. A modulus
n is calculated by multiplying p and q. This number is used by both the public and
private keys and provides the link between them. The public key consists of the
modulus n, and a public exponent, e as it's a prime number that is not too large. The
e figure doesn’t have to be a secretly selected prime number as the public key is
shared with everyone. The private key consists of the modulus n and the private
exponent d, which is calculated using the Extended Euclidean algorithm to find the
multiplicative inverse with respect to the totient of n.
RSA algorithm is an asymmetric cryptography algorithm. Asymmetric means
that it works on two different keys i.e. Public Key and Private Key. As the name
suggests that the Public Key is given to everyone and Private Key is kept private.
Page | 10
4.3Entity Relationship Diagram:-
RSA (Rivest–Shamir–Adleman) algorithm ER Diagram
Page | 11
4.4 Flow Chart for Encryption and Decryption:-
The above flow chart shows how the project in this article works. The flow
chart explains in a step by step manner the processing of the encryption and
decryption, using JAVA. In this project, we only consider the images not audio.
Images are encrypted, and create the *.txt file, the same file is used for decryption.
IMAGE CRYPTOGRAPHY METHODOLOGY BY RSA:-
The RSA is an cryptographic algorithm which is use to encrypt and decrypt
the data. This algorithm developed in 1977 by Ron Rivest, Adi Shamir, and Leonard
Adleman. RSA cryptosystem is also known as the public-key cryptosystems. RSA
is normally used for secure data transmission.
The encryption is starting on the RSA algorithm with the selection of two
large prime numbers, along with an auxiliary value, as the public key. The prime
numbers are keep in secret. The public key is used to encrypt a message, and private
key is used to decrypt a message or information. The RSA algorithm is encrypt the
original image and decrypts the image by the different keys
Page | 12
RSA is an algorithm is using in the modern computer environment to encrypt
and decrypt the data in transform. The RSA algorithm is also called as an asymmetric
cryptographic algorithm. Asymmetric cryptosystem means two different keys are
using in the encryption and decryption. In the two keys one key is using for
encryption and the second key is using for decryption. This RSA algorithm is also
called as the public key cryptography. Because one of the secret key can be given to
everyone which means public. The other key must be kept private.
Page | 13
RSA Cryptosystem
Page | 14
Chapter 5
Screen Layout
 After Starting application we can see the home page
 After Click on Get Started Button Next window is open where there are
two options
Page | 15
 Here User will select text or images
 After User will Select text or Image for Safety application
Ask Password
Page | 16
 On text Selection user Will navigate to for text Encryption
 On Image Selection user Will navigate to for Image Encryption
 Here are two options one for image encryption and other for image
decryption
Page | 17
After Encryption
 In this image we can see there is a button to select image. After
encryption image will be automatically saved to Desktop
After decryption
 In this image user will select the encrypted image and will get decrypted
image as output. Decrypted image will automatically save to Desktop
Page | 18
Chapter 6
Testing
6.1 Introduction:-
Software Testing is a method to check whether the actual software product
matches expected requirements and to ensure that software product is Defect free. It
involves execution of software/system components using manual or automated tools
to evaluate one or more properties of interest. The purpose of software testing is to
identify errors, gaps or missing requirements in contrast to actual requirements.
Why Software Testing is Important?
Software Testing is Important because if there are any bugs or errors in the
software, it can be identified early and can be solved before delivery of the software
product. Properly tested software product ensures reliability, security and high
performance which further results in time saving, cost effectiveness and customer
satisfaction.
What are the benefits of Software Testing?
Here are the benefits of using software testing:-
Cost-Effective: It is one of the important advantages of software testing.
Testing any IT project on time helps you to save your money for the long term. In
case if the bugs caught in the earlier stage of software testing, it costs less to fix.
Security: It is the most vulnerable and sensitive benefit of software testing.
People are looking for trusted products. It helps in removing risks and problems
earlier.
Product quality: It is an essential requirement of any software product. Testing
ensures a quality product is delivered to customers.
Page | 19
Customer Satisfaction: The main aim of any product is to give satisfaction to
their customers. UI/UX Testing ensures the best user experience.
6.2White Box Testing
White Box Testing is software testing technique in which internal structure,
design and coding of software are tested to verify flow of input-output and to
improve design, usability and security. In white box testing, code is visible to testers
so it is also called Clear box testing, Open box testing, Transparent box testing,
Code-based testing and Glass box testing.
Advantages of White Box Testing:-
 Code optimization by finding hidden errors.
 White box tests cases can be easily automated.
 Testing is more thorough as all code paths are usually covered.
 Testing can start early in SDLC even if GUI is not available.
Page | 20
Disadvantages of White Box Testing:-
 White box testing can be quite complex and expensive.
 Developers who usually execute white box test cases detest it. The
white box testing by developers is not detailed can lead to production
errors.
 White box testing requires professional resources, with a detailed
understanding of programming and implementation.
 White-box testing is time-consuming, bigger programming
applications take the time to test fully.
6.3Black Box Testing:-
Black Box Testing is a software testing method in which the functionalities of
software applications are tested without having knowledge of internal code structure,
implementation details and internal paths. Black Box Testing mainly focuses on
input and output of software applications and it is entirely based on software
requirements and specifications. It is also known as Behavioral Testing.
Page | 21
Tools used for Black Box Testing:-
Tools used for Black box testing largely depends on the type of black box
testing you are doing.
 For Functional/ Regression Tests you can use - QTP, Selenium
 For Non-Functional Tests, you can use - LoadRunner, Jmeter
Black Box Testing and Software Development Life Cycle (SDLC):-
Black box testing has its own life cycle called Software Testing Life Cycle
(STLC) and it is relative to every stage of Software Development Life Cycle of
Software Engineering.
Requirement - This is the initial stage of SDLC and in this stage, a requirement is
gathered. Software testers also take part in this stage.
Test Planning & Analysis - Testing Types applicable to the project are determined.
A Test Plan is created which determines possible project risks and their mitigation.
Design - In this stage Test cases/scripts are created on the basis of software
requirement documents
Test Execution- In this stage Test Cases prepared are executed. Bugs if any are fixed
and re-tested.
Page | 22
Chapter 8
Implementation
This project develop in java .it is a windows executable file with extinction
(.jar)
The application divided into three module
 First module :- home module (home.java)
 Second module :- text module (text.java)
 Third module :- image module (image.java)
The image module can be sub-divided as two modules Encryption (encryption.java)
and Decryption (decryption.java) module.
Text EncryptionGenerating RSA Public Private Key:-
(RSAKeyPairGenerator.java):-
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.security.*;
import java.util.Base64;
public class RSAKeyPairGenerator {
private PrivateKey privateKey;
private PublicKey publicKey;
Page | 23
public RSAKeyPairGenerator() throws NoSuchAlgorithmException {
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
keyGen.initialize(1024);
KeyPair pair = keyGen.generateKeyPair();
this.privateKey = pair.getPrivate();
this.publicKey = pair.getPublic();
}
public void writeToFile(String path, byte[] key) throws IOException {
File f = new File(path);
f.getParentFile().mkdirs();
FileOutputStream fos = new FileOutputStream(f);
fos.write(key);
fos.flush();
fos.close();
}
public PrivateKey getPrivateKey() {
return privateKey;
}
public PublicKey getPublicKey() {
return publicKey;
}
public static void main(String[] args) throws NoSuchAlgorithmException, IOExcepti
on {
RSAKeyPairGenerator keyPairGenerator = new RSAKeyPairGenerator();
keyPairGenerator.writeToFile("RSA/publicKey", keyPairGenerator.getPublicKey()
.getEncoded());
keyPairGenerator.writeToFile("RSA/privateKey", keyPairGenerator.getPrivateKey
().getEncoded());
System.out.println(Base64.getEncoder().encodeToString(keyPairGenerator.getPub
licKey().getEncoded()));
Page | 24
System.out.println(Base64.getEncoder().encodeToString(keyPairGenerator.getPri
vateKey().getEncoded()));
}
}
We can use factory method to generate these keys using KeyPairGenerator.
For the demo purpose we are using a key size of 1024. By default, the private key
is generated in PKCS#8 format and the public key is generated in X.509 format.
Once these keys are generated, either you can write these keys in a file and share
the file containing public keys with the client. Remember, the public key is written
in the text file as X.509 format. Also, we can do a base64 encode to make it
readable and share the string with the client.
Text Encryption:-
public static PublicKey getPublicKey(String base64PublicKey){
PublicKey publicKey = null;
try{
X509EncodedKeySpec keySpec = new X509EncodedKeySpec(Base64.getDecoder().d
ecode(base64PublicKey.getBytes()));
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
publicKey = keyFactory.generatePublic(keySpec);
return publicKey;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (InvalidKeySpecException e) {
e.printStackTrace();
}
return publicKey;
}
We have encryption.java that has methods defined for RSA encryption and
decryption. Let us discuss about encryption first. As we discussed above the public
key generated is in X.509 format and we use public key for encryption. Hence, we
Page | 25
need X509EncodedKeySpec class to convert it again to RSA public key.
Remember, that we have base64 encoded public keys. Hence, first let us first
Base64 decode and generate the public key.
we have a simple method encrypt()that takes the string to be encrypted and
the Base64 encoded RSA key for encryption. Here getPublicKey() is the method
that we defined above.
public static byte[] encrypt(String data, String publicKey) throws BadPaddingExceptio
n, IllegalBlockSizeException, InvalidKeyException, NoSuchPaddingException, NoSuchAlgo
rithmException {
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
cipher.init(Cipher.ENCRYPT_MODE, getPublicKey(publicKey));
return cipher.doFinal(data.getBytes());
}
Text Decryption:-
public staticPrivateKey getPrivateKey(String base64PrivateKey){
PrivateKey privateKey = null;
PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(Base64.getDecoder().dec
ode(base64PrivateKey.getBytes()));
KeyFactory keyFactory = null;
try {
keyFactory = KeyFactory.getInstance("RSA");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
try {
privateKey = keyFactory.generatePrivate(keySpec);
} catch (InvalidKeySpecException e) {
e.printStackTrace();
}
return privateKey;
}
For decryption we will be using private key and we discussed above that the
private key is generated in PKCS#8 format. Hence, following is the code to
Page | 26
generate the private key from base64 encoded string using
PKCS8EncodedKeySpec.
Now following is the decrypt method that accepts RSA encrypted string and
Base64 encoded RSA private key for decryption.
public static String decrypt(String data, String base64PrivateKey) throws IllegalBloc
kSizeException, InvalidKeyException, BadPaddingException, NoSuchAlgorithmException, N
oSuchPaddingException {
return decrypt(Base64.getDecoder().decode(data.getBytes()), getPrivateKey(bas
e64PrivateKey));
}
Image Encryption:-
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
Page | 27
import javax.crypto.KeyGenerator;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
public class EncryptFile {
KeyGenerator keyGenerator = null;
SecretKey secretKey = null;
Cipher cipher = null;
public EncryptFile() {
try { keyGenerator = KeyGenerator.getInstance("Blowfish");
secretKey = keyGenerator.generateKey();
cipher = Cipher.getInstance("Blowfish");
} catch (NoSuchPaddingException ex) {
System.out.println(ex);
} catch (NoSuchAlgorithmException ex) {
System.out.println(ex);}}
public static void main(String[] args) {
String fileToEncrypt = "fileToEncrypt.jpg";
String encryptedFile = "encryptedFile.jpg";
String decryptedFile = "decryptedFile.jpg";
String directoryPath = "C:/Users/dhanoopbhaskar/Desktop/blowfish/";
EncryptFile encryptFile = new EncryptFile();
System.out.println("Starting Encryption...");
encryptFile.encrypt(directoryPath + fileToEncrypt,
Page | 28
directoryPath + encryptedFile);
System.out.println("Encryption completed...");
System.out.println("Starting Decryption...");
encryptFile.decrypt(directoryPath + encryptedFile,
directoryPath + decryptedFile);
System.out.println("Decryption completed...");}
private void encrypt(String srcPath, String destPath) {
File rawFile = new File(srcPath);
File encryptedFile = new File(destPath);
InputStream inStream = null;
OutputStream outStream = null;
try { cipher.init(Cipher.ENCRYPT_MODE, secretKey);
inStream = new FileInputStream(rawFile);
outStream = new FileOutputStream(encryptedFile);
byte[] buffer = new byte[1024];
int len; while ((len = inStream.read(buffer)) > 0) {
outStream.write(cipher.update(buffer, 0, len));
outStream.flush();}
outStream.write(cipher.doFinal());
inStream.close();
outStream.close();
} catch (IllegalBlockSizeException ex) {
System.out.println(ex);
Page | 29
} catch (BadPaddingException ex) {
System.out.println(ex);
} catch (InvalidKeyException ex) {
System.out.println(ex);
} catch (FileNotFoundException ex) {
System.out.println(ex);
} catch (IOException ex) {
System.out.println(ex);
}}
Image Decryption:-
private void decrypt(String srcPath, String destPath) {
File encryptedFile = new File(srcPath);
File decryptedFile = new File(destPath);
InputStream inStream = null;
OutputStream outStream = null;
try {
cipher.init(Cipher.DECRYPT_MODE, secretKey);
inStream = new FileInputStream(encryptedFile);
outStream = new FileOutputStream(decryptedFile);
byte[] buffer = new byte[1024];
int len;
while ((len = inStream.read(buffer)) > 0) {
Page | 30
outStream.write(cipher.update(buffer, 0, len));
outStream.flush();
}
outStream.write(cipher.doFinal());
inStream.close();
outStream.close();
} catch (IllegalBlockSizeException ex) {
System.out.println(ex);
} catch (BadPaddingException ex) {
System.out.println(ex);
} catch (InvalidKeyException ex) {
System.out.println(ex);
} catch (FileNotFoundException ex) {
System.out.println(ex);
} catch (IOException ex) {
System.out.println(ex);}}}
Page | 31
Chapter 8
Future Enhancement
In today’s world the protection of sensitive data is one of the most critical
concerns for organizations and their customers. This, coupled with growing
regulatory pressures, is forcing businesses to protect the integrity, privacy and
security of critical information. As a result cryptography is emerging as the
foundation for enterprise data security and compliance, and quickly becoming the
foundation of security best practice. Cryptography, once seen as a specialized,
esoteric discipline of information security, is finally coming of age.
No one would argue that cryptography and encryption are new technologies.
It was true decades ago and it is still true today – encryption is the most reliable way
to secure data. National security agencies and major financial institutions have long
protected their sensitive data using cryptography and encryption. Today the use of
encryption is growing rapidly, being deployed in a much wider set of industry sectors
and across an increasing range of applications and platforms. Put simply,
cryptography and encryption have become one of the hottest technologies in the IT
security industry – the challenge now is to ensure that IT organizations are equipped
to handle this shift and are laying the groundwork today to satisfy their future needs.
Page | 32
Chapter 9
Conclusion
At the end of the day we need to protect our data. Increasingly, encryption
is being seen as the best way to ensure that data is protected, but the ever growing
use of encryption creates a management challenge. The challenge, however, doesn’t
need to be daunting. Implementing a flexible and extensible solution that automates
many of the time-consuming and error-prone key management tasks in an automated
enterprise-wide manner is rapidly becoming a priority for many organizations. In
order for enterprise-wide encryption to be deployed correctly, organizations need to
deploy the correct tool to manage the keys. In the same way that data protection has
moved from an IT challenge to a C-level issue, key management has become a high-
level business imperative.
Page | 33
Chapter 10
Bibliography
 https://www.theinsanetechie.in/2013/08/java-encryption-and-decryption-of-
image.html
 https://www.devglan.com/java8/rsa-encryption-decryption-java
 https://www.helpnetsecurity.com/2008/02/18/the-future-of-encryption/
 https://www.tutorialspoint.com/cryptography/public_key_encryption.htm
 https://www.c-sharpcorner.com/UploadFile/75a48f/rsa-algorithm-with-C-
Sharp2/
 https://www.codeproject.com/Articles/723175/Image-Cryptography-using-
RSA-Algorithm-in-Csharp
 https://www.thecrazyprogrammer.com/2017/03/rsa-algorithm.html
Ad

Recommended

Network security & cryptography full notes
Network security & cryptography full notes
gangadhar9989166446
 
Chacha ppt
Chacha ppt
VikramSingh1378
 
DNA based Cryptography_Final_Review
DNA based Cryptography_Final_Review
Rasheed Karuvally
 
Mini Project on Data Encryption & Decryption in JAVA
Mini Project on Data Encryption & Decryption in JAVA
chovatiyabhautik
 
Chapter 15
Chapter 15
Ali Broumandnia
 
Feasibility Study Report Personal Information & Leave Management System
Feasibility Study Report Personal Information & Leave Management System
Akila Jayarathna
 
Des
Des
Anshul Sharma
 
Image Security
Image Security
Satyendra Rajput
 
Block Cipher and its Design Principles
Block Cipher and its Design Principles
SHUBHA CHATURVEDI
 
Image Encryption in java ppt.
Image Encryption in java ppt.
Pradeep Vishwakarma
 
Encryption And Decryption Using AES Algorithm
Encryption And Decryption Using AES Algorithm
Ahmed Raza Shaikh
 
Data Security Using Steganography
Data Security Using Steganography
NidhinRaj Saikripa
 
Steganography
Steganography
Mayank Saxena
 
Hash function
Hash function
Salman Memon
 
Cryptography.ppt
Cryptography.ppt
kusum sharma
 
Hash Function
Hash Function
ssuserdfb2da
 
Advanced cryptography and implementation
Advanced cryptography and implementation
Akash Jadhav
 
Rsa Encryption in java
Rsa Encryption in java
PiyushPatil73
 
Cryptography.ppt
Cryptography.ppt
Uday Meena
 
Cryptography and Information Security
Cryptography and Information Security
Dr Naim R Kidwai
 
SHA- Secure hashing algorithm
SHA- Secure hashing algorithm
Ruchi Maurya
 
Security services
Security services
Gayan Geethanjana
 
Cryptography
Cryptography
Sagar Janagonda
 
5. message authentication and hash function
5. message authentication and hash function
Chirag Patel
 
Authentication techniques
Authentication techniques
IGZ Software house
 
Symmetric and Asymmetric Encryption.ppt
Symmetric and Asymmetric Encryption.ppt
HassanAli980906
 
Image encryption and decryption
Image encryption and decryption
Aashish R
 
Cryptography
Cryptography
Darshini Parikh
 
IRJET- Data Transmission using RSA Algorithm
IRJET- Data Transmission using RSA Algorithm
IRJET Journal
 
Image Cryptography using RSA Algorithm
Image Cryptography using RSA Algorithm
ijtsrd
 

More Related Content

What's hot (20)

Block Cipher and its Design Principles
Block Cipher and its Design Principles
SHUBHA CHATURVEDI
 
Image Encryption in java ppt.
Image Encryption in java ppt.
Pradeep Vishwakarma
 
Encryption And Decryption Using AES Algorithm
Encryption And Decryption Using AES Algorithm
Ahmed Raza Shaikh
 
Data Security Using Steganography
Data Security Using Steganography
NidhinRaj Saikripa
 
Steganography
Steganography
Mayank Saxena
 
Hash function
Hash function
Salman Memon
 
Cryptography.ppt
Cryptography.ppt
kusum sharma
 
Hash Function
Hash Function
ssuserdfb2da
 
Advanced cryptography and implementation
Advanced cryptography and implementation
Akash Jadhav
 
Rsa Encryption in java
Rsa Encryption in java
PiyushPatil73
 
Cryptography.ppt
Cryptography.ppt
Uday Meena
 
Cryptography and Information Security
Cryptography and Information Security
Dr Naim R Kidwai
 
SHA- Secure hashing algorithm
SHA- Secure hashing algorithm
Ruchi Maurya
 
Security services
Security services
Gayan Geethanjana
 
Cryptography
Cryptography
Sagar Janagonda
 
5. message authentication and hash function
5. message authentication and hash function
Chirag Patel
 
Authentication techniques
Authentication techniques
IGZ Software house
 
Symmetric and Asymmetric Encryption.ppt
Symmetric and Asymmetric Encryption.ppt
HassanAli980906
 
Image encryption and decryption
Image encryption and decryption
Aashish R
 
Cryptography
Cryptography
Darshini Parikh
 
Block Cipher and its Design Principles
Block Cipher and its Design Principles
SHUBHA CHATURVEDI
 
Encryption And Decryption Using AES Algorithm
Encryption And Decryption Using AES Algorithm
Ahmed Raza Shaikh
 
Data Security Using Steganography
Data Security Using Steganography
NidhinRaj Saikripa
 
Advanced cryptography and implementation
Advanced cryptography and implementation
Akash Jadhav
 
Rsa Encryption in java
Rsa Encryption in java
PiyushPatil73
 
Cryptography.ppt
Cryptography.ppt
Uday Meena
 
Cryptography and Information Security
Cryptography and Information Security
Dr Naim R Kidwai
 
SHA- Secure hashing algorithm
SHA- Secure hashing algorithm
Ruchi Maurya
 
5. message authentication and hash function
5. message authentication and hash function
Chirag Patel
 
Symmetric and Asymmetric Encryption.ppt
Symmetric and Asymmetric Encryption.ppt
HassanAli980906
 
Image encryption and decryption
Image encryption and decryption
Aashish R
 

Similar to Image and text Encryption using RSA algorithm in java (20)

IRJET- Data Transmission using RSA Algorithm
IRJET- Data Transmission using RSA Algorithm
IRJET Journal
 
Image Cryptography using RSA Algorithm
Image Cryptography using RSA Algorithm
ijtsrd
 
Rsa Crptosystem
Rsa Crptosystem
Amlan Patel
 
RSA 32-bit Implementation Technique
RSA 32-bit Implementation Technique
Universitas Pembangunan Panca Budi
 
An implementation of RSA policy
An implementation of RSA policy
SM NAZMUS SALEHIN
 
Encryption Data Measurement and Data Security of Hybrid AES and RSA Algorithm
Encryption Data Measurement and Data Security of Hybrid AES and RSA Algorithm
ijtsrd
 
RSA alogrithm
RSA alogrithm
Senthil Kanth
 
Security.ppt
Security.ppt
SherefHesham
 
Securing iClouds Storage Based On Combination of RSA and AES Crypto System
Securing iClouds Storage Based On Combination of RSA and AES Crypto System
CSCJournals
 
Implementation of aes and blowfish algorithm
Implementation of aes and blowfish algorithm
eSAT Publishing House
 
Development and performance comparison of modified RSA algorithm with other c...
Development and performance comparison of modified RSA algorithm with other c...
IRJET Journal
 
METHODS TOWARD ENHANCING RSA ALGORITHM : A SURVEY
METHODS TOWARD ENHANCING RSA ALGORITHM : A SURVEY
IJNSA Journal
 
Comparative study of private and public key cryptography algorithms a survey
Comparative study of private and public key cryptography algorithms a survey
eSAT Publishing House
 
Dual-Layer Video Encryption and Decryption using RSA Algorithm
Dual-Layer Video Encryption and Decryption using RSA Algorithm
IJARIIT
 
An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...
An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...
IJEACS
 
A Cryptographic Key Generation Using 2D Graphics pixel Shuffling
A Cryptographic Key Generation Using 2D Graphics pixel Shuffling
IJMTST Journal
 
Cryptographic Algorithms For Secure Data Communication
Cryptographic Algorithms For Secure Data Communication
CSCJournals
 
Implementation of bpsc stegnography ( synopsis)
Implementation of bpsc stegnography ( synopsis)
Mumbai Academisc
 
Chapter 8 cryptography lanjutan
Chapter 8 cryptography lanjutan
newbie2019
 
Inscibe and Squeeze
Inscibe and Squeeze
Ayush Kejriwal
 
IRJET- Data Transmission using RSA Algorithm
IRJET- Data Transmission using RSA Algorithm
IRJET Journal
 
Image Cryptography using RSA Algorithm
Image Cryptography using RSA Algorithm
ijtsrd
 
An implementation of RSA policy
An implementation of RSA policy
SM NAZMUS SALEHIN
 
Encryption Data Measurement and Data Security of Hybrid AES and RSA Algorithm
Encryption Data Measurement and Data Security of Hybrid AES and RSA Algorithm
ijtsrd
 
Securing iClouds Storage Based On Combination of RSA and AES Crypto System
Securing iClouds Storage Based On Combination of RSA and AES Crypto System
CSCJournals
 
Implementation of aes and blowfish algorithm
Implementation of aes and blowfish algorithm
eSAT Publishing House
 
Development and performance comparison of modified RSA algorithm with other c...
Development and performance comparison of modified RSA algorithm with other c...
IRJET Journal
 
METHODS TOWARD ENHANCING RSA ALGORITHM : A SURVEY
METHODS TOWARD ENHANCING RSA ALGORITHM : A SURVEY
IJNSA Journal
 
Comparative study of private and public key cryptography algorithms a survey
Comparative study of private and public key cryptography algorithms a survey
eSAT Publishing House
 
Dual-Layer Video Encryption and Decryption using RSA Algorithm
Dual-Layer Video Encryption and Decryption using RSA Algorithm
IJARIIT
 
An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...
An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...
IJEACS
 
A Cryptographic Key Generation Using 2D Graphics pixel Shuffling
A Cryptographic Key Generation Using 2D Graphics pixel Shuffling
IJMTST Journal
 
Cryptographic Algorithms For Secure Data Communication
Cryptographic Algorithms For Secure Data Communication
CSCJournals
 
Implementation of bpsc stegnography ( synopsis)
Implementation of bpsc stegnography ( synopsis)
Mumbai Academisc
 
Chapter 8 cryptography lanjutan
Chapter 8 cryptography lanjutan
newbie2019
 
Ad

Recently uploaded (20)

Simplify Insurance Regulations with Compliance Management Software
Simplify Insurance Regulations with Compliance Management Software
Insurance Tech Services
 
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
2nd Sight Lab
 
Best Practice for LLM Serving in the Cloud
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
 
Automated Testing and Safety Analysis of Deep Neural Networks
Automated Testing and Safety Analysis of Deep Neural Networks
Lionel Briand
 
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
Best AI-Powered Wearable Tech for Remote Health Monitoring in 2025
Best AI-Powered Wearable Tech for Remote Health Monitoring in 2025
SEOLIFT - SEO Company London
 
Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
arctitecture application system design os dsa
arctitecture application system design os dsa
za241967
 
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
pcprocore
 
Why Edge Computing Matters in Mobile Application Tech.pdf
Why Edge Computing Matters in Mobile Application Tech.pdf
IMG Global Infotech
 
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
WSO2
 
Streamlining CI/CD with FME Flow: A Practical Guide
Streamlining CI/CD with FME Flow: A Practical Guide
Safe Software
 
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Muhammad Fahad Bashir
 
Complete WordPress Programming Guidance Book
Complete WordPress Programming Guidance Book
Shabista Imam
 
Decipher SEO Solutions for your startup needs.
Decipher SEO Solutions for your startup needs.
mathai2
 
Why Every Growing Business Needs a Staff Augmentation Company IN USA.pdf
Why Every Growing Business Needs a Staff Augmentation Company IN USA.pdf
mary rojas
 
ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
dheeodoo
 
Zoho Creator Solution for EI by Elsner Technologies.docx
Zoho Creator Solution for EI by Elsner Technologies.docx
Elsner Technologies Pvt. Ltd.
 
Humans vs AI Call Agents - Qcall.ai's Special Report
Humans vs AI Call Agents - Qcall.ai's Special Report
Udit Goenka
 
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
Shane Coughlan
 
Simplify Insurance Regulations with Compliance Management Software
Simplify Insurance Regulations with Compliance Management Software
Insurance Tech Services
 
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
2nd Sight Lab
 
Best Practice for LLM Serving in the Cloud
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
 
Automated Testing and Safety Analysis of Deep Neural Networks
Automated Testing and Safety Analysis of Deep Neural Networks
Lionel Briand
 
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
Best AI-Powered Wearable Tech for Remote Health Monitoring in 2025
Best AI-Powered Wearable Tech for Remote Health Monitoring in 2025
SEOLIFT - SEO Company London
 
Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
arctitecture application system design os dsa
arctitecture application system design os dsa
za241967
 
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
pcprocore
 
Why Edge Computing Matters in Mobile Application Tech.pdf
Why Edge Computing Matters in Mobile Application Tech.pdf
IMG Global Infotech
 
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
WSO2
 
Streamlining CI/CD with FME Flow: A Practical Guide
Streamlining CI/CD with FME Flow: A Practical Guide
Safe Software
 
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Muhammad Fahad Bashir
 
Complete WordPress Programming Guidance Book
Complete WordPress Programming Guidance Book
Shabista Imam
 
Decipher SEO Solutions for your startup needs.
Decipher SEO Solutions for your startup needs.
mathai2
 
Why Every Growing Business Needs a Staff Augmentation Company IN USA.pdf
Why Every Growing Business Needs a Staff Augmentation Company IN USA.pdf
mary rojas
 
ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
dheeodoo
 
Zoho Creator Solution for EI by Elsner Technologies.docx
Zoho Creator Solution for EI by Elsner Technologies.docx
Elsner Technologies Pvt. Ltd.
 
Humans vs AI Call Agents - Qcall.ai's Special Report
Humans vs AI Call Agents - Qcall.ai's Special Report
Udit Goenka
 
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
Shane Coughlan
 
Ad

Image and text Encryption using RSA algorithm in java

  • 1. A PROJECT REPORT ON “Image and Text Encryption and Decryption” In the fulfillment of theRequirement for the Degree of BachelorofComputerApplication(B.C.A.) Submitted By Mr. PATIL PIYUSH ANIL To G. H. Raisoni Institute of Business Management, Jalgaon Affiliated To Kavayitri Bahinabai Chaudhari, North Maharashtra University, Jalgaon 2019-2020
  • 2. ACKNOWLEDGEMENT A successful project is the result of a good team- work whichconsistsofnotonlythepartnerswhoputin their long and hard work but also those who guided them. Indeed, a truesaying. I would like to thanks to ______ and Hon. _________and our Project guide “_______” all my college Faculty members for providing me with valuable support and guiding me throughout my college days. Thanks andRegards Mr. PATIL PIYUSH ANIL
  • 3. Index Chapter Sr. No Topic Pages 1 Introduction 1.1 Introduction to Project 1 1.2 Introduction to Project Existing System and Need for New System 1-2 1.3 PROBLEM STATEMENT 2 1.4 OBJECTIVE 3 2 Project Details 2.1 Hardware/ Software Specification 4 3 Feasibility study 3.1 What is feasibility? 5 3.2 Technical feasibility 5 3.3 Economic feasibility 5 3.4 Operational feasibility 6 4 Preliminary Design 4.1 Introduction 7 4.2 Preliminary Design 7 4.3 Entity Relationship Diagram 10 4.4 Data Flow Diagram 11 5 Screen Layout 14 6 Testing 7.1 Introduction 18 7.2 White Box Testing 19 7.3 Black Box Testing 20 7 Implementation 22 8 Future Enhancement 31 9 Conclusion 32 10 Bibliography 33
  • 4. Page | 1 Chapter 1 Introduction to project Encryption software has become important when it comes to protecting your Data. Hack attempts and privacy intrusions mean that it's become easier than ever for complete strangers to access your most personal details stored on your computer. For businesses its worse, as the exposure of sensitive or confidential records can result in financial losses as well as heavy fines. While there are a number of security solutions available, everything from free anti-malware tools for home consumers and cloud anti-virus for business, even simple human error can undermine these attempts to secure data. Encryption software is already deployed by some large corporations and government agencies to protect data, but it's also available and now accessible for a wider range of users. Once properly setup, even if your security software fails, thieves/hackers/snoopers would still find it almost impossible to do anything with any encrypted data that might be exposed. 1.1Existing System:- There may exist many applications of encryption and decryption of varies type of file formats .this software are paid software and mainly available as web applications so they required high speed internet connection.
  • 5. Page | 2 New System:- The proposed system suggest a new concept that is free desktop application. It means user can use this application free of cost .whale in existed system user has to pay some amount to use the services. The new system will work in offline mode. Manse user can use it any time without any problem. The proposed system uses RSA (Rivest–Shamir–Adleman) algorithm. RSA is known to be the strongest publicly available encryption method. This algorithm works with both private key and public key. The only way of decrypting the files which are encrypted with the public key is to use the private key. Users’ file will be encrypted and saved to desktop .Then, user has to enter the private key to decrypt the file. The proposed study is enriched with Waterfall Development Methodology which implements a sequential based stage by stage concept. 1.2. PROBLEM STATEMENT:- The underlying respective architecture of most IT systems, including the desktop computer and internet, does not guarantee security. Users with malicious intents have always found a way of exploiting one vulnerability or the other. An attack that affects the confidentiality of information often presents the platform for the integrity of such information to be compromised. Intercepted information on transit would make little or no sense to an interceptor if he is not able to decipher the content of the information. This explains why it is very necessary to ensure that even when an intruder or unauthorized user successfully obtains access to some information the confidentiality and integrity of the information remain uncompromised.
  • 6. Page | 3 1.3. OBJECTIVE:- The objective of this project is to design and implement an application that encrypts and decrypts plain text and images using R.S.A algorithm. EXISTING SYSTEM Designing an encryption/decryption system, amongst other things, requires decision on the basic functionality of the software, and the choice of cryptographic algorithm to be used. While the functionality supports the attractiveness of the system, the type of cryptographic algorithm actually determines how much security the system would actually provide. Hence, this forms the major component in the system design
  • 7. Page | 4 Chapter 2 Hardware/Software Details Hardware/Software Hardware/Software Element Specification/version Hardware Processor Intel core to duo RAM 4 GB Hard Disk 100 GB Software OS Windows Java and Net beans IDE
  • 8. Page | 5 Chapter 3 Feasibility Study 3.1 What is Feasibility:- A feasibility study is an analysis that takes all of a project's relevant factors into account—including economic, technical, legal, and scheduling considerations to ascertain the likelihood of completing the project successfully. Project managers use feasibility studies to discern the pros and cons of undertaking a project before they invest a lot of time and money into it. 3.2Technical Feasibility:- It is always essential to evaluate the various aspects before we develop a system. Evaluation should always justify the cost and benefits ratio. If it is found that benefits are less compare to the cost of project, thenitisbettertoavoidgoinginforcomputerization. So technical feasibility is analysed. It has taken 2 days.
  • 9. Page | 6 3.3Operational Feasibility:- If you plan to change something inside the company that will affect how the organization runs or when a client asks you to explore a new product or process that will affect elements within their own organization. So, it has taken 2 days.
  • 10. Page | 7 Chapter 4 Preliminary Design 4.1 Introduction:- About RSA RSA is an encryption algorithm. Developed in: 1977. Developed by: Ron Rivest, Adi Shamir, and Leonard Adleman. The RSA algorithm is the most commonly used public key encryption algorithm. Encryption and Decryption Public Key Encryption:- It is also known as asymmetric cryptography.
  • 11. Page | 8 Two keys are used: Public Key and Private Key. Public Key: For encryption. Private Key: For decryption, also known as a secret key. Public Key: Shared with the public that wants to send us data. Private Key: Kept secret so that when someone sends us data encrypted by our Public Key, we can decrypt the data using the Private Key. HOW RSA WORKS:- Both users (sender and receiver) generates a public and private key. Flowchart of Generation of Public and Private Key in RSA.
  • 12. Page | 9 After getting the public and private key the main thing isto encrypt and decrypt File using RSA. Text Encryption and Decryption in RSA:- RSA Algorithm:- The public and the private key-generation algorithm is the most complex part of RSA cryptography. Two large prime numbers, p and q, are generated. A modulus n is calculated by multiplying p and q. This number is used by both the public and private keys and provides the link between them. The public key consists of the modulus n, and a public exponent, e as it's a prime number that is not too large. The e figure doesn’t have to be a secretly selected prime number as the public key is shared with everyone. The private key consists of the modulus n and the private exponent d, which is calculated using the Extended Euclidean algorithm to find the multiplicative inverse with respect to the totient of n. RSA algorithm is an asymmetric cryptography algorithm. Asymmetric means that it works on two different keys i.e. Public Key and Private Key. As the name suggests that the Public Key is given to everyone and Private Key is kept private.
  • 13. Page | 10 4.3Entity Relationship Diagram:- RSA (Rivest–Shamir–Adleman) algorithm ER Diagram
  • 14. Page | 11 4.4 Flow Chart for Encryption and Decryption:- The above flow chart shows how the project in this article works. The flow chart explains in a step by step manner the processing of the encryption and decryption, using JAVA. In this project, we only consider the images not audio. Images are encrypted, and create the *.txt file, the same file is used for decryption. IMAGE CRYPTOGRAPHY METHODOLOGY BY RSA:- The RSA is an cryptographic algorithm which is use to encrypt and decrypt the data. This algorithm developed in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman. RSA cryptosystem is also known as the public-key cryptosystems. RSA is normally used for secure data transmission. The encryption is starting on the RSA algorithm with the selection of two large prime numbers, along with an auxiliary value, as the public key. The prime numbers are keep in secret. The public key is used to encrypt a message, and private key is used to decrypt a message or information. The RSA algorithm is encrypt the original image and decrypts the image by the different keys
  • 15. Page | 12 RSA is an algorithm is using in the modern computer environment to encrypt and decrypt the data in transform. The RSA algorithm is also called as an asymmetric cryptographic algorithm. Asymmetric cryptosystem means two different keys are using in the encryption and decryption. In the two keys one key is using for encryption and the second key is using for decryption. This RSA algorithm is also called as the public key cryptography. Because one of the secret key can be given to everyone which means public. The other key must be kept private.
  • 16. Page | 13 RSA Cryptosystem
  • 17. Page | 14 Chapter 5 Screen Layout  After Starting application we can see the home page  After Click on Get Started Button Next window is open where there are two options
  • 18. Page | 15  Here User will select text or images  After User will Select text or Image for Safety application Ask Password
  • 19. Page | 16  On text Selection user Will navigate to for text Encryption  On Image Selection user Will navigate to for Image Encryption  Here are two options one for image encryption and other for image decryption
  • 20. Page | 17 After Encryption  In this image we can see there is a button to select image. After encryption image will be automatically saved to Desktop After decryption  In this image user will select the encrypted image and will get decrypted image as output. Decrypted image will automatically save to Desktop
  • 21. Page | 18 Chapter 6 Testing 6.1 Introduction:- Software Testing is a method to check whether the actual software product matches expected requirements and to ensure that software product is Defect free. It involves execution of software/system components using manual or automated tools to evaluate one or more properties of interest. The purpose of software testing is to identify errors, gaps or missing requirements in contrast to actual requirements. Why Software Testing is Important? Software Testing is Important because if there are any bugs or errors in the software, it can be identified early and can be solved before delivery of the software product. Properly tested software product ensures reliability, security and high performance which further results in time saving, cost effectiveness and customer satisfaction. What are the benefits of Software Testing? Here are the benefits of using software testing:- Cost-Effective: It is one of the important advantages of software testing. Testing any IT project on time helps you to save your money for the long term. In case if the bugs caught in the earlier stage of software testing, it costs less to fix. Security: It is the most vulnerable and sensitive benefit of software testing. People are looking for trusted products. It helps in removing risks and problems earlier. Product quality: It is an essential requirement of any software product. Testing ensures a quality product is delivered to customers.
  • 22. Page | 19 Customer Satisfaction: The main aim of any product is to give satisfaction to their customers. UI/UX Testing ensures the best user experience. 6.2White Box Testing White Box Testing is software testing technique in which internal structure, design and coding of software are tested to verify flow of input-output and to improve design, usability and security. In white box testing, code is visible to testers so it is also called Clear box testing, Open box testing, Transparent box testing, Code-based testing and Glass box testing. Advantages of White Box Testing:-  Code optimization by finding hidden errors.  White box tests cases can be easily automated.  Testing is more thorough as all code paths are usually covered.  Testing can start early in SDLC even if GUI is not available.
  • 23. Page | 20 Disadvantages of White Box Testing:-  White box testing can be quite complex and expensive.  Developers who usually execute white box test cases detest it. The white box testing by developers is not detailed can lead to production errors.  White box testing requires professional resources, with a detailed understanding of programming and implementation.  White-box testing is time-consuming, bigger programming applications take the time to test fully. 6.3Black Box Testing:- Black Box Testing is a software testing method in which the functionalities of software applications are tested without having knowledge of internal code structure, implementation details and internal paths. Black Box Testing mainly focuses on input and output of software applications and it is entirely based on software requirements and specifications. It is also known as Behavioral Testing.
  • 24. Page | 21 Tools used for Black Box Testing:- Tools used for Black box testing largely depends on the type of black box testing you are doing.  For Functional/ Regression Tests you can use - QTP, Selenium  For Non-Functional Tests, you can use - LoadRunner, Jmeter Black Box Testing and Software Development Life Cycle (SDLC):- Black box testing has its own life cycle called Software Testing Life Cycle (STLC) and it is relative to every stage of Software Development Life Cycle of Software Engineering. Requirement - This is the initial stage of SDLC and in this stage, a requirement is gathered. Software testers also take part in this stage. Test Planning & Analysis - Testing Types applicable to the project are determined. A Test Plan is created which determines possible project risks and their mitigation. Design - In this stage Test cases/scripts are created on the basis of software requirement documents Test Execution- In this stage Test Cases prepared are executed. Bugs if any are fixed and re-tested.
  • 25. Page | 22 Chapter 8 Implementation This project develop in java .it is a windows executable file with extinction (.jar) The application divided into three module  First module :- home module (home.java)  Second module :- text module (text.java)  Third module :- image module (image.java) The image module can be sub-divided as two modules Encryption (encryption.java) and Decryption (decryption.java) module. Text EncryptionGenerating RSA Public Private Key:- (RSAKeyPairGenerator.java):- import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.security.*; import java.util.Base64; public class RSAKeyPairGenerator { private PrivateKey privateKey; private PublicKey publicKey;
  • 26. Page | 23 public RSAKeyPairGenerator() throws NoSuchAlgorithmException { KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA"); keyGen.initialize(1024); KeyPair pair = keyGen.generateKeyPair(); this.privateKey = pair.getPrivate(); this.publicKey = pair.getPublic(); } public void writeToFile(String path, byte[] key) throws IOException { File f = new File(path); f.getParentFile().mkdirs(); FileOutputStream fos = new FileOutputStream(f); fos.write(key); fos.flush(); fos.close(); } public PrivateKey getPrivateKey() { return privateKey; } public PublicKey getPublicKey() { return publicKey; } public static void main(String[] args) throws NoSuchAlgorithmException, IOExcepti on { RSAKeyPairGenerator keyPairGenerator = new RSAKeyPairGenerator(); keyPairGenerator.writeToFile("RSA/publicKey", keyPairGenerator.getPublicKey() .getEncoded()); keyPairGenerator.writeToFile("RSA/privateKey", keyPairGenerator.getPrivateKey ().getEncoded()); System.out.println(Base64.getEncoder().encodeToString(keyPairGenerator.getPub licKey().getEncoded()));
  • 27. Page | 24 System.out.println(Base64.getEncoder().encodeToString(keyPairGenerator.getPri vateKey().getEncoded())); } } We can use factory method to generate these keys using KeyPairGenerator. For the demo purpose we are using a key size of 1024. By default, the private key is generated in PKCS#8 format and the public key is generated in X.509 format. Once these keys are generated, either you can write these keys in a file and share the file containing public keys with the client. Remember, the public key is written in the text file as X.509 format. Also, we can do a base64 encode to make it readable and share the string with the client. Text Encryption:- public static PublicKey getPublicKey(String base64PublicKey){ PublicKey publicKey = null; try{ X509EncodedKeySpec keySpec = new X509EncodedKeySpec(Base64.getDecoder().d ecode(base64PublicKey.getBytes())); KeyFactory keyFactory = KeyFactory.getInstance("RSA"); publicKey = keyFactory.generatePublic(keySpec); return publicKey; } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (InvalidKeySpecException e) { e.printStackTrace(); } return publicKey; } We have encryption.java that has methods defined for RSA encryption and decryption. Let us discuss about encryption first. As we discussed above the public key generated is in X.509 format and we use public key for encryption. Hence, we
  • 28. Page | 25 need X509EncodedKeySpec class to convert it again to RSA public key. Remember, that we have base64 encoded public keys. Hence, first let us first Base64 decode and generate the public key. we have a simple method encrypt()that takes the string to be encrypted and the Base64 encoded RSA key for encryption. Here getPublicKey() is the method that we defined above. public static byte[] encrypt(String data, String publicKey) throws BadPaddingExceptio n, IllegalBlockSizeException, InvalidKeyException, NoSuchPaddingException, NoSuchAlgo rithmException { Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); cipher.init(Cipher.ENCRYPT_MODE, getPublicKey(publicKey)); return cipher.doFinal(data.getBytes()); } Text Decryption:- public staticPrivateKey getPrivateKey(String base64PrivateKey){ PrivateKey privateKey = null; PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(Base64.getDecoder().dec ode(base64PrivateKey.getBytes())); KeyFactory keyFactory = null; try { keyFactory = KeyFactory.getInstance("RSA"); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } try { privateKey = keyFactory.generatePrivate(keySpec); } catch (InvalidKeySpecException e) { e.printStackTrace(); } return privateKey; } For decryption we will be using private key and we discussed above that the private key is generated in PKCS#8 format. Hence, following is the code to
  • 29. Page | 26 generate the private key from base64 encoded string using PKCS8EncodedKeySpec. Now following is the decrypt method that accepts RSA encrypted string and Base64 encoded RSA private key for decryption. public static String decrypt(String data, String base64PrivateKey) throws IllegalBloc kSizeException, InvalidKeyException, BadPaddingException, NoSuchAlgorithmException, N oSuchPaddingException { return decrypt(Base64.getDecoder().decode(data.getBytes()), getPrivateKey(bas e64PrivateKey)); } Image Encryption:- import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException;
  • 30. Page | 27 import javax.crypto.KeyGenerator; import javax.crypto.NoSuchPaddingException; import javax.crypto.SecretKey; public class EncryptFile { KeyGenerator keyGenerator = null; SecretKey secretKey = null; Cipher cipher = null; public EncryptFile() { try { keyGenerator = KeyGenerator.getInstance("Blowfish"); secretKey = keyGenerator.generateKey(); cipher = Cipher.getInstance("Blowfish"); } catch (NoSuchPaddingException ex) { System.out.println(ex); } catch (NoSuchAlgorithmException ex) { System.out.println(ex);}} public static void main(String[] args) { String fileToEncrypt = "fileToEncrypt.jpg"; String encryptedFile = "encryptedFile.jpg"; String decryptedFile = "decryptedFile.jpg"; String directoryPath = "C:/Users/dhanoopbhaskar/Desktop/blowfish/"; EncryptFile encryptFile = new EncryptFile(); System.out.println("Starting Encryption..."); encryptFile.encrypt(directoryPath + fileToEncrypt,
  • 31. Page | 28 directoryPath + encryptedFile); System.out.println("Encryption completed..."); System.out.println("Starting Decryption..."); encryptFile.decrypt(directoryPath + encryptedFile, directoryPath + decryptedFile); System.out.println("Decryption completed...");} private void encrypt(String srcPath, String destPath) { File rawFile = new File(srcPath); File encryptedFile = new File(destPath); InputStream inStream = null; OutputStream outStream = null; try { cipher.init(Cipher.ENCRYPT_MODE, secretKey); inStream = new FileInputStream(rawFile); outStream = new FileOutputStream(encryptedFile); byte[] buffer = new byte[1024]; int len; while ((len = inStream.read(buffer)) > 0) { outStream.write(cipher.update(buffer, 0, len)); outStream.flush();} outStream.write(cipher.doFinal()); inStream.close(); outStream.close(); } catch (IllegalBlockSizeException ex) { System.out.println(ex);
  • 32. Page | 29 } catch (BadPaddingException ex) { System.out.println(ex); } catch (InvalidKeyException ex) { System.out.println(ex); } catch (FileNotFoundException ex) { System.out.println(ex); } catch (IOException ex) { System.out.println(ex); }} Image Decryption:- private void decrypt(String srcPath, String destPath) { File encryptedFile = new File(srcPath); File decryptedFile = new File(destPath); InputStream inStream = null; OutputStream outStream = null; try { cipher.init(Cipher.DECRYPT_MODE, secretKey); inStream = new FileInputStream(encryptedFile); outStream = new FileOutputStream(decryptedFile); byte[] buffer = new byte[1024]; int len; while ((len = inStream.read(buffer)) > 0) {
  • 33. Page | 30 outStream.write(cipher.update(buffer, 0, len)); outStream.flush(); } outStream.write(cipher.doFinal()); inStream.close(); outStream.close(); } catch (IllegalBlockSizeException ex) { System.out.println(ex); } catch (BadPaddingException ex) { System.out.println(ex); } catch (InvalidKeyException ex) { System.out.println(ex); } catch (FileNotFoundException ex) { System.out.println(ex); } catch (IOException ex) { System.out.println(ex);}}}
  • 34. Page | 31 Chapter 8 Future Enhancement In today’s world the protection of sensitive data is one of the most critical concerns for organizations and their customers. This, coupled with growing regulatory pressures, is forcing businesses to protect the integrity, privacy and security of critical information. As a result cryptography is emerging as the foundation for enterprise data security and compliance, and quickly becoming the foundation of security best practice. Cryptography, once seen as a specialized, esoteric discipline of information security, is finally coming of age. No one would argue that cryptography and encryption are new technologies. It was true decades ago and it is still true today – encryption is the most reliable way to secure data. National security agencies and major financial institutions have long protected their sensitive data using cryptography and encryption. Today the use of encryption is growing rapidly, being deployed in a much wider set of industry sectors and across an increasing range of applications and platforms. Put simply, cryptography and encryption have become one of the hottest technologies in the IT security industry – the challenge now is to ensure that IT organizations are equipped to handle this shift and are laying the groundwork today to satisfy their future needs.
  • 35. Page | 32 Chapter 9 Conclusion At the end of the day we need to protect our data. Increasingly, encryption is being seen as the best way to ensure that data is protected, but the ever growing use of encryption creates a management challenge. The challenge, however, doesn’t need to be daunting. Implementing a flexible and extensible solution that automates many of the time-consuming and error-prone key management tasks in an automated enterprise-wide manner is rapidly becoming a priority for many organizations. In order for enterprise-wide encryption to be deployed correctly, organizations need to deploy the correct tool to manage the keys. In the same way that data protection has moved from an IT challenge to a C-level issue, key management has become a high- level business imperative.
  • 36. Page | 33 Chapter 10 Bibliography  https://www.theinsanetechie.in/2013/08/java-encryption-and-decryption-of- image.html  https://www.devglan.com/java8/rsa-encryption-decryption-java  https://www.helpnetsecurity.com/2008/02/18/the-future-of-encryption/  https://www.tutorialspoint.com/cryptography/public_key_encryption.htm  https://www.c-sharpcorner.com/UploadFile/75a48f/rsa-algorithm-with-C- Sharp2/  https://www.codeproject.com/Articles/723175/Image-Cryptography-using- RSA-Algorithm-in-Csharp  https://www.thecrazyprogrammer.com/2017/03/rsa-algorithm.html