Chapter
Chapter
CHAPTER-1
1.1 INTRODUCTION :
Nowadays people obtain a certification as a proof that they have the knowledge in the related
field. At present time, the companies process to certify a certificate take at least around 3 days
[1]. However, some of the companies need a certificate for hiring but they take a shortcut
without authenticatee certificate with reason which the process needs take a long time. Apart
from that, based on the research that has done state that the use of forged degree certificates in
higher education has seen a rise in this last few years [2]. Due to that, in this project, a certificate
authentication system using QR code will be developing to make people easier in authentication
progress and help in solving the current issues.
On the other side, Quick Response Code (QR Code) system has become popular use in
authentication method because it has fast readability and great storage capacity compare to
other type of barcode. QR code is the trademark of a type of matrix barcode. It has error
correction capability which is dirt and damage resistant and it also readable 2 from any direction
in 360 degrees. The Quick Response aspects of the code make it a convenient way to serve up
content to people on the go.
Hence, in this paper, it is proposed a QR code with certification method by cryptology. The
effectiveness of the certification authentication system is ensured based on the information
stored in the QR code generated that printed on the certification. A QR reader application can
be appear to be essential because it needed to scan QR code in order to obtain the information
that stored in the code which is able to checking the authentication of the certification.
Introduction to QR Codes:
Quick Response (QR) codes have become ubiquitous in today's digital landscape,
revolutionizing the way information is stored, shared, and accessed. Initially created in Japan
in the 1990s by Denso Wave, a subsidiary of Toyota, QR codes were originally designed to
track automotive parts during manufacturing. However, their versatility quickly led to their
adoption in various fields, making them a prominent feature of contemporary technology.
A QR code is a two-dimensional matrix barcode that can encode a wide range of data types,
including text, URLs, contact information, and more. Unlike traditional barcodes, QR codes
can store significantly more information in a compact, square format. This efficiency in data
storage, coupled with their ease of use, has made QR codes an integral part of our daily lives.
QR codes are characterized by their distinct square shape, composed of black squares and white
background modules arranged in a grid pattern. These codes are designed to be scanned and
decoded by QR code readers, which are readily available on smartphones and dedicated QR
code scanning devices.
The versatility of QR codes extends to various applications across industries. They are
commonly used for:
Marketing and Advertising: QR codes enable businesses to provide easy access to product
information, promotions, and websites when scanned by consumers. They facilitate interactive
marketing campaigns and bridge the gap between physical and digital marketing channels.
Contactless Payments: QR codes are integral to mobile payment systems, allowing users to
make transactions by scanning a code displayed at a point of sale. Services like Apple Pay and
Google Pay utilize QR codes for secure payments.
Ticketing and Boarding Passes: Airlines, cinemas, and event organizers use QR codes as
electronic tickets and boarding passes. Passengers can scan their codes for quick entry and
validation.
Healthcare: QR codes have found applications in healthcare, from accessing patient records
to contactless check-ins at medical facilities. They play a crucial role in facilitating streamlined
processes and minimizing physical contact.
Navigation and Location Services: QR codes embedded in maps and signage provide
navigation assistance. Scanning the code can offer directions, detailed information about a
location, or even a link to a GPS navigation app.
Education: QR codes are used in educational materials to link to additional resources, videos,
or interactive content. They enhance the learning experience by providing immediate access to
supplementary materials.
As QR codes continue to evolve, they offer a convenient and efficient way to bridge the digital-
physical divide, connect people with information, and simplify everyday tasks. Their
adaptability and utility make them a valuable tool in an increasingly digital world, with
numerous possibilities for innovation and integration in various domains.
Certificate authentication using QR codes is a secure and convenient method to verify the
authenticity of digital certificates and documents. This process involves encoding certificate
information into a QR code, which can be easily scanned and verified using a QR code reader
or a mobile app. Here's a more detailed explanation of how certificate authentication using QR
codes works:
1. Certificate Generation:
The certificate authority or issuer generates a digital certificate for an individual or entity. This
certificate typically includes information like the recipient's name, credential details, and a
digital signature to ensure its authenticity.
2. QR Code Generation:
The certificate information is converted into a QR code format. This conversion involves
encoding the certificate data into the QR code using a specific algorithm or generator.
3. QR Code Placement:
The QR code can be placed on the physical certificate or sent electronically to the certificate
holder. When printed on physical documents, it's crucial to ensure that the QR code is tamper-
resistant to maintain its integrity.
4. Verification Process:
To authenticate the certificate, a verifier (e.g., an employer, educational institution, or anyone
with a verification role) uses a QR code reader or a mobile app. They scan the QR code on the
certificate.
5. Data Extraction:
The QR code reader extracts the encoded certificate data from the QR code. This data typically
includes a unique identifier and certificate details.
6. Online Verification (Optional):
In some cases, the verifier may connect to an online database or a trusted source to cross-
reference the extracted data with the issuer's records. This step ensures real-time verification
and helps confirm the validity of the certificate.
7. Verification Outcome:
Based on the comparison of the extracted data with the issuer's records and any additional
verification checks, the verifier determines whether the certificate is valid or not. If the
information matches and the certificate is still valid, it is considered authentic.
Benefits of Certificate Authentication Using QR Codes:
• Enhanced Security: QR codes are difficult to counterfeit, and digital certificates are
typically secure. This combination enhances the overall security of certificate
verification.
• Efficiency: The process is streamlined, reducing the time and effort required for manual
verification.
• Accessibility: QR code scanning is widely accessible and doesn't require specialized
equipment or knowledge.
• Reduced Paperwork: Digital certificates with QR codes reduce the reliance on physical
paperwork and storage, making it a more eco-friendly and cost-effective solution.
• Real-time Verification: Online verification allows for real-time checks, ensuring that
the certificate is still valid and up-to-date.
Certificate authentication using QR codes is a valuable tool in various fields, including
education, professional certification, identity verification, and more, offering a reliable and
convenient method to verify the authenticity of digital certificates.
1.3 Objectives:
implementing a certificate authentication system using QR codes comes with several key
objectives that aim to improve the security, accessibility, and efficiency of the verification
process. These objectives are essential for addressing the challenges associated with traditional
certificate authentication methods. Here are the primary objectives:
1. TO Enhanced Security: The use of QR codes, which are difficult to counterfeit, will help
enhance the security of certificate authentication.
2. TO Efficiency: The new system should streamline the verification process, reducing the
time and effort required for manual checks.
3. TO Accessibility: The system should be user-friendly and accessible to a wide range of
users, promoting ease of use for employers, educational institutions, and other verifying
authorities.
4. TO Real-time Verification: The system should be capable of real-time verification by
connecting to online databases, ensuring the validity and currency of certificates.
5. TO Data Integrity: Measures should be in place to ensure the integrity and authenticity
of certificate data encoded in the QR code.
i. To study the QR code technology for document authentication process
ii. To develop a certificate authentication system using QR cod
iii. To evaluate the functionality of the document authentication system
different applications of computer science discipline. These applications are spread from spell
checker, database management applications, symbol tables generated by loaders, assembler,
and compilers. There are various forms of hashing that are used in different problems of
hashing like Dynamic hashing, Cryptographic hashing, Geometric hashing, Robust hashing,
Bloom hash, String hashing. At the end we conclude which type of hash function is suitable
for which kind of problem.
4) Understanding 2D-barcode technology and applications in M-commerce – design and
implementation of a 2D barcode processing solution
AUTHORS: J. Z. Gao
With the swift increase of the number of mobile device users, more wireless information
services and mobile commerce applications are needed. Since various barcodes have been
used for decades as a very effective means in many traditional commerce systems, today
people are looking for innovative solutions to use barcodes in the wireless world. Recently,
the mobile industry began to pay more attention to barcode applications in m-commerce
because 2D-barcodes not only provide a simple and inexpensive method to present diverse
commerce data, but also improve mobile user experience by reducing their inputs. This paper
first discusses 2D-barcode concepts, types and classifications, major technology players, and
applications in mobile commerce. Then, it reports a research project to develop a 2D-barcode
processing solution to support mobile applications. Moreover, the paper also presents the
application examples, and case study using the solution.
5) Document Certificate Authentication System Using Digitally Signed QR Code Tag
AUTHORS: Hamdi Abdurhman Ahmed, Jong Wook Jang
Now a day document such as Degree certificate can be easily forged fully or partially
modifying obtained score result like GPA (Grade Point Average). Digital signature are used to
detect unauthorized modification to data and to authenticate the identity of signatory. The
Quick Response (QR) code was designed for storage information and high-speed readability.
This paper proposed a method that QR code will contain a digital signature with the student
data such as degree holder's name, major program, GPA obtained and more, which will be
signed by Higher Educational Institute (HEI). In order to use this system, all HEI have to
register in central system, the central system provide another system that will deploy in each
HEI. All digitally signed certificate generating process are offline. To verify the digital
signature signed with QR code, we developed specific smart phone application which will
scan and authenticate the certificate without the need to address the certificate issuing
institution and gaining access to user's security credentials.
In Japan, the immigration department has used encrypted QR codes on visas [3]. The secure
QR codes can be made that make the scanner enter a password to be able to access the
content. This is a good idea to make secure QR codes for people use in immigrations. This
means other than the immigration department that for check in and out, people cannot see
decode the QR code without the password. Obviously, the 5 security level of QR codes is
very high although simple encryption systems may be involved.
Apart from that, applications that already exist are to use encrypted QR codes on products
packaging, advertising, in show window display and more for business marketing. This
application is built for customer guarantees that any copyrights to any components of
products, designs, trademarks that are employed for inclusion in the custom QR codes are
either owned by customer.
In recent years, certificate authentication system using QR code was developed to increase the
security of certificate. In this certificate authentication system, the information that encrypted
in the QR codes needs to be decoded by using QR reader applications. Then the scanned QR
code in the application are processed by using various techniques of image processing such as
cryptography, morphological, stenography, image subtraction, watermark and etc to get the
information of certificate from the QR code in order to check the authentication of cert. Then
based on the information the authentication of certificate is checked.
User Education: Lack of proper education and training for certificate holders and verifiers can
result in missteps and errors in the verification process.
Audit and Logging: The system may lack robust audit and logging features for tracking
verification activities, which can be important for record-keeping and compliance.
QR Code Expiration: If the QR code doesn't have an expiration mechanism or is not
automatically updated with the latest information, outdated or invalid certificates may still pass
verification.
Complex QR Code Content: Overly complex QR code content, such as long URLs or extensive
data, can lead to issues with readability and scanning.
Data Integrity in Transit: If the certificate data is not adequately protected during transmission
from the QR code to the verification system, it could be intercepted or modified.
Verification Device Compatibility: Compatibility issues between verification devices (e.g.,
mobile devices) and QR code readers can hinder the verification process.
Addressing these technical problems and weaknesses is crucial for enhancing the security and
efficiency of certificate authentication using QR codes. Implementing solutions such as
encryption, standardization, and robust backend systems can help mitigate these issues.
b. For Development:
Server or Hosting: The specific hardware requirements for deployment will depend on factors
like the number of users, the complexity of your application, and its expected workload. For
small to medium-scale deployments, a virtual private server (VPS) or cloud hosting (e.g., AWS,
Azure, Google Cloud) should suffice. Make sure to choose an instance size that matches your
expected traffic.
1.Memory (RAM): The amount of RAM required will depend on the number of concurrent
users and the size of the application. A starting point could be 2GB of RAM for a small
deployment, but you may need more for larger applications.
2.Storage: You will need sufficient storage to store the application, databases, and user data.
SSD storage is recommended for faster access.
3.Processor: A multi-core processor with decent processing power is important, especially for
handling concurrent user requests.
4.Networking: Ensure a stable and high-speed internet connection for your server. It should be
capable of handling the expected traffic.
5.Redundancy: For mission-critical applications, consider redundancy and failover
mechanisms to ensure high availability.
6.Security: Implement necessary security measures, such as firewalls, intrusion detection
systems, and regular security updates.
7.Backup and Disaster Recovery: Have a backup and disaster recovery plan in place to protect
against data loss.
5.QR Code Generation Library: You'll need a Java library for generating QR codes. One
popular library is the ZXing (Zebra Crossing) library.
6.Web Development Tools (Optional): If your application includes a web component, you
may need web development tools such as HTML, CSS, and JavaScript, and possibly a web
framework like Spring Boot for building web applications.
b.For Deployment:
1.Java Runtime Environment (JRE): Your deployment environment should have the Java
Runtime Environment installed to run Java applications. Install the JRE that matches your
application's Java version.
2.Application Server (Optional): If your Java application is web-based, you may need an
application server like Apache Tomcat, Jetty, or WildFly to deploy your application.
3.Database Management System: Depending on your application's requirements, you might
need a database management system such as MySQL, PostgreSQL, Oracle Database, or
MongoDB to store and manage data.
4.Web Server (Optional): If your application has a web front end, you may need a web server
(e.g., Apache HTTP Server) to serve static content and act as a reverse proxy.
5.Operating System: Ensure your deployment environment runs on a compatible and secure
operating system (e.g., Linux, Windows, or macOS).
6.Security Software: Implement security software, including firewalls, intrusion detection
systems, and encryption protocols, to protect your application and user data.
7.Monitoring and Logging Tools: Deploy monitoring and logging tools to track application
performance and troubleshoot issues. Tools like Prometheus, Grafana, and ELK stack can be
helpful.
8.Backup and Recovery Solutions: Implement backup and disaster recovery solutions to
safeguard against data loss and ensure business continuity.
9.Dependency Management: Use a package manager or dependency management tool to
ensure all required libraries and dependencies are available in the deployment environment.
10.SSL Certificate: If your application involves secure communication, you'll need an
SSL/TLS certificate for HTTPS encryption.
11.Load Balancer (Optional): For high-traffic applications, a load balancer can distribute
incoming requests across multiple application server instances.
3.SYSTEM DESIGN
SYSTEM ARCHITECTURE:
SYSTEM DESIGN
3.1 Functions of the system
3.1.1 Use Case Diagrams:
Chapter-4
Implementation
4.1 Implementation Environment:
SOFTWARE ENVIRONMENT
Java Technology
Java technology is both a programming language and a platform. Java, a versatile and
widely-used programming language, has left an indelible mark on the world of software
development since its inception. Created by James Gosling and his team at Sun Microsystems
(now owned by Oracle Corporation), Java emerged in the mid-1990s as a revolutionary
language with its promise of "write once, run anywhere" capability. This phrase encapsulates
Java's ability to be executed on any platform that supports the Java Virtual Machine (JVM),
freeing developers from the constraints of specific operating systems.
Java's popularity can be attributed to its exceptional portability, robustness, and comprehensive
libraries that expedite the development process. With its object-oriented nature, Java promotes
structured and modular programming practices, making it suitable for projects ranging from
small applications to large-scale enterprise systems. The language's syntax, influenced by C
and C++, is designed to be readable and expressive, promoting ease of understanding and
maintenance of codebases.
Java's significance extends beyond its core language features. The Java ecosystem includes a
plethora of frameworks, tools, and libraries that facilitate tasks such as web development,
mobile app creation, scientific computing, and more. The community-driven Java Standard
Library provides a wide array of pre-built classes and methods, empowering developers to
focus on solving unique challenges rather than reinventing the wheel.
Security is another hallmark of Java. The JVM's security features, such as bytecode verification
and runtime access control, contribute to Java's reputation as a secure language, making it an
ideal choice for developing applications that handle sensitive data or run in environments with
stringent security requirements.
In this era of technological evolution, Java remains highly relevant. It powers a significant
portion of enterprise software, Android mobile applications, and various web-based
applications. Its adaptability to changing trends, like the rise of microservices architecture and
cloud computing, demonstrates its resilience and ongoing relevance in the ever-evolving
software landscape.
Whether you are a seasoned developer or a beginner eager to delve into programming, Java
offers a rich and vibrant environment to explore, experiment, and create. This introduction
provides a glimpse into the world of Java, hinting at its history, features, and significance in
modern software development. As we journey further, we will delve deeper into the language's
intricacies, applications, and best practices, uncovering the multitude of possibilities that Java
brings to the realm of programming.
▪ Simple
▪ Architecture neutral
▪ Object oriented
▪ Portable
▪ Distributed
▪ High performance
▪ Interpreted
▪ Multithreaded
▪ Robust
▪ Dynamic
▪ Secure
With most programming languages, you either compile or interpret a program so that
you can run it on your computer. The Java programming language is unusual in that a program
is both compiled and interpreted. With the compiler, first you translate a program into an
intermediate language called Java byte codes —the platform-independent codes interpreted by
the interpreter on the Java platform. The interpreter parses and runs each Java byte code
instruction on the computer. Compilation happens just once; interpretation occurs each time
the program is executed. The following figure illustrates how this works.
You can think of Java byte codes as the machine code instructions for the Java Virtual
Machine (Java VM). Every Java interpreter, whether it’s a development tool or a Web browser
that can run applets, is an implementation of the Java VM. Java byte codes help make “write
once, run anywhere” possible. You can compile your program into byte codes on any platform
that has a Java compiler. The byte codes can then be run on any implementation of the Java
VM. That means that as long as a computer has a Java VM, the same program written in the
Java programming language can run on Windows 2000, a Solaris workstation, or on an iMac.
operating system and hardware. The Java platform differs from most other platforms in
that it’s a software-only platform that runs on top of other hardware-based platforms.
The Java API is a large collection of ready-made software components that provide
many useful capabilities, such as graphical user interface (GUI) widgets. The Java API
is grouped into libraries of related classes and interfaces; these libraries are known as
packages. The next section, What Can Java Technology Do? Highlights what
functionality some of the packages in the Java API provide.
The following figure depicts a program that’s running on the Java platform. As the
figure shows, the Java API and the virtual machine insulate the program from the
hardware.
Native code is code that after you compile it, the compiled code runs on a
specific hardware platform. As a platform-independent environment, the Java platform
can be a bit slower than native code. However, smart compilers, well-tuned interpreters,
and just-in-time byte code compilers can bring performance close to that of native code
without threatening portability.
However, the Java programming language is not just for writing cute, entertaining
applets for the Web. The general-purpose, high-level Java programming language is
also a powerful software platform. Using the generous API, you can write many types
of programs.
An application is a standalone program that runs directly on the Java platform. A special
kind of application known as a server serves and supports clients on a network.
Examples of servers are Web servers, proxy servers, mail servers, and print servers.
Another specialized program is a servlet. A servlet can almost be thought of as an applet
that runs on the server side. Java Servlets are a popular choice for building interactive
web applications, replacing the use of CGI scripts. Servlets are similar to applets in that
they are runtime extensions of applications. Instead of working in browsers, though,
servlets run within Java Web servers, configuring or tailoring the server.
How does the API support all these kinds of programs? It does so with packages of
software components that provides a wide range of functionality. Every full
implementation of the Java platform gives you the following features:
• The essentials: Objects, strings, threads, numbers, input and output, data
structures, system properties, date and time, and so on.
• Applets: The set of conventions used by applets.
• Networking: URLs, TCP (Transmission Control Protocol), UDP (User Data
gram Protocol) sockets, and IP (Internet Protocol) addresses.
• Internationalization: Help for writing programs that can be localized for users
worldwide. Programs can automatically adapt to specific locales and be
displayed in the appropriate language.
• Security: Both low level and high level, including electronic signatures, public
and private key management, access control, and certificates.
• Software components: Known as JavaBeansTM, can plug into existing
component architectures.
• Object serialization: Allows lightweight persistence and communication via
Remote Method Invocation (RMI).
• Java Database Connectivity (JDBCTM): Provides uniform access to a wide
range of relational databases.
The Java platform also has APIs for 2D and 3D graphics, accessibility, servers,
collaboration, telephony, speech, animation, and more. The following figure depicts
what is included in the Java 2 SDK.
We can’t promise you fame, fortune, or even a job if you learn the Java
programming language. Still, it is likely to make your programs better and requires less
effort than other languages. We believe that Java technology will help you do the
following:
From a programming perspective, the beauty of ODBC is that the application can be
written to use the same set of function calls to interface with any data source, regardless of the
database vendor. The source code of the application doesn’t change whether it talks to Oracle
or SQL Server. We only mention these two as an example. There are ODBC drivers available
for several dozen popular database systems. Even Excel spreadsheets and plain text files can
be turned into data sources. The operating system uses the Registry information written by
ODBC Administrator to determine which low-level ODBC drivers are needed to talk to the
data source (such as the interface to Oracle or SQL Server). The loading of the ODBC drivers
is transparent to the ODBC application program. In a client/server environment, the ODBC API
even handles many of the network issues for the application programmer.
The advantages of this scheme are so numerous that you are probably thinking there
must be some catch. The only disadvantage of ODBC is that it isn’t as efficient as talking
directly to the native database interface. ODBC has had many detractors make the charge that
it is too slow. Microsoft has always claimed that the critical factor in performance is the quality
of the driver software that is used. In our humble opinion, this is true. The availability of good
ODBC drivers has improved a great deal recently. And anyway, the criticism about
performance is somewhat analogous to those who said that compilers would never match the
speed of pure assembly language. Maybe not, but the compiler (or ODBC) gives you the
opportunity to write cleaner programs, which means you finish sooner. Meanwhile, computers
get faster every year.
JDBC
In an effort to set an independent database standard API for Java; Sun Microsystems
developed Java Database Connectivity, or JDBC. JDBC offers a generic SQL database access
mechanism that provides a consistent interface to a variety of RDBMSs. This consistent
interface is achieved through the use of “plug-in” database connectivity modules, or drivers. If
a database vendor wishes to have JDBC support, he or she must provide the driver for each
platform that the database and Java run on.
To gain a wider acceptance of JDBC, Sun based JDBC’s framework on ODBC. As you
discovered earlier in this chapter, ODBC has widespread support on a variety of platforms.
Basing JDBC on ODBC will allow vendors to bring JDBC drivers to market much faster than
developing a completely new connectivity solution.
JDBC was announced in March of 1996. It was released for a 90 day public review that
ended June 8, 1996. Because of user input, the final JDBC v1.0 specification was released soon
after.
The remainder of this section will cover enough information about JDBC for you to know what
it is about and how to use it effectively. This is by no means a complete overview of JDBC.
That would fill an entire book.
JDBC Goals
Few software packages are designed without goals in mind. JDBC is one that, because
of its many goals, drove the development of the API. These goals, in conjunction with early
reviewer feedback, have finalized the JDBC class library into a solid framework for building
database applications in Java.
The goals that were set for JDBC are important. They will give you some insight as to why
certain classes and functionalities behave the way they do. The eight design goals for JDBC are
as follows:
2. SQL Conformance
SQL syntax varies as you move from database vendor to database vendor. In an effort
to support a wide variety of vendors, JDBC will allow any query statement to be passed
through it to the underlying database driver. This allows the connectivity module to handle
non-standard functionality in a manner that is suitable for its users.
allows JDBC to use existing ODBC level drivers by the use of a software interface. This
interface would translate JDBC calls to ODBC and vice versa.
4. Provide a Java interface that is consistent with the rest of the Java system
Because of Java’s acceptance in the user community thus far, the designers feel that
they should not stray from the current design of the core Java system.
5. Keep it simple
This goal probably appears in all software design goal listings. JDBC is no exception.
Sun felt that the design of JDBC should be very simple, allowing for only one method of
completing a task per mechanism. Allowing duplicate functionality only serves to confuse
the users of the API.
Java is also unusual in that each Java program is both compiled and interpreted.
With a compile you translate a Java program into an intermediate language called
Java byte codes the platform-independent code instruction is passed and run on the
computer.
Compilation happens just once; interpretation occurs each time the program is
executed. The figure illustrates how this works.
Compilers My Program
You can think of Java byte codes as the machine code instructions for the Java
Virtual Machine (Java VM). Every Java interpreter, whether it’s a Java development
tool or a Web browser that can run Java applets, is an implementation of the Java
VM. The Java VM can also be implemented in hardware.
Java byte codes help make “write once, run anywhere” possible. You can
compile your Java program into byte codes on my platform that has a Java compiler.
The byte codes can then be run any implementation of the Java VM. For example,
the same Java program can run Windows NT, Solaris, and Macintosh.
Networking
TCP/IP stack
IP datagram’s
UDP
TCP
Internet addresses
In order to use a service, you must be able to find it. The Internet uses an address
scheme for machines so that they can be located. The address is a 32 bit integer which
gives the IP address. This encodes a network ID and more addressing. The network
ID falls into various classes according to the size of the network address.
Network address
Class A uses 8 bits for the network address with 24 bits left over for other
addressing. Class B uses 16 bit network addressing. Class C uses 24 bit network
addressing and class D uses all 32.
Subnet address
Host address
8 bits are finally used for host addresses within our subnet. This places a limit of
256 machines that can be on the subnet.
Total address
Port addresses
A service exists on a host, and is identified by its port. This is a 16 bit number. To
send a message to a server, you send it to the port for that service of the host that it is
running on. This is not location transparency! Certain of these ports are "well known".
Sockets
#include <sys/types.h>
#include <sys/socket.h>
int socket(int family, int type, int protocol);
JFree Chart
JFreeChart is a free 100% Java chart library that makes it easy for developers to
display professional quality charts in their applications. JFreeChart's extensive feature
set includes:
A flexible design that is easy to extend, and targets both server-side and client-
side applications;
Support for many output types, including Swing components, image files
(including PNG and JPEG), and vector graphics file formats (including PDF, EPS and
SVG);
1. Map Visualizations
Charts showing values that relate to geographical areas. Some examples include:
(a) population density in each state of the United States, (b) income per capita for each
country in Europe, (c) life expectancy in each country of the world. The tasks in this
project include:
Sourcing freely redistributable vector outlines for the countries of the world,
states/provinces in particular countries (USA in particular, but also other areas);
Implement a new (to JFreeChart) feature for interactive time series charts --- to display a
separate control that shows a small version of ALL the time series data, with a sliding
"view" rectangle that allows you to select the subset of the time series data to display in the
main chart.
3. Dashboards
4. Property Editors
The property editor mechanism in JFreeChart only handles a small subset of the
properties that can be set for charts. Extend (or reimplement) this mechanism to provide
greater end-user control over the appearance of the charts.
Sun Microsystems defines J2ME as "a highly optimized Java run-time environment targeting a
wide range of consumer products, including pagers, cellular phones, screen-phones, digital set-
top boxes and car navigation systems." Announced in June 1999 at the JavaOne Developer
Conference, J2ME brings the cross-platform functionality of the Java language to smaller
devices, allowing mobile wireless devices to share applications. With J2ME, Sun has adapted
the Java platform for consumer products that incorporate or are based on small computing
devices.
J2ME uses configurations and profiles to customize the Java Runtime Environment (JRE). As
a complete JRE, J2ME is comprised of a configuration, which determines the JVM used, and a
profile, which defines the application by adding domain-specific classes. The configuration
defines the basic run-time environment as a set of core classes and a specific JVM that run on
specific types of devices. We'll discuss configurations in detail in the The profile defines the
application; specifically, it adds domain-specific classes to the J2ME configuration to define
certain uses for devices. We'll cover profiles in depth in the The following graphic depicts the
relationship between the different virtual machines, configurations, and profiles. It also draws
a parallel with the J2SE API and its Java virtual machine. While the J2SE virtual machine is
generally referred to as a JVM, the J2ME virtual machines, KVM and CVM, are subsets of
JVM. Both KVM and CVM can be thought of as a kind of Java virtual machine -- it's just that
they are shrunken versions of the J2SE JVM and are specific to J2ME.
Introduction In this section, we will go over some considerations you need to keep in mind
when developing applications for smaller devices. We'll take a look at the way the compiler is
invoked when using J2SE to compile J2ME applications. Finally, we'll explore packaging and
deployment and the role preverification plays in this process.
Developing applications for small devices requires you to keep certain strategies in mind during
the design phase. It is best to strategically design an application for a small device before you
begin coding. Correcting the code because you failed to consider all of the "gotchas" before
developing the application can be a painful process. Here are some design strategies to consider:
* Keep it simple. Remove unnecessary features, possibly making those features a separate,
secondary application.
* Smaller is better. This consideration should be a "no brainer" for all developers. Smaller
applications use less memory on the device and require shorter installation times. Consider
packaging your Java applications as compressed Java Archive (jar) files.
* Minimize run-time memory use. To minimize the amount of memory used at run time, use
scalar types in place of object types. Also, do not depend on the garbage collector. You should
manage the memory efficiently yourself by setting object references to null when you are
finished with them. Another way to reduce run-time memory is to use lazy instantiation, only
allocating objects on an as-needed basis. Other ways of reducing overall and peak memory use
on small devices are to release resources quickly, reuse objects, and avoid exceptions.
4. Configurations overview
The configuration defines the basic run-time environment as a set of core classes and a specific
JVM that run on specific types of devices. Currently, two configurations exist for J2ME, though
others may be defined in the future:
* Connected Limited Device Configuration (CLDC) is used specifically with the KVM for
16-bit or 32-bit devices with limited amounts of memory. This is the configuration (and the
virtual machine) used for developing small J2ME applications. Its size limitations make CLDC
more interesting and challenging (from a development point of view) than CDC. CLDC is also
the configuration that we will use for developing our drawing tool application. An example of
a small wireless device running small applications is a Palm hand-held computer.
* Connected Device Configuration (CDC) is used with the C virtual machine (CVM) and is
used for 32-bit architectures requiring more than 2 MB of memory. An example of such a device
is a Net TV box.
5. J2ME profiles
As we mentioned earlier in this tutorial, a profile defines the type of device supported. The
Mobile Information Device Profile (MIDP), for example, defines classes for cellular phones. It
adds domain-specific classes to the J2ME configuration to define uses for similar devices. Two
profiles have been defined for J2ME and are built upon CLDC: KJava and MIDP. Both KJava
and MIDP are associated with CLDC and smaller devices. Profiles are built on top of
configurations. Because profiles are specific to the size of the device (amount of memory) on
which an application runs, certain profiles are associated with certain configurations.
A skeleton profile upon which you can create your own profile, the Foundation Profile, is
available for CDC.
Profile 1: KJava
KJava is Sun's proprietary profile and contains the KJava API. The KJava profile is built on top
of the CLDC configuration. The KJava virtual machine, KVM, accepts the same byte codes
and class file format as the classic J2SE virtual machine. KJava contains a Sun-specific API
that runs on the Palm OS. The KJava API has a great deal in common with the J2SE Abstract
Windowing Toolkit (AWT). However, because it is not a standard J2ME package, its main
package is com.sun.kjava. We'll learn more about the KJava API later in this tutorial when we
develop some sample applications.
Profile 2: MIDP
MIDP is geared toward mobile devices such as cellular phones and pagers. The MIDP, like
KJava, is built upon CLDC and provides a standard run-time environment that allows new
applications and services to be deployed dynamically on end user devices. MIDP is a common,
industry-standard profile for mobile devices that is not dependent on a specific vendor. It is a
complete and supported foundation for mobile application
development. MIDP contains the following packages, the first three of which are core CLDC
packages, plus three MIDP-specific packages.
* java.lang
* java.io
* java.util
* javax.microedition.io
* javax.microedition.lcdui
* javax.microedition.midlet
* javax.microedition.rms
MYSQL:
What is a Database?
A database is a separate application that stores a collection of data. Each database has one or
more distinct APIs for creating, accessing, managing, searching and replicating the data it
holds.
Other kinds of data stores can also be used, such as files on the file system or large hash tables
in memory, but data fetching and writing would not be so fast and easy with those type of
systems.
Nowadays, we use relational database management systems (RDBMS) to store and manage
huge volume of data. This is called relational database because all the data is stored into
different tables and relations are established using primary keys or other keys known as Foreign
Keys.
RDBMS Terminology
Before we proceed to explain the MySQL database system, let us revise a few definitions
related to the database.
MySQL Database
MySQL is a fast, easy-to-use RDBMS being used for many small and big businesses. MySQL
is developed, marketed and supported by MySQL AB, which is a Swedish company. MySQL
is becoming so popular because of many good reasons:
❖ MySQL is released under an open-source license. So you have nothing to pay to use it.
❖ MySQL is a very powerful program in its own right. It handles a large subset of the
functionality of the most expensive and powerful database packages.
❖ MySQL uses a standard form of the well-known SQL data language.
❖ MySQL works on many operating systems and with many languages including HP,
PERL, C, C++, JAVA, etc.
❖ MySQL works very quickly and works well even with large data sets.
❖ MySQL is very friendly to PHP, the most appreciated language for web development.
❖ MySQL supports large databases, up to 50 million rows or more in a table. The default
file size limit for a table is 4GB, but you can increase this (if your operating system can
handle it) to a theoretical limit of 8 million terabytes (TB).
❖ MySQL is customizable. The open-source GPL license allows programmers to modify
the MySQL software to fit their own specific environments.
MYSQL Introduction:
MySQL (pronounced “My Ess Cue Ell”) is more than just “the world’s most popular open
source database,” as the developers at the MySQL AB corporation (http://www.mysql.com)
claim. This modest-sized database has introduced millions of everyday computer users and
amateur researchers to the world of powerful information systems. MySQL is a relatively recent
entrant into the well-established area of relational database management systems (RDBMs), a
concept invented by IBM researcher Edgar Frank Codd in 1970. Despite the arrival of newer
types of data repositories over the past 35 years, relational databases remain the workhorses of
the information world. They permit users to represent sophisticated relationships between items
of data and to calculate these relationships with the speed needed to make decisions in modern
organizations. It’s impressive how you can go from design to implementation in just a few
hours, and how easily you can develop web applications to access terabytes of data and serve
thousands of web users per second. Whether you’re offering products on a web site, conducting
a scientific survey, or simply trying to provide useful data to your classroom, bike club, or
religious organization, MySQL gets you started quickly and lets you scale up your services
comfortably over time. Its ease of installation and use led media analyst Clay Shirky to credit
MySQL with driving a whole new type of information system he calls “situated software”—
custom software that can be easily designed and built for niche applications. In this book, we
provide detailed instructions to help you set up MySQL and related software. We’ll teach you
Structured Query Language (SQL), which is used to insert, retrieve, and manipulate data. We’ll
also provide a tutorial on database design, explain how to configure MySQL for improved
security, and offer you advanced hints on getting even more out of your data. In the last five
chapters, we show how to interact with the database using the PHP and Perl programming
languages, and how to allow interaction with your data over the medium most people prefer
these days: the Web.
The MySQL development process focuses on offering a very efficient implementation of the
features most people need. This means that MySQL still has fewer features than its chief open
source competitor, PostgreSQL, or the commercial database engines. Nevertheless, the skills
you get from this book will serve you well on any platform. Many database management
systems—even open source ones—preceded MySQL. Why has MySQL been the choice for so
many beginners and small sites, and now for some heavyweight database users in government
and industry? We can suggest a few factors:
MySQL can run on very modest hardware and puts very little strain on system resources; many
small users serve up information to their organizations by running MySQL on modest desktop
systems. The speed with which it can retrieve information has made it a longstanding favorite
of web administrators. Over the past few years, MySQL AB has addressed the need of larger
sites by adding features that necessarily slow down retrieval, but its modular design lets you
ignore the advanced features and maintain the suppleness and speed for which MySQL is
famous.
Ease of installation
Partly because MySQL is small and fast, it works the way most people want straight “out of
the box.” It can be installed without a lot of difficult and sophisticated configuration. Now that
many Linux distributions include MySQL, installation can be almost automatic.
Responsiveness to community
With a few hundred employees scattered around the globe, MySQL AB is a very flexible
organization that keeps constant tabs on user needs. At its conferences, lead developers get out
in front and make themselves available to everyone with a gripe or a new idea. There are also
local MySQL user groups in almost every major city. This responsiveness is helped by the fact
that MySQL is open and free; any sufficiently skilled programmer can look at the program code
to find and perhaps help in fixing problems.
MySQL actually has a dual-license approach: if you want to build your own product around it,
you pay MySQL AB a license fee. If you just want to use MySQL to serve your own data, you
don’t have to pay the license fee. MySQL also offers technical support, as do numerous other
companies and consultants, some of them probably near you.
It is easy to use MySQL as part of a larger software system. For example, you can write
programs that can interact directly with a MySQL database. Most major programming
languages have libraries of functions for use with MySQL; these include C, PHP, Perl, Python,
Ruby, and the Microsoft .NET languages. MySQL also supports the Open Database
Connectivity (ODBC) standard, making it accessible even when MySQL-specific functionality
isn’t available.
MODULES DESCSRIPTION:
❖ This module is dedicated to the registration of students or certificate holders within the
system. The "Student Registration and Authentication Module" is a pivotal component
of the "Certificate Authentication System using QR Code." This module is responsible
for managing the registration of students or certificate holders, ensuring that only
legitimate users gain access to the system.
❖ The registration process allows students to create accounts within the system by
providing essential personal details. This information is collected to establish the user's
identity and facilitate communication. Registration is the first step toward accessing
certificate services. Input Data such as: Roll Number, Year, Department, Photo (Image
Upload), Name, Email ID, Phone Number, Address and Password should be given
during the registration of student.
❖ Following successful registration, students are not granted immediate access to the
system. Instead, their registration requests are placed in a pending state, awaiting
approval from the system administrator. This approval step serves as a crucial security
measure to prevent unauthorized access. The administrator reviews the pending
registration requests. The admin can approve or reject registration requests based on the
authenticity of the provided information. Once the admin approves a student's
registration, the student gains access to the system. Authentication is required to ensure
that only authorized users can log in.
❖ Security is paramount in this module to prevent unauthorized access and protect user
data. Various security measures are implemented to safeguard the system. The "Student
Registration and Authentication Module" ensures a stringent verification process to
safeguard the system's integrity. By implementing admin approval and robust security
measures, the module enhances the overall security and trustworthiness of the certificate
authentication system while providing a seamless registration experience for legitimate
users.
❖ This module facilitates the request and issuance of certificates. Users can submit
requests for various types of certificates, such as Bonafide Certificates, Transfer
Certificates, or Course Completion Certificates. Upon verification, the requested
certificates are generated and made available for download or printing. The "Certificate
Request Module" is a crucial component of the "Certificate Authentication System
using QR Code." This module facilitates the seamless request and processing of various
types of certificates by authenticated students.
❖ Once a student is logged into the system, they can initiate a certificate request. The
module streamlines the request process, minimizing data entry for students as their basic
details (Roll number, Department, Year) are pre-populated from the database. The
primary purpose is to enable students to select the specific type of certificate they
require. Type of Certificate (e.g., Bonafide, Transfer Certificate, Course Completion
Certificate). Roll number, department, and year fields are auto-populated based on the
student's profile data. Students choose the type of certificate they need from available
options. Students submit their certificate request.
❖ After submitting a certificate request, students can track the status of their request. The
module provides transparency in the request processing lifecycle, allowing students to
monitor progress. Students can view the status of their certificate requests (e.g.,
Pending, Approved, Rejected).
❖ Certificate requests made by students are not immediately granted. Admin approval is
required to ensure the legitimacy of the request. The admin reviews the request details
and decides whether to approve or reject it. Upon admin approval, the system generates
the requested certificate with the necessary details. The certificate is prepared in a
format suitable for printing or download.
Admin Module
❖ The Admin Module is designed for system administrators who oversee and manage the
entire certificate authentication system. The "Admin Module" is a central component of
the "Certificate Authentication System using QR Code." It is designed to empower
system administrators with tools and functionalities to efficiently manage the system,
oversee student registrations, review certificate requests, and maintain system settings.
❖ The admin has the capability to define and manage the college's name and logo. This
information is essential as it is displayed on the generated certificates, enhancing the
certificates' credibility and authenticity. Admin can upload the college's official logo.
Admin can enter or update the college's name.
❖ Admin has the option of Student Approval, where the pending student registrations
await admin approval. The admin is responsible for verifying the authenticity of student
registration requests and deciding whether to approve or reject them. After approval,
the student's registration status is updated in the system.
❖ Admin has the option of Student details, where the admin can view with a
comprehensive view of all registered students' details. It serves as a central repository
of student information.
❖ Admin has the option of Certificate Request, where the admin can oversee and manage
student-initiated certificate requests. The admin reviews these requests to determine
their validity and authenticity. Admin can access a list of pending certificate requests
made by students. After approval, the request status is updated, and certificate
generation is initiated.
❖ Admin has the option of All Request details, which provides an overview of the status
of all certificate requests within the system. It serves as a comprehensive tracking and
reporting tool for the admin. The "Admin Module" ensures efficient management of
student registrations, certificate requests, and system settings. It empowers the
administrator to maintain data accuracy, verify authenticity, and oversee the certificate
issuance process, contributing to the overall security and reliability of the certificate
authentication system.
❖ This critical module handles the verification of certificates using QR codes. The "QR
Code Verification Module" is a critical component of the "Certificate Authentication
System using QR Code." This module is designed to empower verifiers to quickly and
accurately authenticate certificates by scanning QR codes.
❖ To access the QR Code Verification Module, verifiers must log in to the system using
their credentials. This step ensures that only authorized personnel can perform
certificate verification. After successful login, verifiers can initiate the QR code
scanning process. This involves activating their device's webcam to scan the QR code
on a certificate. Verifiers position the QR code within the webcam's viewfinder and
initiate the scanning process.
❖ Once the QR code is scanned, the module validates the QR code to determine its
authenticity. The validation process checks if the QR code corresponds to a genuine
certificate in the system's database. The module compares the QR code data with the
stored certificate information to verify authenticity. If the QR code is valid, the system
displays the certificate details, including the certificate holder's name and information,
along with an "Authentic" label. If the QR code is not valid (e.g., expired, tampered
with, or non-existent in the database), the system displays an "Invalid QR Code"
message.
/**
*
* @author NARESH
*/
public class QRReader {
new BufferedImageLuminanceSource(
ImageIO.read(
new FileInputStream(path)))));
Result result
= new MultiFormatReader().decode(binaryBitmap);
return result.getText();
}
}
QR Genarator.
package CertificateAuth.QRCode;
import java.io.File;
import java.io.IOException;
import java.util.Map;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.WriterException;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
/**
*
* @author NARESH
*/
public class QRGen {
MatrixToImageWriter.writeToFile(
matrix,
path.substring(path.lastIndexOf('.') + 1),
new File(path));
}
}
SQL Connection
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package CertificateAuth.Database;
import java.sql.Connection;
import java.sql.DriverManager;
/**
*
* @author Beast
*/
public class SQLconnection {
/**
*
* @return
*/
public static Connection getconnection() {
try {
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/certauth", "root",
"root");
} catch (Exception e) {
}
return con;
}
}
Verifier Log .
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package CertificateAuth;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author NARESH
*/
public class VerifierLog extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
/* TODO output your page here. You may use following sample code. */
String name = request.getParameter("name");
String pass = request.getParameter("pass");
System.out.println("===============================================
===============================");
if (name.equals("Verifier") && pass.equals("Verifier")) {
response.sendRedirect("VerifierHome.jsp?Success");
} else {
response.sendRedirect("Verifier.jsp?Failed");
}
} catch (Exception ex) {
}
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
Student register.java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package CertificateAuth;
import CertificateAuth.Database.SQLconnection;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Part;
/**
*
* @author NARESH
*/
@MultipartConfig(maxFileSize = 16177215)
public class StudentRegister extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
/* TODO output your page here. You may use following sample code. */
String name = request.getParameter("name");
String mail = request.getParameter("email");
String pass = request.getParameter("pass");
String phone = request.getParameter("phone");
String address = request.getParameter("address");
String Rollno = request.getParameter("rollno");
String syear = request.getParameter("Year");
String dept = request.getParameter("Department");
Part filePart = request.getPart("pphoto");
InputStream inputStream = null;
if (filePart != null) {
System.out.println(filePart.getName());
System.out.println(filePart.getSize());
System.out.println(filePart.getContentType());
inputStream = filePart.getInputStream();
}
System.out.println("pass------------>> :" + pass);
count++;
}
if (count > 0) {
response.sendRedirect("Students.jsp?mailid");
} else {
try {
conn = SQLconnection.getconnection();
String sql = "INSERT INTO students (name, email, phone, address, pass, ustatus,
regtime, lastlog,ppic,rollno,syear,dept) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?)";
PreparedStatement statement = conn.prepareStatement(sql);
statement.setString(1, name);
statement.setString(2, mail);
statement.setString(3, phone);
statement.setString(4, address);
statement.setString(5, pass);
statement.setString(6, "No");
statement.setString(7, time);
statement.setString(8, "No");
if (inputStream != null) {
statement.setBlob(9, inputStream);
}
statement.setString(10, Rollno);
statement.setString(11, syear);
statement.setString(12, dept);
int row = statement.executeUpdate();
if (row > 0) {
System.out.println("success");
response.sendRedirect("Students.jsp?Success");
} else {
System.out.println("Students.jsp?failed");
}
rs.close();
conn.close();
st.close();
st1.close();
} catch (Exception ex) {
ex.printStackTrace();
}
}
} catch (SQLException ex) {
Logger.getLogger(StudentRegister.class.getName()).log(Level.SEVERE, null, ex);
}
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
Student Request.java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package CertificateAuth;
import CertificateAuth.Database.SQLconnection;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author NARESH
*/
public class StudentApproval extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
/* TODO output your page here. You may use following sample code. */
String uid = request.getParameter("uid");
Statement st = null;
Connection conn = SQLconnection.getconnection();
Statement sto = conn.createStatement();
st = conn.createStatement();
try {
int i = sto.executeUpdate("update students set ustatus='Active' where id='" + uid +
"'");
System.out.println("test print==" + uid);
if (i != 0) {
ResultSet rs = st.executeQuery(" SELECT * from students where id = '" + uid +
"' ");
if (rs.next()) {
String email = rs.getString("email");
response.sendRedirect("StudentApproval.jsp?Granted");
} else {
System.out.println("failed");
response.sendRedirect("StudentApproval.jsp?Failed");
}
}
} catch (SQLException ex) {
}
} catch (SQLException ex) {
Logger.getLogger(StudentApproval.class.getName()).log(Level.SEVERE, null, ex);
}
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
Certificate Request.java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package CertificateAuth;
import CertificateAuth.Database.SQLconnection;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author NARESH
*/
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
/* TODO output your page here. You may use following sample code. */
String year = request.getParameter("syear");
insertStatement.executeUpdate();
insertStatement.close();
connection.close();
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
Certificate Approval.java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package CertificateAuth;
import CertificateAuth.Database.SQLconnection;
import static CertificateAuth.QRCode.QRGen.createQR;
import com.google.zxing.EncodeHintType;
import com.google.zxing.WriterException;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.security.SecureRandom;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author NARESH
*/
public class CertApprove extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
/* TODO output your page here. You may use following sample code. */
String reqid = request.getParameter("reqid");
String smail = request.getParameter("smail");
String path = "D://CertificateAuth";
if (created) {
System.out.println("Folder was created !");
} else {
System.out.println("Unable to create folder");
}
try {
int i = sto.executeUpdate("update certrequests set certstatus='Approved' where id='"
+ reqid + "'");
System.out.println("test print==" + reqid);
if (i != 0) {
Random RANDOM = new SecureRandom();
int PASSWORD_LENGTH = 10;
String letters = "378AIJKLM5CD4NOP126EFGHB9";
String cert_id1 = "";
for (int k = 0; k < PASSWORD_LENGTH; k++) {
int index = (int) (RANDOM.nextDouble() * letters.length());
cert_id1 += letters.substring(index, index + 1);
}
String cert_id = cert_id1;
// Encoding charset
String charset = "UTF-8";
hashMap.put(EncodeHintType.ERROR_CORRECTION,
ErrorCorrectionLevel.L);
preparedStatement.setBytes(1, imageData);
preparedStatement.setString(2, cert_id);
preparedStatement.setString(3, reqid);
preparedStatement.executeUpdate();
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
Certificate Approval.java/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package CertificateAuth;
import CertificateAuth.Database.SQLconnection;
import static CertificateAuth.QRCode.QRGen.createQR;
import com.google.zxing.EncodeHintType;
import com.google.zxing.WriterException;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.security.SecureRandom;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author NARESH
*/
public class CertApprove extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
/* TODO output your page here. You may use following sample code. */
if (created) {
System.out.println("Folder was created !");
} else {
System.out.println("Unable to create folder");
}
try {
int i = sto.executeUpdate("update certrequests set certstatus='Approved' where id='"
+ reqid + "'");
System.out.println("test print==" + reqid);
if (i != 0) {
Random RANDOM = new SecureRandom();
int PASSWORD_LENGTH = 10;
String letters = "378AIJKLM5CD4NOP126EFGHB9";
String cert_id1 = "";
for (int k = 0; k < PASSWORD_LENGTH; k++) {
int index = (int) (RANDOM.nextDouble() * letters.length());
cert_id1 += letters.substring(index, index + 1);
}
// Encoding charset
String charset = "UTF-8";
hashMap.put(EncodeHintType.ERROR_CORRECTION,
ErrorCorrectionLevel.L);
preparedStatement.setBytes(1, imageData);
preparedStatement.setString(2, cert_id);
preparedStatement.setString(3, reqid);
preparedStatement.executeUpdate();
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";}
CHAPTER-5
Testing
5.1 Testing Plan
System testing is a critical phase in the software development life cycle that focuses on
assessing the overall quality, functionality, and performance of a software system. It is a
comprehensive and systematic process that aims to identify defects, ensure that the system
meets specified requirements, and verify its readiness for deployment. System testing plays a
crucial role in delivering reliable, robust, and high-quality software solutions.
System testing serves as the final gatekeeper before a software system is released to users. It
helps identify and rectify defects, glitches, and inconsistencies that might have gone unnoticed
during earlier testing phases. By rigorously testing the complete system, organizations can
ensure that the software behaves as intended, performs well under various conditions, and meets
user expectations.
The purpose of testing is to discover errors. Testing is the process of trying to discover every
conceivable fault or weakness in a work product. It provides a way to check the functionality
of components, sub- assemblies, assemblies and/or a finished product. It is the process of
exercising software with the intent of ensuring that the Software system meets its requirements
and user expectations and does not fail in an unacceptable manner. There are various types of
test. Each test type addresses a specific testing requirement.
Unit testing
Unit testing involves the design of test cases that validate that the internal program logic is
functioning properly, and that program inputs produce valid outputs. All decision branches and
internal code flow should be validated. It is the testing of individual software units of the
application .it is done after the completion of an individual unit before integration. This is a
structural testing, that relies on knowledge of its construction and is invasive. Unit tests perform
basic tests at component level and test a specific business process, application, and/or system
configuration. Unit tests ensure that each unique path of a business process performs accurately
to the documented specifications and contains clearly defined inputs and expected results.
Unit testing focuses on verifying the correctness of code at its smallest functional level. By
isolating and testing individual units, developers can identify issues early in the development
process, preventing defects from propagating through the entire application. This practice
promotes better code quality, enhances software reliability, and simplifies the process of
identifying and fixing defects.
Integration testing
Integration tests are designed to test integrated software components to determine if
they actually run as one program. Testing is event driven and is more concerned with the basic
outcome of screens or fields. Integration tests demonstrate that although the components were
individually satisfaction, as shown by successfully unit testing, the combination of components
is correct and consistent. Integration testing is specifically aimed at exposing the problems
that arise from the combination of components.
Integration testing is a critical phase in the software development lifecycle that focuses
on testing the interactions and collaborations between different components or modules of a
software application. This testing phase ensures that the integrated system functions as a
cohesive whole, with various parts working seamlessly together. Integration testing identifies
and resolves issues related to data exchange, communication, and inter-component
dependencies.
Integration testing addresses the question: Do the different components of the software
work together harmoniously? This phase verifies that the individual units, which have already
been tested independently, can successfully collaborate and produce the desired outcomes when
combined.
Functional test
Functional tests provide systematic demonstrations that functions tested are available
as specified by the business and technical requirements, system documentation, and user
manuals.
Functional testing addresses the question: Does the software behave as expected? This
testing phase helps ensure that the application's functionalities are reliable, accurate, and meet
the defined business or user requirements. By validating that the software performs its intended
tasks correctly, functional testing contributes to delivering a high-quality and user-friendly
application.
Functional testing is a fundamental aspect of software quality assurance that ensures the
software's features and functionalities work as intended. By validating requirements, behaviors,
and user interactions, functional testing provides insights into the software's reliability and
alignment with user expectations. A successful functional testing phase contributes to
delivering a functional, user-friendly, and high-quality application that meets both business
goals and end-user needs.
System Test System testing ensures that the entire integrated software system meets
requirements. It tests a configuration to ensure known and predictable results. An example of
system testing is the configuration oriented system integration test. System testing is based on
process descriptions and flows, emphasizing pre-driven process links and integration points.
White Box TestingWhite Box Testing is a testing in which in which the software tester
has knowledge of the inner workings, structure and language of the software, or at least its
purpose. It is purpose. It is used to test areas that cannot be reached from a black box level.
White box testing, also known as structural testing or clear box testing, is a testing methodology
that focuses on examining the internal logic, structure, and code implementation of a software
application. Unlike black box testing that evaluates software functionalities from an external
perspective, white box testing delves into the underlying code to ensure that all aspects of the
codebase, including branches, conditions, loops, and data flows, are thoroughly tested. This
methodology aims to uncover defects, vulnerabilities, and potential optimizations within the
code.
White box testing addresses the question: Does the code behave as expected based on its
internal structure? This testing approach is particularly useful for identifying issues that might
not be apparent through external testing methods and for ensuring that code paths and decision
points are adequately tested.
Code Coverage:White box testing aims to achieve high code coverage by testing all possible
paths, branches, and conditions within the code. This ensures that all logical scenarios are
tested, increasing the likelihood of identifying defects.
Error Detection:By analyzing the code's internal logic, white box testing identifies issues such
as incorrect calculations, logical errors, syntax errors, and issues related to variables and data
manipulation.
Security Assessment:White box testing can uncover security vulnerabilities that might be
exploited by attackers. It helps identify potential weaknesses in code, such as inadequate input
validation or improper handling of sensitive data.
Performance Optimization:Through code analysis, white box testing can identify bottlenecks
and inefficient code segments that impact the application's performance. This information helps
in optimizing code for better efficiency.
Black Box Testing is testing the software without any knowledge of the inner workings,
structure or language of the module being tested. Black box tests, as most other kinds of tests,
must be written from a definitive source document, such as specification or requirements
document, such as specification or requirements document. It is a testing in which the software
under test is treated, as a black box .you cannot “see” into it. The test provides inputs and
responds to outputs without considering how the software works.
Black box testing is a testing methodology that focuses on evaluating the functionality of a
software application without examining its internal code, structure, or implementation details.
Instead, this approach treats the software as a "black box," where the tester interacts with the
application's inputs and examines its outputs to assess whether the desired functionalities work
as expected. Black box testing emphasizes validating the software's behavior based on user
specifications, requirements, and expected outcomes.
Black box testing addresses the question: Does the software behave as expected from an end-
user perspective? This methodology ensures that the software meets user requirements,
functions correctly, and delivers the intended outcomes without requiring knowledge of its
internal workings.
Unit Testing:
Unit testing is usually conducted as part of a combined code and unit test phase of the
software lifecycle, although it is not uncommon for coding and unit testing to be conducted as
two distinct phases.
Importance of Unit Testing:Unit testing addresses the question: Does each unit of code perform
as expected on its own? This testing approach is essential for catching bugs early in the
development process, isolating defects to specific units, and ensuring that individual
components function correctly before they are integrated into the larger system.
Features to be tested
• Verify that the entries are of the correct format
• No duplicate entries should be allowed
• All links should take the user to the correct page.
• Integration Testing
Software integration testing is the incremental integration testing of two or more
integrated software components on a single platform to produce failures caused by interface
defects.The task of the integration test is to check that components or software applications,
e.g. components in a software system or – one step up – software applications at the company
level – interact without error.
Test Results: All the test cases mentioned above passed successfully. No defects encountered.
Acceptance TestingUser Acceptance Testing is a critical phase of any project and requires
significant participation by the end user. It also ensures that the system meets the functional
requirements.
Test Results: All the test cases mentioned above passed successfully. No defects encountered.
5.2Testing Methods
1. Unit Testing:
• Purpose: Verify the correctness of individual code components.
• Techniques: JUnit or TestNG for Java.
• Tests:
• QR code generation and parsing.
• Cryptographic operations for certificate validation.
• Input validation and error handling in Java code.
2. Integration Testing:
• Purpose: Test interactions between various system components.
• Techniques: Manual testing, as well as automated testing with JUnit or TestNG.
• Tests:
• Integration with the database for certificate storage and retrieval.
• Integration with external services or APIs used for authentication.
3. Functional Testing:
• Purpose: Validate that the system meets its functional requirements.
• Techniques: Manual testing and automated testing with Selenium or other
testing frameworks for web applications.
• Tests:
• User authentication using QR codes.
• Certificate issuance and revocation.
• User access control and authorization.
4. Security Testing:
• Purpose: Identify and mitigate security vulnerabilities.
• Techniques:
• Manual security testing (ethical hacking).
• Automated security testing tools like OWASP ZAP.
• Tests:
• Verify that QR code data is securely transmitted and stored.
• Test for common vulnerabilities like SQL injection and Cross-Site
Scripting (XSS) in Java code.
5. Usability Testing:
• Purpose: Ensure the system is user-friendly.
• Techniques: Usability testing by real users and stakeholders.
• Tests:
• Validate the user experience during QR code authentication.
• Gather user feedback on the system's ease of use.
6. Performance Testing:
• Purpose: Evaluate system performance under different loads.
• Techniques: Tools like Apache JMeter for load testing.
• Tests:
• Test system performance under normal load.
• Assess system behavior under heavy load.
• Ensure the system can scale to handle increased traffic.
7. Regression Testing:
• Purpose: Ensure that new changes do not break existing functionality.
• Techniques: Automated testing using regression test suites with JUnit or
TestNG.
• Tests:
• Rerun existing test cases after each code change to verify that existing
functionality is not disrupted.
8. Compatibility Testing:
• Purpose: Verify that the system works correctly across various platforms.
• Techniques: Manual testing.
• Tests:
• Ensure compatibility with different web browsers (e.g., Chrome,
Firefox, Safari).
• Verify compatibility with various operating systems (Windows, macOS,
Linux).
9. Deployment Testing:
• Purpose: Ensure a smooth deployment process.
• Techniques: Manual and automated testing.
• Tests:
• Test the installation and configuration of the system in different
environments (development, staging, production) in a Java-based
environment.
10. Post-Release Monitoring:
• Purpose: Continuously monitor the system in the production environment.
• Techniques:
• Log analysis and monitoring tools.
• User feedback channels.
• Tests:
• Monitor system performance and security in the live environment.
• Address any issues that arise promptly.
CHAPTER-6
Screenshots
CHAPTER-8
Limitations and Future Enhancements
Limitations:
1. Security Concerns: QR codes are susceptible to various security risks, including
interception and tampering. Strong encryption and secure transmission protocols must
be used to mitigate these risks.
2. Dependency on QR Code: If the QR code itself is compromised or the device used to
scan it is untrusted, the security of the certificate authentication system can be
compromised.
3. QR Code Legibility: The legibility of QR codes can be affected by factors such as low-
quality printing, damage, or poor lighting conditions, leading to authentication failures.
4. Certificate Management: Managing certificates, especially in a large-scale
environment, can be complex. There is a need for efficient certificate lifecycle
management and revocation mechanisms.
5. Offline Authentication: QR code-based authentication may not work when offline.
Implementing offline authentication mechanisms is essential in some scenarios.
6. User Experience: Scanning QR codes might not provide the best user experience,
especially for users with visual impairments or in situations where manual entry is
required.
Future Enhancements:
1. Biometric Authentication: Integration with biometric authentication methods
(fingerprint, facial recognition) can enhance security and user experience.
2. Multi-Factor Authentication (MFA): Adding MFA as an option can further secure the
authentication process, combining something you know (the certificate) with something
you have (a mobile device) or something you are (biometrics).
3. Blockchain Integration: Utilizing blockchain technology can enhance the trust and
transparency of certificate issuance and verification.
4. Dynamic QR Codes: Implementing dynamic QR codes that change regularly can
enhance security and prevent replay attacks.
5. Secure Element Integration: Using secure elements in mobile devices or hardware
tokens for certificate storage can improve security.
6. Machine Learning for Threat Detection: Implementing machine learning algorithms for
real-time threat detection and anomaly identification can enhance security.
7. Standardization: Encouraging the adoption of QR code standards for certificate
encoding and data format can improve interoperability.
CHAPTER-8
Conclusion & Discussion
The "Certificate Authentication System using QR Code" represents a significant advancement
in modernizing the process of certificate verification and authentication. This innovative project
addresses the challenges posed by traditional, manual systems and introduces a streamlined,
efficient, and secure approach to certifying academic credentials. By implementing a series of
well-designed modules, including Student Registration and Authentication, Certificate
Request, Admin Management, and QR Code Verification, this system offers a comprehensive
solution for both certificate holders and verifiers. It ensures the authenticity of certificates while
significantly reducing the time and effort required for verification. The project leverages
cutting-edge technologies such as QR codes, Java, and MySQL to create a user-friendly
interface for students, administrators, and verifiers alike. It enhances security, accessibility, and
efficiency, making it an invaluable tool in today's competitive job and education landscape.
With the ability to generate various types of certificates, automate communication, and provide
real-time updates, this system caters to the diverse needs of educational institutions, employers,
and certificate holders. It significantly reduces the risk of certificate fraud, improves decision-
making for employers and institutions, and contributes to a more reliable certification
ecosystem. In conclusion, the "Certificate Authentication System using QR Code" project is a
testament to the potential of technology in revolutionizing traditional processes. By offering a
secure and efficient means of certificate authentication, this system not only safeguards the
integrity of academic credentials but also streamlines administrative tasks, ultimately
benefiting both educational institutions and individuals seeking to verify their qualifications. It
is a step forward in ensuring the trustworthiness of certificates and promoting a more
transparent and reliable credential verification process.
FUTURE WORK:
While the "Certificate Authentication System using QR Code" project represents a significant
advancement in certificate authentication, there are several avenues for future work and
enhancements to further improve the system's functionality, security, and usability. Some
potential areas of future development include:
Integration with Blockchain Technology: Exploring the integration of blockchain technology
to enhance the security and immutability of certificate records. Blockchain can provide a
tamper-proof ledger for storing certificates, ensuring their long-term integrity.
Enhanced Mobile Application: Developing a dedicated mobile application for both students
and verifiers, allowing for more convenient access to certificate requests and verifications using
smartphones.
Machine Learning for Fraud Detection: Implementing machine learning algorithms to detect
and prevent fraudulent certificate submissions or tampered QR codes. This can add an
additional layer of security to the system.
Multi-Language Support: Expanding the system to support multiple languages to cater to a
diverse user base, including international users.
Improved Analytics and Reporting: Enhancing the reporting and analytics capabilities of the
system to provide insights into certificate verification trends, user activity, and system
performance.
Integration with Academic Institutions: Collaborating with educational institutions to enable
direct integration with their student databases, streamlining the student registration and
authentication process.
Mobile Wallet Integration: Exploring the integration of mobile wallet applications to store and
manage digital certificates securely.
User Feedback and Usability Testing: Continuously gathering feedback from users to identify
areas for improvement and refine the user interface and overall user experience.
Enhanced Data Privacy: Implementing advanced data privacy measures to comply with
evolving data protection regulations, such as GDPR or CCPA, to protect user information.
Scalability and Performance Optimization: Ensuring that the system can handle increased user
loads and optimizing its performance to accommodate a growing user base.
Accessibility Compliance: Ensuring that the system complies with accessibility standards,
making it usable for individuals with disabilities.
Cybersecurity Audits: Conducting regular cybersecurity audits and penetration testing to
identify and mitigate potential vulnerabilities in the system.
AI-Driven Certificate Matching: Utilizing artificial intelligence for automated matching of
scanned QR codes to the correct certificate records, further reducing human error.
Enhanced Certificate Templates: Offering customizable certificate templates to institutions for
a more personalized and professional appearance.
Collaboration with Certificate Authorities: Partnering with certificate authorities and industry
bodies to establish standards and best practices for digital certificate authentication.
These future work areas demonstrate the potential for ongoing development and improvement
of the "Certificate Authentication System using QR Code." By embracing emerging
technologies and responding to user feedback, the system can continue to evolve as a robust
and reliable solution for certificate verification in the digital age.
CHAPTER-9
REFERENCES
3. M. Singh and D. Garg, "Choosing best hashing strategies and hash functions," in
International Advance Computing Conference, 2009, pp. 50 – 55.