├── Database Dump └── cryptography.sql ├── Documentation └── Secure File Storage Using Hybrid Cryptography.pdf ├── README.md ├── build.xml ├── build └── web │ ├── META-INF │ ├── MANIFEST.MF │ └── context.xml │ ├── WEB-INF │ ├── classes │ │ ├── .netbeans_automatic_build │ │ ├── .netbeans_update_resources │ │ ├── connection │ │ │ ├── AES.class │ │ │ ├── AutoID.class │ │ │ ├── ECC.class │ │ │ ├── GenerateRandomString.class │ │ │ └── dbConnection.class │ │ └── org │ │ │ ├── AdminLogin.class │ │ │ ├── DecryptedKey.class │ │ │ ├── Decryption.class │ │ │ ├── EmailUtility$1.class │ │ │ ├── EmailUtility.class │ │ │ ├── Encryption.class │ │ │ ├── FirstLogin.class │ │ │ ├── GenerateOTP.class │ │ │ ├── KeyGeneration.class │ │ │ ├── Login.class │ │ │ ├── Logout.class │ │ │ ├── MyAccount.class │ │ │ └── Register.class │ ├── glassfish-web.xml │ └── lib │ │ ├── bcprov-1.45.jar │ │ ├── commons-fileupload-1.1.jar │ │ ├── commons-io-1.1.jar │ │ ├── fileupload-progress.jar │ │ ├── mail.jar │ │ └── mysql-connector-java-3.0.11-stable-bin.jar │ ├── adminlogin.jsp │ ├── css │ └── style.css │ ├── description.jsp │ ├── download.jsp │ ├── download_file.jsp │ ├── downloadfile.jsp │ ├── ecdh.jsp │ ├── encryption.jsp │ ├── filelist.jsp │ ├── footer.jsp │ ├── header.jsp │ ├── images │ ├── background.jpg │ ├── header_bg.jpg │ ├── header_bg1.png │ ├── rightside.gif │ └── user_login.jpg │ ├── index.jsp │ ├── jarfile │ ├── bcprov-1.45.jar │ ├── commons-fileupload-1.1.jar │ ├── commons-io-1.1.jar │ ├── fileupload-progress.jar │ ├── mail.jar │ └── mysql-connector-java-3.0.11-stable-bin.jar │ ├── js │ └── scw.js │ ├── keydescription.jsp │ ├── keyexchange.jsp │ ├── login.jsp │ ├── myaccount.jsp │ ├── register.jsp │ ├── secretkey.jsp │ ├── sucess_registration.jsp │ ├── uploads │ ├── downloads │ │ ├── f1588661499206.pdf │ │ ├── f1588663318402.pdf │ │ ├── f1592464238577.txt (1) │ │ └── f1592464238577.txt.aes │ ├── f1588661499206.pdf.aes │ ├── f1588663318402.pdf.aes │ ├── f1588664761805.png.aes │ └── f1592464238577.txt.aes │ └── usrelist.jsp ├── dist └── securecloud.war ├── nbproject ├── ant-deploy.xml ├── build-impl.xml ├── genfiles.properties ├── private │ ├── private.properties │ └── private.xml ├── project.properties └── project.xml ├── src ├── conf │ └── MANIFEST.MF └── java │ ├── connection │ ├── AES.java │ ├── AutoID.java │ ├── ECC.java │ ├── GenerateRandomString.java │ └── dbConnection.java │ └── org │ ├── AdminLogin.java │ ├── DecryptedKey.java │ ├── Decryption.java │ ├── EmailUtility.java │ ├── Encryption.java │ ├── FirstLogin.java │ ├── GenerateOTP.java │ ├── KeyGeneration.java │ ├── Login.java │ ├── Logout.java │ ├── MyAccount.java │ └── Register.java └── web ├── META-INF └── context.xml ├── WEB-INF └── glassfish-web.xml ├── adminlogin.jsp ├── css └── style.css ├── description.jsp ├── download.jsp ├── download_file.jsp ├── downloadfile.jsp ├── ecdh.jsp ├── encryption.jsp ├── filelist.jsp ├── footer.jsp ├── header.jsp ├── images ├── background.jpg ├── header_bg.jpg ├── header_bg1.png ├── rightside.gif └── user_login.jpg ├── index.jsp ├── jarfile ├── bcprov-1.45.jar ├── commons-fileupload-1.1.jar ├── commons-io-1.1.jar ├── fileupload-progress.jar ├── mail.jar └── mysql-connector-java-3.0.11-stable-bin.jar ├── js └── scw.js ├── keydescription.jsp ├── keyexchange.jsp ├── login.jsp ├── myaccount.jsp ├── register.jsp ├── secretkey.jsp ├── sucess_registration.jsp └── usrelist.jsp /Database Dump/cryptography.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 4.5.4.1deb2ubuntu2 3 | -- http://www.phpmyadmin.net 4 | -- 5 | -- Host: localhost 6 | -- Generation Time: Nov 12, 2016 at 08:01 PM 7 | -- Server version: 5.7.15-0ubuntu0.16.04.1 8 | -- PHP Version: 7.0.8-0ubuntu0.16.04.3 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | SET time_zone = "+00:00"; 12 | 13 | 14 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 15 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 16 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 17 | /*!40101 SET NAMES utf8mb4 */; 18 | 19 | -- 20 | -- Database: `eccypography` 21 | -- 22 | 23 | -- -------------------------------------------------------- 24 | 25 | -- 26 | -- Table structure for table `auto_id` 27 | -- 28 | 29 | CREATE TABLE `auto_id` ( 30 | `form_name` varchar(50) DEFAULT NULL, 31 | `prefix` varchar(100) DEFAULT NULL 32 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 33 | 34 | -- 35 | -- Dumping data for table `auto_id` 36 | -- 37 | 38 | INSERT INTO `auto_id` (`form_name`, `prefix`) VALUES 39 | ('registration', '100010'); 40 | 41 | -- -------------------------------------------------------- 42 | 43 | -- 44 | -- Table structure for table `files` 45 | -- 46 | 47 | CREATE TABLE `files` ( 48 | `id` bigint(20) NOT NULL, 49 | `userid` varchar(50) DEFAULT NULL, 50 | `file_name` varchar(100) DEFAULT NULL, 51 | `file_path` varchar(255) DEFAULT NULL, 52 | `created` datetime DEFAULT NULL, 53 | `f_status` char(1) DEFAULT '1', 54 | `encrypted_aes_key` varchar(255) DEFAULT NULL, 55 | `publickey` varchar(255) DEFAULT NULL, 56 | `privatekey` varchar(255) DEFAULT NULL 57 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 58 | 59 | -- 60 | -- Dumping data for table `files` 61 | -- 62 | 63 | INSERT INTO `files` (`id`, `userid`, `file_name`, `file_path`, `created`, `f_status`, `encrypted_aes_key`, `publickey`, `privatekey`) VALUES 64 | (2, '100010', 'h.txt', 'uploads/f1478979701016.txt.aes', '2016-11-12 19:41:41', '1', '4C3330534A5636534E5448374B43464E', NULL, '1C18580EFC2443B3F7C454D281387'); 65 | 66 | -- -------------------------------------------------------- 67 | 68 | -- 69 | -- Table structure for table `users` 70 | -- 71 | 72 | CREATE TABLE `users` ( 73 | `userid` varchar(20) NOT NULL, 74 | `gen_user_id` varchar(200) DEFAULT NULL, 75 | `name` varchar(100) NOT NULL, 76 | `email` varchar(100) DEFAULT NULL, 77 | `mobile` varchar(20) DEFAULT NULL, 78 | `dob` varchar(100) DEFAULT NULL, 79 | `gender` varchar(50) DEFAULT NULL, 80 | `user_key` varchar(50) DEFAULT NULL, 81 | `secretu` varchar(200) DEFAULT NULL, 82 | `user_otp` varchar(10) DEFAULT NULL, 83 | `utype` varchar(20) DEFAULT 'user', 84 | `u_status` char(1) DEFAULT '1', 85 | `created` datetime DEFAULT NULL 86 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 87 | 88 | -- 89 | -- Dumping data for table `users` 90 | -- 91 | 92 | INSERT INTO `users` (`userid`, `gen_user_id`, `name`, `email`, `mobile`, `dob`, `gender`, `user_key`, `secretu`, `user_otp`, `utype`, `u_status`, `created`) VALUES 93 | ('100010', '908589175481035665712', 'Varun Dhall', 'varun.vd1994@gmail.com', '8868838028', '10-11-1994', 'Male', 'sect113r2', '1A538A5072E9C81BCCC98D5E98FD5', '564636', 'user', '1', '2016-11-12 19:28:58'); 94 | 95 | -- -------------------------------------------------------- 96 | 97 | -- 98 | -- Table structure for table `user_login` 99 | -- 100 | 101 | CREATE TABLE `user_login` ( 102 | `userid` varchar(20) NOT NULL, 103 | `otp` varchar(10) NOT NULL DEFAULT '', 104 | `created` date NOT NULL 105 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 106 | 107 | -- 108 | -- Dumping data for table `user_login` 109 | -- 110 | 111 | INSERT INTO `user_login` (`userid`, `otp`, `created`) VALUES 112 | ('100006', '655199', '2015-05-09'), 113 | ('100010', '169244', '2016-11-12'); 114 | 115 | -- 116 | -- Indexes for dumped tables 117 | -- 118 | 119 | -- 120 | -- Indexes for table `files` 121 | -- 122 | ALTER TABLE `files` 123 | ADD PRIMARY KEY (`id`); 124 | 125 | -- 126 | -- Indexes for table `users` 127 | -- 128 | ALTER TABLE `users` 129 | ADD PRIMARY KEY (`userid`), 130 | ADD UNIQUE KEY `userid` (`userid`), 131 | ADD UNIQUE KEY `email` (`email`); 132 | 133 | -- 134 | -- Indexes for table `user_login` 135 | -- 136 | ALTER TABLE `user_login` 137 | ADD PRIMARY KEY (`userid`,`otp`,`created`); 138 | 139 | -- 140 | -- AUTO_INCREMENT for dumped tables 141 | -- 142 | 143 | -- 144 | -- AUTO_INCREMENT for table `files` 145 | -- 146 | ALTER TABLE `files` 147 | MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; 148 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 149 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 150 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 151 | -------------------------------------------------------------------------------- /Documentation/Secure File Storage Using Hybrid Cryptography.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/Documentation/Secure File Storage Using Hybrid Cryptography.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Secure File Storage using Hybrid Cryptography 2 | 3 | ## NOTE : I don't maintain this project anymore, I developed this as a college final year project in 2020. I don't work on this technology anymore. If anyone is getting any errors, please don't message me, unfortunately you'll have to figure it out on your own. 4 | 5 | The primary goal of this project is to provide and simulate an effective solution to face the challenges and solve security issues that exists in cloud computing. 6 | Cloud Computing is the impending need of computing which is used for the IT Industries It is one of the hottest topic in research areas. Scalability and Flexibility increases for the computing services. Cloud Computing is the fastest growing technology for IT Industry. The Information is being transmitted via the network therefore security is one of the main problems or issue. The Application is deployed on the Cloud and for the secure transmission of the data we will be using ECC Algorithm in our project because of its advantages in terms of CPU utilization, time for Encryption and Key Size. This Project will explore the deployment of Application on the Cloud and increases the security level by implementing ECC & ECDH Algorithm, and AES Algorithm for secure file handling and Encryption. 7 | 8 | To know more about this project, read the project report present in the documentation folder. 9 | 10 | ![](https://i.imgur.com/HIEvIt0.png) 11 | -------------------------------------------------------------------------------- /build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project securecloud. 12 | 13 | 71 | 72 | -------------------------------------------------------------------------------- /build/web/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | 3 | -------------------------------------------------------------------------------- /build/web/META-INF/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/.netbeans_automatic_build: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/.netbeans_automatic_build -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/.netbeans_update_resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/.netbeans_update_resources -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/connection/AES.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/connection/AES.class -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/connection/AutoID.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/connection/AutoID.class -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/connection/ECC.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/connection/ECC.class -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/connection/GenerateRandomString.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/connection/GenerateRandomString.class -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/connection/dbConnection.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/connection/dbConnection.class -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/org/AdminLogin.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/org/AdminLogin.class -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/org/DecryptedKey.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/org/DecryptedKey.class -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/org/Decryption.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/org/Decryption.class -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/org/EmailUtility$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/org/EmailUtility$1.class -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/org/EmailUtility.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/org/EmailUtility.class -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/org/Encryption.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/org/Encryption.class -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/org/FirstLogin.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/org/FirstLogin.class -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/org/GenerateOTP.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/org/GenerateOTP.class -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/org/KeyGeneration.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/org/KeyGeneration.class -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/org/Login.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/org/Login.class -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/org/Logout.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/org/Logout.class -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/org/MyAccount.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/org/MyAccount.class -------------------------------------------------------------------------------- /build/web/WEB-INF/classes/org/Register.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/classes/org/Register.class -------------------------------------------------------------------------------- /build/web/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | /securecloud 5 | 6 | 7 | 8 | Keep a copy of the generated servlet class' java code. 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /build/web/WEB-INF/lib/bcprov-1.45.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/lib/bcprov-1.45.jar -------------------------------------------------------------------------------- /build/web/WEB-INF/lib/commons-fileupload-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/lib/commons-fileupload-1.1.jar -------------------------------------------------------------------------------- /build/web/WEB-INF/lib/commons-io-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/lib/commons-io-1.1.jar -------------------------------------------------------------------------------- /build/web/WEB-INF/lib/fileupload-progress.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/lib/fileupload-progress.jar -------------------------------------------------------------------------------- /build/web/WEB-INF/lib/mail.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/lib/mail.jar -------------------------------------------------------------------------------- /build/web/WEB-INF/lib/mysql-connector-java-3.0.11-stable-bin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/WEB-INF/lib/mysql-connector-java-3.0.11-stable-bin.jar -------------------------------------------------------------------------------- /build/web/adminlogin.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : adminlogin 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | 7 | 8 | 9 | 10 | Login - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 11 | 12 | 29 | 30 | 31 | 32 | 33 | 36 | 37 | 38 | 89 | 90 | 91 | 94 | 95 |
34 | <%@include file="header.jsp" %> 35 |
39 |
40 |
41 | 42 | 43 | 48 | 49 | <% 50 | String msg = null; 51 | msg = (String) session.getAttribute("MSG"); 52 | if (msg != null) { 53 | %> 54 | 55 | 56 | 57 | <% 58 | session.removeAttribute("MSG"); 59 | } else { 60 | session.setAttribute("MSG", ""); 61 | 62 | } 63 | %> 64 | 65 | 68 | 69 | 70 | 71 | 72 | 73 | 76 | 77 | 78 | 79 | 80 | 81 | 84 | 85 |
44 |
45 | Login 46 |
47 |
<%=msg%>
66 | Userid 67 |
74 | Password 75 |
82 | 83 |
86 |
87 |
88 |
96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /build/web/description.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : description 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | 7 | 8 | <% response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1 9 | response.setHeader("Pragma", "no-cache"); //HTTP 1.0 10 | response.setDateHeader("Expires", 0); //prevents caching at the proxy server 11 | response.setHeader("Cache-Control", "no-store"); //HTTP 1.1 12 | String id = null; 13 | id = (String) session.getAttribute("ID"); 14 | if (id != null) { 15 | %> 16 | 17 | 18 | 19 | Decryption - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 20 | 21 | 22 | 38 | 39 | 40 | 41 | 42 | 45 | 46 | 47 | 88 | 89 | 90 | 93 | 94 |
43 | <%@include file="header.jsp" %> 44 |
48 |
49 |
50 | 51 | 52 | 57 | 58 | <% 59 | String msg = null; 60 | msg = (String) session.getAttribute("MSG"); 61 | if (msg != null) { 62 | %> 63 | 64 | 65 | 66 | <% 67 | session.removeAttribute("MSG"); 68 | } else { 69 | session.setAttribute("MSG", ""); 70 | 71 | } 72 | %> 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 83 | 84 |
53 |
54 | Decryption 55 |
56 |
<%=msg%>
81 | 82 |
85 |
86 |
87 |
95 | 96 | 97 | <% } else { 98 | session.setAttribute("MSG", "You must be login."); 99 | response.sendRedirect("login.jsp"); 100 | } 101 | %> -------------------------------------------------------------------------------- /build/web/download.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : download 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | 7 | 8 | <% response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1 9 | response.setHeader("Pragma", "no-cache"); //HTTP 1.0 10 | response.setDateHeader("Expires", 0); //prevents caching at the proxy server 11 | response.setHeader("Cache-Control", "no-store"); //HTTP 1.1 12 | String id = null; 13 | id = (String) session.getAttribute("ID"); 14 | if (id != null) { 15 | %> 16 | 17 | 18 | 19 | Download - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 20 | 21 | 22 | 23 | 24 | 25 | 28 | 29 | 30 | 55 | 56 | 57 | 60 | 61 |
26 | <%@include file="header.jsp" %> 27 |
31 |
32 |
33 | 34 | 35 | 40 | 41 | 42 | 49 | 50 | 51 |
36 |
37 | Download 38 |
39 |
43 | <% 44 | String filename = request.getParameter("filename"); 45 | %> 46 | Your file has been successfully decrypted.

47 | Click here to download decrypted file

48 |
52 |
53 |
54 |
62 | 63 | 64 | <% } else { 65 | session.setAttribute("MSG", "You must be login."); 66 | response.sendRedirect("login.jsp"); 67 | } 68 | %> -------------------------------------------------------------------------------- /build/web/download_file.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : download 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | 7 | 8 | <% response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1 9 | response.setHeader("Pragma", "no-cache"); //HTTP 1.0 10 | response.setDateHeader("Expires", 0); //prevents caching at the proxy server 11 | response.setHeader("Cache-Control", "no-store"); //HTTP 1.1 12 | String id = null; 13 | id = (String) session.getAttribute("ID"); 14 | if (id != null) { 15 | %> 16 | 17 | 18 | 19 | Download - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 20 | 21 | 22 | 23 | 24 | 25 | 28 | 29 | 30 | 56 | 57 | 58 | 61 | 62 |
26 | <%@include file="header.jsp" %> 27 |
31 |
32 |
33 | 34 | 35 | 40 | 41 | 42 | 50 | 51 | 52 |
36 |
37 | Download 38 |
39 |
43 | <% 44 | String filename = request.getParameter("filename"); 45 | String aes_key = request.getParameter("aes_key"); 46 | %> 47 | Your AES key has been successfully decrypted.
Your AES KEY is <%=aes_key%>
48 | Click here to download encrypted file

49 |
53 |
54 |
55 |
63 | 64 | 65 | <% } else { 66 | session.setAttribute("MSG", "You must be login."); 67 | response.sendRedirect("login.jsp"); 68 | } 69 | %> -------------------------------------------------------------------------------- /build/web/downloadfile.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : downloadfile 3 | Author : Subhadeep Dan 4 | --%> 5 | 6 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 7 | <%@page import="java.sql.Connection"%> 8 | <%@page import="java.sql.Statement"%> 9 | <%@page import="java.sql.ResultSet"%> 10 | 11 | <% 12 | Connection conn = null; 13 | Statement st = null; 14 | ResultSet result = null; 15 | response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1 16 | response.setHeader("Pragma", "no-cache"); //HTTP 1.0 17 | response.setDateHeader("Expires", 0); //prevents caching at the proxy server 18 | response.setHeader("Cache-Control", "no-store"); //HTTP 1.1 19 | String id = null; 20 | id = (String) session.getAttribute("ID"); 21 | if (id != null) { 22 | %> 23 | 24 | 25 | 26 | Download File - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 103 | 104 | 105 | 108 | 109 |
33 | <%@include file="header.jsp" %> 34 |
38 | 39 | 40 | 45 | 46 | <% 47 | String msg = null; 48 | msg = (String) session.getAttribute("MSG"); 49 | if (msg != null) { 50 | %> 51 | 52 | 55 | 56 | <% 57 | session.removeAttribute("MSG"); 58 | } else { 59 | session.setAttribute("MSG", ""); 60 | 61 | } 62 | %> 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | <% 71 | int i = 0; 72 | try { 73 | conn = connection.dbConnection.makeConnection(); 74 | String query = "SELECT id,file_name,file_path,created FROM files WHERE userid='" + id + "' ORDER BY id DESC"; 75 | st = conn.prepareStatement(query); 76 | result = st.executeQuery(query); 77 | while (result.next()) { 78 | String fileid = result.getString(1); 79 | String fname = result.getString(2); 80 | String filepath = result.getString(3); 81 | String adding_date = result.getString(4); 82 | i++; 83 | %> 84 | 85 | 86 | 87 | 88 | 91 | 94 | 95 | <% } 96 | 97 | } catch (Exception e) { 98 | e.printStackTrace(); 99 | } 100 | %> 101 |
41 |
42 | Download File 43 |
44 |
53 |
<%=msg%>
54 |
S.NoFile NameAdding DateDownloadDelete
<%=i%>.<%=fname%><%=adding_date%>. 89 | Download 90 | 92 | Delete 93 |
102 |
110 | 111 | 112 | <% } else { 113 | session.setAttribute("MSG", "You must be login."); 114 | response.sendRedirect("login.jsp"); 115 | } 116 | %> -------------------------------------------------------------------------------- /build/web/encryption.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : encryption 3 | Author : Subhadeep Dan 4 | --%> 5 | 6 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 7 | 8 | <% 9 | response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1 10 | response.setHeader("Pragma", "no-cache"); //HTTP 1.0 11 | response.setDateHeader("Expires", 0); //prevents caching at the proxy server 12 | response.setHeader("Cache-Control", "no-store"); //HTTP 1.1 13 | String id = null; 14 | id = (String) session.getAttribute("ID"); 15 | if (id != null) { 16 | %> 17 | 18 | 19 | 20 | Encryption - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 21 | 22 | 23 | 41 | 42 | 43 | 44 | 45 | 48 | 49 | 50 | 91 | 92 | 93 | 96 | 97 |
46 | <%@include file="header.jsp" %> 47 |
51 |
52 |
53 | 54 | 55 | 60 | 61 | <% 62 | String msg = null; 63 | msg = (String) session.getAttribute("MSG"); 64 | if (msg != null) { 65 | %> 66 | 67 | 68 | 69 | <% 70 | session.removeAttribute("MSG"); 71 | } else { 72 | session.setAttribute("MSG", ""); 73 | 74 | } 75 | %> 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 86 | 87 |
56 |
57 | Encryption 58 |
59 |
<%=msg%>
84 | 85 |
88 |
89 |
90 |
98 | 99 | 100 | <% } else { 101 | session.setAttribute("MSG", "You must be login."); 102 | response.sendRedirect("login.jsp"); 103 | } 104 | %> -------------------------------------------------------------------------------- /build/web/filelist.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : filelist 3 | Author : Subhadeep Dan 4 | --%> 5 | 6 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 7 | <%@page import="java.sql.Connection"%> 8 | <%@page import="java.sql.Statement"%> 9 | <%@page import="java.sql.ResultSet"%> 10 | 11 | <% 12 | Connection conn = null; 13 | Statement st = null; 14 | ResultSet result = null; 15 | response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1 16 | response.setHeader("Pragma", "no-cache"); //HTTP 1.0 17 | response.setDateHeader("Expires", 0); //prevents caching at the proxy server 18 | response.setHeader("Cache-Control", "no-store"); //HTTP 1.1 19 | String id = null; 20 | id = (String) session.getAttribute("ID"); 21 | if (id != null) { 22 | %> 23 | 24 | 25 | 26 | File List- Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 103 | 104 | 105 | 108 | 109 |
33 | <%@include file="header.jsp" %> 34 |
38 | 39 | 40 | 45 | 46 | <% 47 | String msg = null; 48 | msg = (String) session.getAttribute("MSG"); 49 | if (msg != null) { 50 | %> 51 | 52 | 55 | 56 | <% 57 | session.removeAttribute("MSG"); 58 | } else { 59 | session.setAttribute("MSG", ""); 60 | 61 | } 62 | %> 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | <% 71 | int i = 0; 72 | try { 73 | conn = connection.dbConnection.makeConnection(); 74 | String query = "SELECT u.name,f.id,f.file_name,f.created,f.file_path FROM users u, files f WHERE u.userid = f.userid ORDER BY f.id DESC"; 75 | st = conn.prepareStatement(query); 76 | result = st.executeQuery(query); 77 | while (result.next()) { 78 | 79 | String username = result.getString(1); 80 | String fileid = result.getString(2); 81 | String fname = result.getString(3); 82 | String adding_date = result.getString(4); 83 | String file_path = result.getString(5); 84 | i++; 85 | %> 86 | 87 | 88 | 89 | 90 | 91 | 94 | 95 | <% } 96 | 97 | } catch (Exception e) { 98 | e.printStackTrace(); 99 | } 100 | %> 101 |
41 |
42 | File List 43 |
44 |
53 |
<%=msg%>
54 |
S.NoUser NameFile NameDateDelete
<%=i%>.<%=username%><%=fname%><%=adding_date%>. 92 | Delete 93 |
102 |
110 | 111 | 112 | <% } else { 113 | session.setAttribute("MSG", "You must be login."); 114 | response.sendRedirect("login.jsp"); 115 | } 116 | %>%> -------------------------------------------------------------------------------- /build/web/footer.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : footer 3 | Author : Subhadeep Dan 4 | --%> 5 | Design & Developed By: Subhadeep Dan, Vikash Kumar & Ankit Mishra -------------------------------------------------------------------------------- /build/web/header.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 8 | 9 | <% 10 | if (null != session.getAttribute("UTYPE")) { 11 | %> 12 | 13 | 41 | 42 | <% } else {%> 43 | 44 | 54 | 55 | <% }%> 56 |
4 |

Secure File Storage using Hybrid Cryptography

5 |
7 |
14 |  My Account | 15 | <% 16 | String utype = (String) session.getAttribute("UTYPE"); 17 | if (utype.equals("admin")) { 18 | %> 19 | User List| 20 | File List| 21 | Encryption| 22 | Decryption| 23 | Download File 24 | <% } else { 25 | %> 26 | Encryption| 27 | Decryption| 28 | Download File 29 | <% } 30 | %> 31 | <% 32 | if (null != session.getAttribute("ID")) { 33 | %> 34 | 35 | Welcome, 36 | <%=(String) session.getAttribute("NAME")%>  37 | (Logout) 38 | 39 | <% }%> 40 |
45 |  Home | 46 |  Register | 47 |  Login  48 | 49 | 50 | Efficient & Secure Data Storage & Access Scheme in Cloud Computing using Elliptic Curve Cryptography and AES 51 | 52 | 53 |
-------------------------------------------------------------------------------- /build/web/images/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/images/background.jpg -------------------------------------------------------------------------------- /build/web/images/header_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/images/header_bg.jpg -------------------------------------------------------------------------------- /build/web/images/header_bg1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/images/header_bg1.png -------------------------------------------------------------------------------- /build/web/images/rightside.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/images/rightside.gif -------------------------------------------------------------------------------- /build/web/images/user_login.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/images/user_login.jpg -------------------------------------------------------------------------------- /build/web/index.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : index 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | 7 | 8 | 9 | 10 | Welcome to Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 48 | 49 | 50 | 53 | 54 |
17 | <%@include file="header.jsp" %> 18 |
22 | 23 | 24 | 29 | 30 | 31 | 45 | 46 |
25 |
26 | About the project 27 |
28 |
32 |

The primary goal of this project is to provide and simulate an effective solution to 33 | face the challenges and solve security issues that exists in cloud computing. 34 | Cloud Computing is the impending need of computing which is used for the IT Industries 35 | It is one of the hottest topic in research areas. Scalability and Flexibility increases 36 | for the computing services. Cloud Computing is the fastest growing technology for IT Industry. 37 | The Information is being transmitted via the network therefore security is one of the main 38 | problems or issue. The Application is deployed on the Cloud and for the secure transmission 39 | of the data we will be using ECC Algorithm in our project because of its advantages in terms 40 | of CPU utilization, time for Encryption and Key Size. This Project will explore the deployment 41 | of Application on the Cloud and increases the security level by implementing ECC & ECDH Algorithm, 42 | and AES Algorithm for secure file handling and Encryption.

43 | 44 |
47 |
55 | 56 | 57 | -------------------------------------------------------------------------------- /build/web/jarfile/bcprov-1.45.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/jarfile/bcprov-1.45.jar -------------------------------------------------------------------------------- /build/web/jarfile/commons-fileupload-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/jarfile/commons-fileupload-1.1.jar -------------------------------------------------------------------------------- /build/web/jarfile/commons-io-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/jarfile/commons-io-1.1.jar -------------------------------------------------------------------------------- /build/web/jarfile/fileupload-progress.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/jarfile/fileupload-progress.jar -------------------------------------------------------------------------------- /build/web/jarfile/mail.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/jarfile/mail.jar -------------------------------------------------------------------------------- /build/web/jarfile/mysql-connector-java-3.0.11-stable-bin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/jarfile/mysql-connector-java-3.0.11-stable-bin.jar -------------------------------------------------------------------------------- /build/web/keydescription.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : description 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | 7 | 8 | <% response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1 9 | response.setHeader("Pragma", "no-cache"); //HTTP 1.0 10 | response.setDateHeader("Expires", 0); //prevents caching at the proxy server 11 | response.setHeader("Cache-Control", "no-store"); //HTTP 1.1 12 | String id = null; 13 | id = (String) session.getAttribute("ID"); 14 | if (id != null) { 15 | %> 16 | 17 | 18 | 19 | Decrypt AES Key - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 20 | 21 | 22 | 38 | 39 | 40 | 41 | 42 | 45 | 46 | 47 | 94 | 95 | 96 | 99 | 100 |
43 | <%@include file="header.jsp" %> 44 |
48 |
49 |
50 | 51 | 52 | 57 | 58 | <% 59 | String msg = null; 60 | String fileid = request.getParameter("fileid"); 61 | msg = (String) session.getAttribute("MSG"); 62 | if (msg != null) { 63 | %> 64 | 65 | 66 | 67 | <% 68 | session.removeAttribute("MSG"); 69 | } else { 70 | session.setAttribute("MSG", ""); 71 | 72 | } 73 | %> 74 | 75 | 78 | 79 | 80 | 84 | 85 | 86 | 89 | 90 |
53 |
54 | Decrypt AES key and Download file 55 |
56 |
<%=msg%>
76 | Enter public key for downloading file and decrypting AES Key. 77 |
81 | 82 | 83 |
87 | 88 |
91 |
92 |
93 |
101 | 102 | 103 | <% } else { 104 | session.setAttribute("MSG", "You must be login."); 105 | response.sendRedirect("login.jsp"); 106 | } 107 | %> -------------------------------------------------------------------------------- /build/web/keyexchange.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : keyexchange 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | 7 | <% 8 | String userid = request.getParameter("userid"); 9 | %> 10 | 11 | 12 | 13 | Key Exchange - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 14 | 15 | 25 | 26 | 27 | 28 | 29 | 32 | 33 | 34 | 85 | 86 | 87 | 90 | 91 |
30 | <%@include file="header.jsp" %> 31 |
35 |
36 |
37 | 38 | 39 | 44 | 45 | <% 46 | String msg = null; 47 | msg = (String) session.getAttribute("MSG"); 48 | if (msg != null) { 49 | %> 50 | 51 | 52 | 53 | <% 54 | session.removeAttribute("MSG"); 55 | } else { 56 | session.setAttribute("MSG", ""); 57 | 58 | } 59 | %> 60 | 61 | 64 | 65 | 66 | 67 | 68 | 69 | 72 | 73 | 74 | 75 | 76 | 77 | 80 | 81 |
40 |
41 | Key Exchange 42 |
43 |
<%=msg%>
62 | Your Registration id is 63 |
70 | Enter your secret private key for ECDH key exchange 71 |
78 | 79 |
82 |
83 |
84 |
92 | 93 | 94 | -------------------------------------------------------------------------------- /build/web/login.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : login 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | 8 | 9 | 10 | 11 | Login - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 12 | 13 | 65 | 66 | 67 | 68 | 69 | 72 | 73 | 74 | 120 | 121 | 122 | 125 | 126 |
70 | <%@include file="header.jsp" %> 71 |
75 |
76 |
77 | 78 | 79 | 84 | 85 | <% 86 | String msg = null; 87 | msg = (String) session.getAttribute("MSG"); 88 | if (msg != null) { 89 | %> 90 | 91 | 92 | 93 | <% 94 | session.removeAttribute("MSG"); 95 | } else { 96 | session.setAttribute("MSG", ""); 97 | 98 | } 99 | %> 100 | 101 | 102 | 103 | 104 | 107 | 108 | 109 | 110 | 111 | 112 | 115 | 116 |
80 |
81 | Login 82 |
83 |
<%=msg%>
105 | Request for OTP 106 |
113 | 114 |
117 |
118 |
119 |
127 | 128 | 129 | -------------------------------------------------------------------------------- /build/web/secretkey.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : secretkey 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | <% 7 | String userid = request.getParameter("userid"); 8 | String secretkey = request.getParameter("secretkey"); 9 | %> 10 | 11 | 12 | 13 | 14 | Secrete Key - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 15 | 16 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 90 | 91 | 92 | 95 | 96 |
32 | <%@include file="header.jsp" %> 33 |
37 |
38 |
39 | 40 | 41 | 46 | 47 | <% 48 | String msg = null; 49 | msg = (String) session.getAttribute("MSG"); 50 | if (msg != null) { 51 | %> 52 | 53 | 54 | 55 | <% 56 | session.removeAttribute("MSG"); 57 | } else { 58 | session.setAttribute("MSG", ""); 59 | 60 | } 61 | %> 62 | 63 | 66 | 67 | 68 | 72 | 73 | 74 | 77 | 78 | 79 | 80 | 81 | 82 | 85 | 86 |
42 |
43 | Generate User ID 44 |
45 |
<%=msg%>
64 | Your ECDH key is 65 |
69 | 70 | 71 |
75 | OTP has been sent to your email id 76 |
83 |
84 |
87 |
88 |
89 |
97 | 98 | 99 | -------------------------------------------------------------------------------- /build/web/sucess_registration.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : secretkey 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | <% 7 | String userid = request.getParameter("userid"); 8 | String secretkey = request.getParameter("secretkey"); 9 | %> 10 | 11 | 12 | 13 | 14 | Secrete Key - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 15 | 16 | 32 | 33 | 34 | 35 | 36 | 39 | 40 | 41 | 84 | 85 | 86 | 89 | 90 |
37 | <%@include file="header.jsp" %> 38 |
42 |
43 |
44 | 45 | 46 | 51 | 52 | <% 53 | String msg = null; 54 | msg = (String) session.getAttribute("MSG"); 55 | if (msg != null) { 56 | %> 57 | 58 | 59 | 60 | <% 61 | session.removeAttribute("MSG"); 62 | } else { 63 | session.setAttribute("MSG", ""); 64 | 65 | } 66 | %> 67 | 68 | 71 | 72 | 73 | 74 | 75 | 76 | 79 | 80 |
47 |
48 | User ID 49 |
50 |
<%=msg%>
69 | Your user id is 70 |
77 | Click here to login 78 |
81 |
82 |
83 |
91 | 92 | 93 | -------------------------------------------------------------------------------- /build/web/uploads/downloads/f1588661499206.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/uploads/downloads/f1588661499206.pdf -------------------------------------------------------------------------------- /build/web/uploads/downloads/f1588663318402.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/uploads/downloads/f1588663318402.pdf -------------------------------------------------------------------------------- /build/web/uploads/downloads/f1592464238577.txt (1): -------------------------------------------------------------------------------- 1 | This is a demo text file. -------------------------------------------------------------------------------- /build/web/uploads/downloads/f1592464238577.txt.aes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/uploads/downloads/f1592464238577.txt.aes -------------------------------------------------------------------------------- /build/web/uploads/f1588661499206.pdf.aes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/uploads/f1588661499206.pdf.aes -------------------------------------------------------------------------------- /build/web/uploads/f1588663318402.pdf.aes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/uploads/f1588663318402.pdf.aes -------------------------------------------------------------------------------- /build/web/uploads/f1588664761805.png.aes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/uploads/f1588664761805.png.aes -------------------------------------------------------------------------------- /build/web/uploads/f1592464238577.txt.aes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/build/web/uploads/f1592464238577.txt.aes -------------------------------------------------------------------------------- /build/web/usrelist.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : usrelist 3 | Author : Subhadeep Dan 4 | --%> 5 | 6 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 7 | <%@page import="java.sql.Connection"%> 8 | <%@page import="java.sql.Statement"%> 9 | <%@page import="java.sql.ResultSet"%> 10 | 11 | <% 12 | Connection conn = null; 13 | Statement st = null; 14 | ResultSet result = null; 15 | response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1 16 | response.setHeader("Pragma", "no-cache"); //HTTP 1.0 17 | response.setDateHeader("Expires", 0); //prevents caching at the proxy server 18 | response.setHeader("Cache-Control", "no-store"); //HTTP 1.1 19 | String id = null; 20 | id = (String) session.getAttribute("ID"); 21 | if (id != null) { 22 | %> 23 | 24 | 25 | 26 | Users List- Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 104 | 105 | 106 | 109 | 110 |
33 | <%@include file="header.jsp" %> 34 |
38 | 39 | 40 | 45 | 46 | <% 47 | String msg = null; 48 | msg = (String) session.getAttribute("MSG"); 49 | if (msg != null) { 50 | %> 51 | 52 | 55 | 56 | <% 57 | session.removeAttribute("MSG"); 58 | } else { 59 | session.setAttribute("MSG", ""); 60 | 61 | } 62 | %> 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | <% 72 | int i = 0; 73 | try { 74 | conn = connection.dbConnection.makeConnection(); 75 | String query = "SELECT userid,NAME,email,mobile FROM users WHERE utype != 'admin'"; 76 | st = conn.prepareStatement(query); 77 | result = st.executeQuery(query); 78 | while (result.next()) { 79 | 80 | String userid = result.getString(1); 81 | String name = result.getString(2); 82 | String email = result.getString(3); 83 | String mobile = result.getString(4); 84 | i++; 85 | %> 86 | 87 | 88 | 89 | 90 | 91 | 92 | 95 | 96 | <% } 97 | 98 | } catch (Exception e) { 99 | e.printStackTrace(); 100 | } 101 | %> 102 |
41 |
42 | Users List 43 |
44 |
53 |
<%=msg%>
54 |
S.NoIDNameEmailMobileDelete
<%=i%>.<%=userid%><%=name%><%=email%><%=mobile%> 93 | Delete 94 |
103 |
111 | 112 | 113 | <% } else { 114 | session.setAttribute("MSG", "You must be login."); 115 | response.sendRedirect("login.jsp"); 116 | } 117 | %>%> -------------------------------------------------------------------------------- /dist/securecloud.war: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/dist/securecloud.war -------------------------------------------------------------------------------- /nbproject/ant-deploy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 28 | 29 | 30 | 31 | 32 | 34 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=df5a10a4 2 | build.xml.script.CRC32=e4a0207f 3 | build.xml.stylesheet.CRC32=651128d4@1.67.1.1 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=df5a10a4 7 | nbproject/build-impl.xml.script.CRC32=1f11898e 8 | nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.67.1.1 9 | -------------------------------------------------------------------------------- /nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | deploy.ant.properties.file=C:\\Users\\Subhadeep\\AppData\\Roaming\\NetBeans\\8.0\\tomcat80.properties 2 | j2ee.platform.is.jsr109=true 3 | j2ee.server.domain=C:/Users/Subhadeep/AppData/Roaming/NetBeans/8.0/config/GF_4.0/domain1 4 | j2ee.server.home=C:/apache-tomcat-8.5.53 5 | j2ee.server.instance=tomcat80:home=C:\\apache-tomcat-8.5.53 6 | j2ee.server.middleware=C:/Program Files/glassfish-4.0 7 | javac.debug=true 8 | javadoc.preview=true 9 | selected.browser=Chrome.INTEGRATED 10 | user.properties.file=C:\\Users\\Subhadeep\\AppData\\Roaming\\NetBeans\\8.0\\build.properties 11 | -------------------------------------------------------------------------------- /nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | file:/F:/Study%20Material/Major%20Project/MajorProject-SecureCloud-master/Source%20Code/web/myaccount.jsp 7 | file:/F:/Study%20Material/Major%20Project/MajorProject-SecureCloud-master/Source%20Code/src/java/org/GenerateOTP.java 8 | file:/F:/Study%20Material/Major%20Project/MajorProject-SecureCloud-master/Source%20Code/src/java/org/Register.java 9 | file:/F:/Study%20Material/Major%20Project/MajorProject-SecureCloud-master/Source%20Code/src/java/connection/ECC.java 10 | file:/F:/Study%20Material/Major%20Project/MajorProject-SecureCloud-master/Source%20Code/src/java/org/MyAccount.java 11 | file:/F:/Study%20Material/Major%20Project/MajorProject-SecureCloud-master/Source%20Code/web/header.jsp 12 | file:/F:/Study%20Material/Major%20Project/MajorProject-SecureCloud-master/Source%20Code/web/secretkey.jsp 13 | file:/F:/Study%20Material/Major%20Project/MajorProject-SecureCloud-master/Source%20Code/web/usrelist.jsp 14 | file:/F:/Study%20Material/Major%20Project/MajorProject-SecureCloud-master/Source%20Code/web/keyexchange.jsp 15 | file:/F:/Study%20Material/Major%20Project/MajorProject-SecureCloud-master/Source%20Code/src/java/org/Login.java 16 | file:/F:/Study%20Material/Major%20Project/MajorProject-SecureCloud-master/Source%20Code/web/register.jsp 17 | file:/F:/Study%20Material/Major%20Project/MajorProject-SecureCloud-master/Source%20Code/web/login.jsp 18 | file:/F:/Study%20Material/Major%20Project/MajorProject-SecureCloud-master/Source%20Code/src/java/org/KeyGeneration.java 19 | file:/F:/Study%20Material/Major%20Project/MajorProject-SecureCloud-master/Source%20Code/src/java/connection/AES.java 20 | file:/F:/Study%20Material/Major%20Project/MajorProject-SecureCloud-master/Source%20Code/web/adminlogin.jsp 21 | file:/F:/Study%20Material/Major%20Project/MajorProject-SecureCloud-master/Source%20Code/src/java/org/FirstLogin.java 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=true 3 | annotation.processing.processors.list= 4 | annotation.processing.run.all.processors=true 5 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 6 | auxiliary.org-netbeans-modules-css-prep.less_2e_compiler_2e_options= 7 | auxiliary.org-netbeans-modules-css-prep.less_2e_enabled=false 8 | auxiliary.org-netbeans-modules-css-prep.less_2e_mappings=/less:/css 9 | auxiliary.org-netbeans-modules-css-prep.sass_2e_compiler_2e_options= 10 | auxiliary.org-netbeans-modules-css-prep.sass_2e_enabled=false 11 | auxiliary.org-netbeans-modules-css-prep.sass_2e_mappings=/scss:/css 12 | auxiliary.org-netbeans-modules-web-clientproject-api.js_2e_libs_2e_folder=js 13 | build.classes.dir=${build.web.dir}/WEB-INF/classes 14 | build.classes.excludes=**/*.java,**/*.form 15 | build.dir=build 16 | build.generated.dir=${build.dir}/generated 17 | build.generated.sources.dir=${build.dir}/generated-sources 18 | build.test.classes.dir=${build.dir}/test/classes 19 | build.test.results.dir=${build.dir}/test/results 20 | build.web.dir=${build.dir}/web 21 | build.web.excludes=${build.classes.excludes} 22 | client.urlPart= 23 | compile.jsps=false 24 | conf.dir=${source.root}/conf 25 | debug.classpath=${build.classes.dir}:${javac.classpath} 26 | debug.test.classpath=\ 27 | ${run.test.classpath} 28 | display.browser=true 29 | # Files to be excluded from distribution war 30 | dist.archive.excludes= 31 | dist.dir=dist 32 | dist.ear.war=${dist.dir}/${war.ear.name} 33 | dist.javadoc.dir=${dist.dir}/javadoc 34 | dist.war=${dist.dir}/${war.name} 35 | endorsed.classpath=\ 36 | ${libs.javaee-endorsed-api-6.0.classpath} 37 | excludes= 38 | file.reference.bcprov-1.45.jar=web/jarfile/bcprov-1.45.jar 39 | file.reference.commons-fileupload-1.1.jar=web/jarfile/commons-fileupload-1.1.jar 40 | file.reference.commons-io-1.1.jar=web/jarfile/commons-io-1.1.jar 41 | file.reference.fileupload-progress.jar=web/jarfile/fileupload-progress.jar 42 | file.reference.mail.jar=web/jarfile/mail.jar 43 | file.reference.mysql-connector-java-3.0.11-stable-bin.jar=web/jarfile/mysql-connector-java-3.0.11-stable-bin.jar 44 | includes=** 45 | j2ee.compile.on.save=true 46 | j2ee.copy.static.files.on.save=true 47 | j2ee.deploy.on.save=true 48 | j2ee.platform=1.7-web 49 | j2ee.platform.classpath=${j2ee.server.home}/lib/annotations-api.jar:${j2ee.server.home}/lib/catalina-ant.jar:${j2ee.server.home}/lib/catalina-ha.jar:${j2ee.server.home}/lib/catalina-storeconfig.jar:${j2ee.server.home}/lib/catalina-tribes.jar:${j2ee.server.home}/lib/catalina.jar:${j2ee.server.home}/lib/ecj-4.6.3.jar:${j2ee.server.home}/lib/el-api.jar:${j2ee.server.home}/lib/jasper-el.jar:${j2ee.server.home}/lib/jasper.jar:${j2ee.server.home}/lib/jaspic-api.jar:${j2ee.server.home}/lib/jsp-api.jar:${j2ee.server.home}/lib/servlet-api.jar:${j2ee.server.home}/lib/tomcat-api.jar:${j2ee.server.home}/lib/tomcat-coyote.jar:${j2ee.server.home}/lib/tomcat-dbcp.jar:${j2ee.server.home}/lib/tomcat-i18n-de.jar:${j2ee.server.home}/lib/tomcat-i18n-es.jar:${j2ee.server.home}/lib/tomcat-i18n-fr.jar:${j2ee.server.home}/lib/tomcat-i18n-ja.jar:${j2ee.server.home}/lib/tomcat-i18n-ko.jar:${j2ee.server.home}/lib/tomcat-i18n-ru.jar:${j2ee.server.home}/lib/tomcat-i18n-zh-CN.jar:${j2ee.server.home}/lib/tomcat-jdbc.jar:${j2ee.server.home}/lib/tomcat-jni.jar:${j2ee.server.home}/lib/tomcat-util-scan.jar:${j2ee.server.home}/lib/tomcat-util.jar:${j2ee.server.home}/lib/tomcat-websocket.jar:${j2ee.server.home}/lib/websocket-api.jar 50 | j2ee.server.type=Tomcat 51 | jar.compress=false 52 | javac.classpath=\ 53 | ${file.reference.commons-fileupload-1.1.jar}:\ 54 | ${file.reference.commons-io-1.1.jar}:\ 55 | ${file.reference.fileupload-progress.jar}:\ 56 | ${file.reference.mail.jar}:\ 57 | ${file.reference.mysql-connector-java-3.0.11-stable-bin.jar}:\ 58 | ${file.reference.bcprov-1.45.jar} 59 | # Space-separated list of extra javac options 60 | javac.compilerargs= 61 | javac.debug=true 62 | javac.deprecation=false 63 | javac.processorpath=\ 64 | ${javac.classpath} 65 | javac.source=1.7 66 | javac.target=1.7 67 | javac.test.classpath=\ 68 | ${javac.classpath}:\ 69 | ${build.classes.dir} 70 | javac.test.processorpath=\ 71 | ${javac.test.classpath} 72 | javadoc.additionalparam= 73 | javadoc.author=false 74 | javadoc.encoding=${source.encoding} 75 | javadoc.noindex=false 76 | javadoc.nonavbar=false 77 | javadoc.notree=false 78 | javadoc.preview=true 79 | javadoc.private=false 80 | javadoc.splitindex=true 81 | javadoc.use=true 82 | javadoc.version=false 83 | javadoc.windowtitle= 84 | lib.dir=${web.docbase.dir}/WEB-INF/lib 85 | persistence.xml.dir=${conf.dir} 86 | platform.active=default_platform 87 | resource.dir=setup 88 | run.test.classpath=\ 89 | ${javac.test.classpath}:\ 90 | ${build.test.classes.dir} 91 | # Space-separated list of JVM arguments used when running a class with a main method or a unit test 92 | # (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value): 93 | runmain.jvmargs= 94 | source.encoding=UTF-8 95 | source.root=src 96 | src.dir=${source.root}/java 97 | test.src.dir=test 98 | war.content.additional= 99 | war.ear.name=${war.name} 100 | war.name=securecloud.war 101 | web.docbase.dir=web 102 | webinf.dir=web/WEB-INF 103 | -------------------------------------------------------------------------------- /nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.web.project 4 | 5 | 6 | securecloud 7 | 1.6.5 8 | 9 | 10 | ${file.reference.commons-fileupload-1.1.jar} 11 | WEB-INF/lib 12 | 13 | 14 | ${file.reference.commons-io-1.1.jar} 15 | WEB-INF/lib 16 | 17 | 18 | ${file.reference.fileupload-progress.jar} 19 | WEB-INF/lib 20 | 21 | 22 | ${file.reference.mail.jar} 23 | WEB-INF/lib 24 | 25 | 26 | ${file.reference.mysql-connector-java-3.0.11-stable-bin.jar} 27 | WEB-INF/lib 28 | 29 | 30 | ${file.reference.bcprov-1.45.jar} 31 | WEB-INF/lib 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/conf/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | 3 | -------------------------------------------------------------------------------- /src/java/connection/AES.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Subhadeep Dan 3 | * All Rights Reserved. 4 | */ 5 | package connection; 6 | 7 | import java.io.*; 8 | import java.security.*; 9 | import javax.crypto.*; 10 | import javax.crypto.spec.*; 11 | 12 | /* Aes file encryption */ 13 | public class AES { 14 | 15 | private static final long serialVersionUID = 1L; 16 | private long read = 0; 17 | 18 | //decryption method 19 | public String Aesdecrypt(File f, String pwd) { 20 | String res = null; 21 | try { 22 | String kind = "AES"; 23 | Cipher c = Cipher.getInstance(kind); 24 | Key k = new SecretKeySpec(pwd.getBytes(), kind); 25 | c.init(Cipher.DECRYPT_MODE, k); 26 | String filename = f.getCanonicalPath(); 27 | 28 | if (filename.endsWith(".aes")) { 29 | filename = filename.substring( 30 | 0, filename.length() 31 | - kind.length()); // -suffix 32 | } else { 33 | res = "1"; 34 | } 35 | 36 | FileInputStream fis 37 | = new FileInputStream(f.getCanonicalPath()); 38 | 39 | FileOutputStream fos = new FileOutputStream(filename); 40 | CipherInputStream cis = new CipherInputStream(fis, c); 41 | byte[] buffer = new byte[0xFFFF]; 42 | final long size = f.length(); 43 | 44 | for (int len; (len = cis.read(buffer)) != -1;) { 45 | fos.write(buffer, 0, len); 46 | read += len; 47 | } 48 | cis.close(); 49 | fos.flush(); 50 | fos.close(); 51 | fis.close(); 52 | read = 0; 53 | res = "2"; 54 | } catch (Exception x) { 55 | res = "3"; 56 | x.printStackTrace(); 57 | } 58 | return res; 59 | } 60 | 61 | //encrypt method 62 | public String Aesencrypt(File f, String pwd, String uploadfilepath) { 63 | String res = null; 64 | 65 | try { 66 | String kind = "AES"; 67 | Cipher c = Cipher.getInstance(kind); 68 | Key k = new SecretKeySpec(pwd.getBytes(), kind); 69 | c.init(Cipher.ENCRYPT_MODE, k); 70 | 71 | FileInputStream fis 72 | = new FileInputStream(f); 73 | FileOutputStream fos 74 | = new FileOutputStream(uploadfilepath + ".aes"); 75 | CipherOutputStream cos = new CipherOutputStream(fos, c); 76 | final int size = (int) f.length(); 77 | byte[] buffer = new byte[0xFFFF]; 78 | 79 | for (int len; (len = fis.read(buffer)) != -1;) { 80 | cos.write(buffer, 0, len); 81 | read += len; 82 | } 83 | cos.flush(); 84 | cos.close(); 85 | fos.flush(); 86 | fos.close(); 87 | fis.close(); 88 | read = 0; 89 | res = "2"; 90 | } catch (Exception x) { 91 | res = "1"; 92 | x.printStackTrace(); 93 | } 94 | return res; 95 | } 96 | } -------------------------------------------------------------------------------- /src/java/connection/AutoID.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Subhadeep Dan 3 | * All Rights Reserved. 4 | */ 5 | package connection; 6 | 7 | import java.sql.Connection; 8 | import java.sql.ResultSet; 9 | import java.sql.PreparedStatement; 10 | 11 | public class AutoID { 12 | 13 | static Connection con = null; 14 | static ResultSet rs = null; 15 | static PreparedStatement ps = null; 16 | static String genID = ""; 17 | static String generateid = ""; 18 | 19 | public static String globalGenId(String form_name) { 20 | try { 21 | 22 | con = connection.dbConnection.makeConnection(); 23 | //genID = pref; 24 | String temp = null; 25 | String num = null; 26 | int r = 1; 27 | 28 | String sql = "select prefix from auto_id where form_name='" + form_name + "'"; 29 | ps = con.prepareStatement(sql); 30 | rs = ps.executeQuery(); 31 | if (rs.next()) { 32 | temp = rs.getString(1).trim(); 33 | //String auto_id[] = temp.split("-"); 34 | //num = auto_id[1]; 35 | r = Integer.parseInt(temp) + 1; 36 | 37 | } 38 | generateid = ""; 39 | if (r < 10) { 40 | generateid = genID + "0000" + r; 41 | } else if (r < 100) { 42 | generateid = genID + "000" + r; 43 | } else if (r < 1000) { 44 | generateid = genID + "00" + r; 45 | } else if (r < 10000) { 46 | generateid = genID + "0" + r; 47 | } else { 48 | generateid = genID + r; 49 | } 50 | 51 | } catch (Exception e) { 52 | } 53 | return (generateid); 54 | } 55 | 56 | /********************** Method for update Auto generate id ***************************/ 57 | 58 | 59 | public static void updateAutoID(String form_name, String id) { 60 | try { 61 | Connection con22 = connection.dbConnection.makeConnection(); 62 | PreparedStatement pst22 = con22.prepareStatement("update auto_id set prefix='" + id + "' where form_name='" + form_name + "'"); 63 | pst22.executeUpdate(); 64 | } catch (Exception e) { 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/java/connection/ECC.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Subhadeep Dan 3 | * All Rights Reserved. 4 | */ 5 | package connection; 6 | 7 | import java.io.UnsupportedEncodingException; 8 | import java.security.InvalidAlgorithmParameterException; 9 | import java.security.InvalidKeyException; 10 | import java.security.Key; 11 | import java.security.KeyPair; 12 | import java.security.KeyPairGenerator; 13 | import java.security.NoSuchAlgorithmException; 14 | import java.security.NoSuchProviderException; 15 | import java.security.PrivateKey; 16 | import java.security.PublicKey; 17 | import java.security.SecureRandom; 18 | import java.security.spec.ECGenParameterSpec; 19 | import javax.crypto.BadPaddingException; 20 | import javax.crypto.Cipher; 21 | import javax.crypto.IllegalBlockSizeException; 22 | import javax.crypto.KeyAgreement; 23 | import javax.crypto.NoSuchPaddingException; 24 | import javax.crypto.SecretKey; 25 | import javax.crypto.ShortBufferException; 26 | import javax.crypto.spec.IvParameterSpec; 27 | import javax.crypto.spec.SecretKeySpec; 28 | 29 | 30 | public class ECC { 31 | 32 | public static byte[] iv = new SecureRandom().generateSeed(16); 33 | public static KeyPair generateECKeys(String secretekey) { 34 | 35 | KeyPair kpU = null; 36 | try { 37 | KeyPairGenerator kpg; 38 | kpg = KeyPairGenerator.getInstance("EC", "SunEC"); 39 | ECGenParameterSpec ecsp; 40 | //String parameter = "sect113r2"; 41 | ecsp = new ECGenParameterSpec(secretekey); 42 | kpg.initialize(ecsp); 43 | kpU = kpg.genKeyPair(); 44 | 45 | } catch (Exception e) { 46 | e.printStackTrace(); 47 | } 48 | return kpU; 49 | 50 | } 51 | 52 | public static SecretKey generateSharedSecret(PrivateKey privateKey, 53 | PublicKey publicKey) { 54 | try { 55 | KeyAgreement keyAgreement = KeyAgreement.getInstance("ECDH", "BC"); 56 | keyAgreement.init(privateKey); 57 | keyAgreement.doPhase(publicKey, true); 58 | 59 | SecretKey key = keyAgreement.generateSecret("AES"); 60 | return key; 61 | } catch (InvalidKeyException | NoSuchAlgorithmException | NoSuchProviderException e) { 62 | // TODO Auto-generated catch block 63 | e.printStackTrace(); 64 | return null; 65 | } 66 | } 67 | 68 | public static String encryptString(SecretKey key, String plainText) { 69 | try { 70 | IvParameterSpec ivSpec = new IvParameterSpec(iv); 71 | Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding", "BC"); 72 | byte[] plainTextBytes = plainText.getBytes("UTF-8"); 73 | byte[] cipherText; 74 | 75 | cipher.init(Cipher.ENCRYPT_MODE, key, ivSpec); 76 | cipherText = new byte[cipher.getOutputSize(plainTextBytes.length)]; 77 | int encryptLength = cipher.update(plainTextBytes, 0, 78 | plainTextBytes.length, cipherText, 0); 79 | encryptLength += cipher.doFinal(cipherText, encryptLength); 80 | 81 | return bytesToHex(cipherText); 82 | } catch (NoSuchAlgorithmException | NoSuchProviderException | NoSuchPaddingException | InvalidKeyException | InvalidAlgorithmParameterException | UnsupportedEncodingException | ShortBufferException | IllegalBlockSizeException | BadPaddingException e) { 83 | e.printStackTrace(); 84 | return null; 85 | } 86 | } 87 | 88 | public static String decryptString(SecretKey key, String cipherText) { 89 | try { 90 | Key decryptionKey = new SecretKeySpec(key.getEncoded(), 91 | key.getAlgorithm()); 92 | IvParameterSpec ivSpec = new IvParameterSpec(iv); 93 | Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding", "BC"); 94 | byte[] cipherTextBytes = hexToBytes(cipherText); 95 | byte[] plainText; 96 | 97 | cipher.init(Cipher.DECRYPT_MODE, decryptionKey, ivSpec); 98 | plainText = new byte[cipher.getOutputSize(cipherTextBytes.length)]; 99 | int decryptLength = cipher.update(cipherTextBytes, 0, 100 | cipherTextBytes.length, plainText, 0); 101 | decryptLength += cipher.doFinal(plainText, decryptLength); 102 | 103 | return new String(plainText, "UTF-8"); 104 | } catch (NoSuchAlgorithmException | NoSuchProviderException | NoSuchPaddingException | InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException | ShortBufferException | UnsupportedEncodingException e) { 105 | e.printStackTrace(); 106 | return null; 107 | } 108 | } 109 | 110 | public static String bytesToHex(byte[] data, int length) { 111 | 112 | String digits = "0123456789ABCDEF"; 113 | StringBuffer buffer = new StringBuffer(); 114 | 115 | for (int i = 0; i != length; i++) { 116 | int v = data[i] & 0xff; 117 | 118 | buffer.append(digits.charAt(v >> 4)); 119 | buffer.append(digits.charAt(v & 0xf)); 120 | } 121 | 122 | return buffer.toString(); 123 | } 124 | 125 | public static String bytesToHex(byte[] data) { 126 | return bytesToHex(data, data.length); 127 | } 128 | public static byte[] hexToBytes(String string) { 129 | int length = string.length(); 130 | byte[] data = new byte[length / 2]; 131 | for (int i = 0; i < length; i += 2) { 132 | data[i / 2] = (byte) ((Character.digit(string.charAt(i), 16) << 4) + Character 133 | .digit(string.charAt(i + 1), 16)); 134 | } 135 | return data; 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /src/java/connection/GenerateRandomString.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Subhadeep Dan 3 | * All Rights Reserved. 4 | */ 5 | package connection; 6 | 7 | public class GenerateRandomString { 8 | 9 | private static final String ALPHA_NUM 10 | = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 11 | 12 | public String getAlphaNumeric(int len) { 13 | StringBuffer sb = new StringBuffer(len); 14 | for (int i = 0; i < len; i++) { 15 | int ndx = (int) (Math.random() * ALPHA_NUM.length()); 16 | sb.append(ALPHA_NUM.charAt(ndx)); 17 | } 18 | return sb.toString(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/java/connection/dbConnection.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Subhadeep Dan 3 | * All Rights Reserved. 4 | */ 5 | package connection; 6 | 7 | import java.sql.PreparedStatement; 8 | import java.sql.Connection; 9 | import java.sql.DriverManager; 10 | 11 | public class dbConnection { 12 | 13 | static Connection con = null; 14 | PreparedStatement pst = null; 15 | 16 | public static Connection makeConnection() { 17 | try { 18 | Class.forName("com.mysql.jdbc.Driver").newInstance(); 19 | con = DriverManager.getConnection("jdbc:mysql://localhost:3306/cryptography", "root", ""); 20 | 21 | } catch (Exception e) { 22 | } 23 | return con; 24 | } 25 | } -------------------------------------------------------------------------------- /src/java/org/AdminLogin.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Varun Dhall 3 | * All Rights Reserved. 4 | */ 5 | package org; 6 | 7 | import java.io.IOException; 8 | import javax.servlet.ServletException; 9 | import javax.servlet.annotation.WebServlet; 10 | import javax.servlet.http.HttpServlet; 11 | import javax.servlet.http.HttpServletRequest; 12 | import javax.servlet.http.HttpServletResponse; 13 | import java.sql.Connection; 14 | import java.sql.PreparedStatement; 15 | import java.sql.ResultSet; 16 | import javax.servlet.http.HttpSession; 17 | 18 | 19 | @WebServlet(name = "AdminLogin", urlPatterns = {"/adminLogin"}) 20 | public class AdminLogin extends HttpServlet { 21 | 22 | static Connection con = null; 23 | PreparedStatement pst = null; 24 | ResultSet rs, rst = null; 25 | String userid = null; 26 | String name = null; 27 | String utype = null; 28 | String password = null; 29 | String result = ""; 30 | 31 | @Override 32 | protected void doPost(HttpServletRequest request, HttpServletResponse response) 33 | throws ServletException, IOException { 34 | 35 | HttpSession session = request.getSession(true); 36 | userid = request.getParameter("userid"); 37 | password = request.getParameter("password"); 38 | try { 39 | con = connection.dbConnection.makeConnection(); 40 | String query = "SELECT name,utype FROM users WHERE userid = '" + userid + "' AND user_otp = '" + password + "' AND u_status = '1'"; 41 | pst = con.prepareStatement(query); 42 | rst = pst.executeQuery(); 43 | if (rst.next()) { 44 | name = rst.getString(1); 45 | utype = rst.getString(2); 46 | 47 | session.setAttribute("ID", userid); 48 | session.setAttribute("NAME", name); 49 | session.setAttribute("UTYPE", utype); 50 | response.sendRedirect("myaccount.jsp"); 51 | 52 | } else { 53 | session.setAttribute("MSG", "Userid and password are wrong."); 54 | response.sendRedirect("adminlogin.jsp"); 55 | } 56 | } catch (Exception e) { 57 | e.printStackTrace(); 58 | session.setAttribute("MSG", "Userid and password are wrong."); 59 | response.sendRedirect("adminlogin.jsp"); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/java/org/DecryptedKey.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Subhadeep Dan 3 | * All Rights Reserved. 4 | */ 5 | package org; 6 | 7 | import static connection.ECC.decryptString; 8 | import static connection.ECC.hexToBytes; 9 | import java.io.IOException; 10 | import java.sql.Connection; 11 | import java.sql.PreparedStatement; 12 | import java.sql.ResultSet; 13 | import java.util.Base64; 14 | import javax.crypto.SecretKey; 15 | import javax.crypto.spec.SecretKeySpec; 16 | import javax.servlet.ServletException; 17 | import javax.servlet.annotation.WebServlet; 18 | import javax.servlet.http.HttpServlet; 19 | import javax.servlet.http.HttpServletRequest; 20 | import javax.servlet.http.HttpServletResponse; 21 | import javax.servlet.http.HttpSession; 22 | 23 | @WebServlet(name = "DecryptedKey", urlPatterns = {"/decryptedKey"}) 24 | 25 | public class DecryptedKey extends HttpServlet { 26 | 27 | Connection con = null; 28 | PreparedStatement pst = null; 29 | ResultSet rst = null; 30 | String userid = null; 31 | String secretekey = null; 32 | String secretU = null; 33 | String secretV = null; 34 | String email = null; 35 | int otp = 0; 36 | String fileid = null; 37 | String privatekey = null; 38 | 39 | int i = 0; 40 | 41 | @Override 42 | protected void doPost(HttpServletRequest request, HttpServletResponse response) 43 | throws ServletException, IOException { 44 | 45 | HttpSession session = request.getSession(true); 46 | //connection from database 47 | 48 | try { 49 | con = connection.dbConnection.makeConnection(); 50 | } catch (Exception e) { 51 | } 52 | 53 | fileid = request.getParameter("fileid"); 54 | String pubkey = request.getParameter("publickey"); 55 | 56 | try { 57 | String query = "SELECT privatekey,file_path,encrypted_aes_key FROM files WHERE privatekey = '" + pubkey + "' AND id = '" + fileid + "'"; 58 | System.out.println("query: " + query); 59 | pst = con.prepareStatement(query); 60 | rst = pst.executeQuery(); 61 | if (rst.next()) { 62 | privatekey = rst.getString(1); 63 | String file_path = rst.getString(2); 64 | String encrypted_aes_key = rst.getString(3); 65 | 66 | // decode the base64 encoded string 67 | String decryptedPlainText = null; 68 | byte[] desc = hexToBytes(encrypted_aes_key.toString()); 69 | decryptedPlainText = new String(desc, "UTF-8"); 70 | 71 | response.sendRedirect("download_file.jsp?filename=" + file_path + "&aes_key=" + decryptedPlainText); 72 | 73 | } else { 74 | session.setAttribute("MSG", "Please enter valid public key."); 75 | response.sendRedirect("keydescription.jsp?fileid=" + fileid); 76 | } 77 | } catch (Exception e) { 78 | e.printStackTrace(); 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/java/org/EmailUtility.java: -------------------------------------------------------------------------------- 1 | package org; 2 | 3 | import com.sun.mail.util.MailSSLSocketFactory; 4 | import java.security.GeneralSecurityException; 5 | import java.util.Date; 6 | import java.util.Properties; 7 | import java.util.logging.Level; 8 | import java.util.logging.Logger; 9 | import javax.mail.Authenticator; 10 | import javax.mail.Message; 11 | import javax.mail.MessagingException; 12 | import javax.mail.PasswordAuthentication; 13 | import javax.mail.Session; 14 | import javax.mail.Transport; 15 | import javax.mail.internet.AddressException; 16 | import javax.mail.internet.InternetAddress; 17 | import javax.mail.internet.MimeMessage; 18 | 19 | public class EmailUtility { 20 | 21 | public static void sendEmail(String host, String port, 22 | final String userName, final String password, String toAddress, 23 | String subject, String message) throws AddressException, 24 | MessagingException { 25 | 26 | // sets SMTP server properties 27 | Properties properties = new Properties(); 28 | properties.put("mail.smtp.host", host); 29 | properties.put("mail.smtp.port", port); 30 | properties.put("mail.smtp.auth", "true"); 31 | properties.put("mail.smtp.starttls.enable", "true"); 32 | 33 | MailSSLSocketFactory sf; 34 | try { 35 | sf = new MailSSLSocketFactory(); 36 | sf.setTrustAllHosts(true); 37 | properties.put("mail.smtp.ssl.socketFactory", sf); 38 | } catch (GeneralSecurityException ex) { 39 | Logger.getLogger(EmailUtility.class.getName()).log(Level.SEVERE, null, ex); 40 | } 41 | 42 | // creates a new session with an authenticator 43 | Authenticator auth = new Authenticator() { 44 | public PasswordAuthentication getPasswordAuthentication() { 45 | return new PasswordAuthentication(userName, password); 46 | } 47 | }; 48 | 49 | Session session = Session.getInstance(properties, auth); 50 | 51 | // creates a new e-mail message 52 | Message msg = new MimeMessage(session); 53 | 54 | msg.setFrom(new InternetAddress(userName)); 55 | InternetAddress[] toAddresses = {new InternetAddress(toAddress)}; 56 | msg.setRecipients(Message.RecipientType.TO, toAddresses); 57 | msg.setSubject(subject); 58 | msg.setSentDate(new Date()); 59 | msg.setText(message); 60 | 61 | // sends the e-mail 62 | Transport.send(msg); 63 | 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/java/org/FirstLogin.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Subhadeep Dan 3 | * All Rights Reserved. 4 | */ 5 | package org; 6 | 7 | import java.io.IOException; 8 | import java.math.BigInteger; 9 | import java.sql.Connection; 10 | import java.sql.PreparedStatement; 11 | import java.sql.ResultSet; 12 | import javax.servlet.ServletException; 13 | import javax.servlet.annotation.WebServlet; 14 | import javax.servlet.http.HttpServlet; 15 | import javax.servlet.http.HttpServletRequest; 16 | import javax.servlet.http.HttpServletResponse; 17 | import javax.servlet.http.HttpSession; 18 | 19 | 20 | @WebServlet(name = "FirstLogin", urlPatterns = {"/firstLogin"}) 21 | public class FirstLogin extends HttpServlet { 22 | 23 | static Connection con = null; 24 | PreparedStatement pst = null; 25 | ResultSet rs, rst = null; 26 | String reg_id = null; 27 | String name = null; 28 | String utype = null; 29 | String otp = null; 30 | String result = ""; 31 | String system_key = null; 32 | String user_id = null; 33 | 34 | @Override 35 | protected void doPost(HttpServletRequest request, HttpServletResponse response) 36 | throws ServletException, IOException { 37 | 38 | HttpSession session = request.getSession(true); 39 | reg_id = request.getParameter("userid"); 40 | otp = request.getParameter("otp"); 41 | system_key = request.getParameter("secretekey"); 42 | 43 | try { 44 | con = connection.dbConnection.makeConnection(); 45 | String query = "SELECT name,utype FROM users WHERE userid = '" + reg_id + "' AND user_otp = '" + otp + "' AND u_status = '1'"; 46 | pst = con.prepareStatement(query); 47 | rst = pst.executeQuery(); 48 | if (rst.next()) { 49 | name = rst.getString(1); 50 | utype = rst.getString(2); 51 | session.setAttribute("ID", reg_id); 52 | session.setAttribute("NAME", name); 53 | session.setAttribute("UTYPE", utype); 54 | 55 | /*Self generated algorithm */ 56 | String key = system_key.substring(0, 3); 57 | String text = key + reg_id; 58 | byte[] fooBytes = text.getBytes(); 59 | BigInteger ciper = new BigInteger(fooBytes); 60 | 61 | //update table 62 | String query_update = "UPDATE users SET gen_user_id = '" + ciper + "' WHERE userid = '" + reg_id + "'"; 63 | pst = con.prepareStatement(query_update); 64 | pst.executeUpdate(); 65 | response.sendRedirect("sucess_registration.jsp?userid=" + ciper); 66 | 67 | } else { 68 | session.setAttribute("MSG", "Userid and otp are wrong."); 69 | response.sendRedirect("secretkey.jsp?userid=" + reg_id + "&secretkey=" + system_key); 70 | } 71 | } catch (Exception e) { 72 | session.setAttribute("MSG", "Userid does not exits."); 73 | response.sendRedirect("secretkey.jsp?userid=" + reg_id + "&secretkey=" + system_key); 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/java/org/GenerateOTP.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Subhadeep Dan 3 | * All Rights Reserved. 4 | */ 5 | package org; 6 | 7 | import java.io.IOException; 8 | import java.io.PrintWriter; 9 | import java.math.BigInteger; 10 | import java.sql.Connection; 11 | import java.sql.PreparedStatement; 12 | import java.sql.ResultSet; 13 | import java.text.SimpleDateFormat; 14 | import java.util.Date; 15 | import java.util.Random; 16 | import javax.servlet.ServletException; 17 | import javax.servlet.annotation.WebServlet; 18 | import javax.servlet.http.HttpServlet; 19 | import javax.servlet.http.HttpServletRequest; 20 | import javax.servlet.http.HttpServletResponse; 21 | 22 | 23 | @WebServlet(name = "GenerateOTP", urlPatterns = {"/generateOTP"}) 24 | public class GenerateOTP extends HttpServlet { 25 | 26 | Connection con = null; 27 | PreparedStatement pst = null; 28 | ResultSet rs, rst = null; 29 | String userid = null; 30 | String email = null; 31 | String result = ""; 32 | int otp = 0; 33 | int i = 0; 34 | String host = "smtp.gmail.com"; 35 | String port = "587"; 36 | 37 | String userName = "securecloudsimulation@gmail.com"; 38 | String password = "SecureCloud123"; 39 | 40 | @Override 41 | protected void doPost(HttpServletRequest request, HttpServletResponse response) 42 | throws ServletException, IOException { 43 | 44 | response.setContentType("text/xml"); 45 | PrintWriter out = response.getWriter(); 46 | //connection from database 47 | try { 48 | con = connection.dbConnection.makeConnection(); 49 | } catch (Exception e) { 50 | } 51 | 52 | userid = request.getParameter("userid"); 53 | 54 | //Generate random no 55 | Random rand = new Random(); 56 | otp = rand.nextInt((999999 - 100000) + 1) + 100000; 57 | 58 | /*Self generated algorithm */ 59 | BigInteger ciphertxt = new BigInteger(userid); 60 | byte[] byteArray2 = ciphertxt.toByteArray(); 61 | String s2 = new String(byteArray2); 62 | userid = s2.substring(3, s2.length()); 63 | 64 | //send email to user 65 | try { 66 | String query = "SELECT email FROM users WHERE userid = '" + userid + "' AND u_status = '1'"; 67 | pst = con.prepareStatement(query); 68 | rst = pst.executeQuery(); 69 | if (rst.next()) { 70 | email = rst.getString(1); 71 | System.out.println("email: " + email); 72 | String subject = "OTP from Secure Cloud using ECC"; 73 | String message = "Your OTP is " + otp; 74 | //Send email 75 | try { 76 | EmailUtility.sendEmail(host, port, userName, password, email, subject, 77 | message); 78 | // resultMessage = "The e-mail was sent successfully"; 79 | } catch (Exception ex) { 80 | ex.printStackTrace(); 81 | //resultMessage = "There were an error: " + ex.getMessage(); 82 | } 83 | 84 | } else { 85 | result = "Your user id does not exits."; 86 | } 87 | } catch (Exception e) { 88 | e.printStackTrace(); 89 | } 90 | 91 | //Check user is today generate otp or not 92 | //check otp is exits or not 93 | try { 94 | 95 | Date dNow = new Date(); 96 | SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd"); 97 | String curDate = ft.format(dNow); 98 | 99 | String mysql_query = "SELECT * FROM user_login WHERE userid = '" + userid + "' AND created = '" + curDate + "'"; 100 | pst = con.prepareStatement(mysql_query); 101 | rs = pst.executeQuery(); 102 | if (rs.next()) { 103 | String mysqlupdate = "UPDATE user_login set otp = '" + otp + "' WHERE userid = '" + userid + "' AND created = '" + curDate + "'"; 104 | pst = con.prepareStatement(mysqlupdate); 105 | i = pst.executeUpdate(); 106 | if (i > 0) { 107 | result = "OTP has been successfully sent to your registered email id."; 108 | } else { 109 | result = "OTP has not been generated, Please try again."; 110 | } 111 | } else { 112 | String sqlquery = "INSERT INTO user_login(userid,otp,created) VALUES(?,?,NOW())"; 113 | pst = con.prepareStatement(sqlquery); 114 | pst.setString(1, userid); 115 | pst.setInt(2, otp); 116 | i = pst.executeUpdate(); 117 | if (i > 0) { 118 | result = "OTP has been successfully sent to your registered email id."; 119 | } else { 120 | result = "OTP has not been generated, Please try again."; 121 | } 122 | } 123 | } catch (Exception e) { 124 | e.printStackTrace(); 125 | } 126 | 127 | out.write("" + result + ""); 128 | 129 | } 130 | 131 | } 132 | -------------------------------------------------------------------------------- /src/java/org/KeyGeneration.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Subhadeep Dan 3 | * All Rights Reserved. 4 | */ 5 | package org; 6 | 7 | import java.io.IOException; 8 | import java.math.BigInteger; 9 | import java.security.KeyPair; 10 | import java.security.KeyPairGenerator; 11 | import java.security.PrivateKey; 12 | import java.security.PublicKey; 13 | import java.security.spec.ECGenParameterSpec; 14 | import java.sql.Connection; 15 | import java.sql.PreparedStatement; 16 | import java.sql.ResultSet; 17 | import java.util.Random; 18 | import javax.crypto.KeyAgreement; 19 | import javax.servlet.ServletException; 20 | import javax.servlet.annotation.WebServlet; 21 | import javax.servlet.http.HttpServlet; 22 | import javax.servlet.http.HttpServletRequest; 23 | import javax.servlet.http.HttpServletResponse; 24 | import javax.servlet.http.HttpSession; 25 | 26 | 27 | @WebServlet(name = "KeyGeneration", urlPatterns = {"/keyGeneration"}) 28 | public class KeyGeneration extends HttpServlet { 29 | 30 | Connection con = null; 31 | PreparedStatement pst = null; 32 | ResultSet rst = null; 33 | String userid = null; 34 | String secretekey = null; 35 | String secretU = null; 36 | String secretV = null; 37 | String email = null; 38 | int otp = 0; 39 | String host = "smtp.gmail.com"; 40 | String port = "587"; 41 | String userName = "securecloudsimulation@gmail.com"; 42 | String password = "SecureCloud123"; 43 | 44 | int i = 0; 45 | 46 | @Override 47 | protected void doPost(HttpServletRequest request, HttpServletResponse response) 48 | throws ServletException, IOException { 49 | 50 | HttpSession session = request.getSession(true); 51 | //connection from database 52 | try { 53 | con = connection.dbConnection.makeConnection(); 54 | } catch (Exception e) { 55 | } 56 | 57 | userid = request.getParameter("userid"); 58 | secretekey = request.getParameter("secretkey"); 59 | 60 | //Generation ECC Key Agreement 61 | try { 62 | KeyPairGenerator kpg; 63 | kpg = KeyPairGenerator.getInstance("EC", "SunEC"); 64 | ECGenParameterSpec ecsp; 65 | //String parameter = "sect113r2"; 66 | ecsp = new ECGenParameterSpec(secretekey); 67 | kpg.initialize(ecsp); 68 | KeyPair kpU = kpg.genKeyPair(); 69 | PrivateKey privKeyU = kpU.getPrivate(); 70 | PublicKey pubKeyU = kpU.getPublic(); 71 | KeyPair kpV = kpg.genKeyPair(); 72 | PrivateKey privKeyV = kpV.getPrivate(); 73 | PublicKey pubKeyV = kpV.getPublic(); 74 | KeyAgreement ecdhU = KeyAgreement.getInstance("ECDH"); 75 | ecdhU.init(privKeyU); 76 | ecdhU.doPhase(pubKeyV, true); 77 | KeyAgreement ecdhV = KeyAgreement.getInstance("ECDH"); 78 | ecdhV.init(privKeyV); 79 | ecdhV.doPhase(pubKeyU, true); 80 | secretU = new BigInteger(1, ecdhU.generateSecret()).toString(16).toUpperCase(); 81 | secretV = new BigInteger(1, ecdhV.generateSecret()).toString(16).toUpperCase(); 82 | 83 | } catch (Exception e) { 84 | e.printStackTrace(); 85 | } 86 | 87 | //Generate random no 88 | Random rand = new Random(); 89 | otp = rand.nextInt((999999 - 100000) + 1) + 100000; 90 | 91 | try { 92 | String query = "SELECT email FROM users WHERE userid = '" + userid + "' AND u_status = '1'"; 93 | pst = con.prepareStatement(query); 94 | rst = pst.executeQuery(); 95 | if (rst.next()) { 96 | email = rst.getString(1); 97 | String subject = "OTP from Secure Cloud using ECC"; 98 | String message = "Your OTP is " + otp; 99 | //Send email 100 | try { 101 | EmailUtility.sendEmail(host, port, userName, password, email, subject, 102 | message); 103 | // resultMessage = "The e-mail was sent successfully"; 104 | } catch (Exception ex) { 105 | ex.printStackTrace(); 106 | //resultMessage = "There were an error: " + ex.getMessage(); 107 | } 108 | 109 | } else { 110 | session.setAttribute("MSG", "Secret key has not been generated."); 111 | //response.sendRedirect("keyexchange.jsp?userid=" + userid); 112 | } 113 | } catch (Exception e) { 114 | } 115 | 116 | try { 117 | String sqlquery = "update users set user_key=?,secretu=?,user_otp=? where userid = '" + userid + "'"; 118 | pst = con.prepareStatement(sqlquery); 119 | pst.setString(1, secretekey); 120 | pst.setString(2, secretU); 121 | pst.setInt(3, otp); 122 | i = pst.executeUpdate(); 123 | } catch (Exception e) { 124 | e.printStackTrace(); 125 | } 126 | 127 | //success or failure message 128 | if (i > 0) { 129 | session.setAttribute("MSG", "ECDH Key agreement has been successfully generated."); 130 | response.sendRedirect("secretkey.jsp?userid=" + userid + "&secretkey=" + secretU); 131 | } else { 132 | session.setAttribute("MSG", "Secret key has not been generated."); 133 | response.sendRedirect("keyexchange.jsp?userid=" + userid); 134 | } 135 | 136 | } 137 | 138 | } 139 | -------------------------------------------------------------------------------- /src/java/org/Login.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Subhadeep Dan 3 | * All Rights Reserved. 4 | */ 5 | package org; 6 | 7 | import java.io.IOException; 8 | import java.math.BigInteger; 9 | import javax.servlet.ServletException; 10 | import javax.servlet.annotation.WebServlet; 11 | import javax.servlet.http.HttpServlet; 12 | import javax.servlet.http.HttpServletRequest; 13 | import javax.servlet.http.HttpServletResponse; 14 | import java.sql.Connection; 15 | import java.sql.PreparedStatement; 16 | import java.sql.ResultSet; 17 | import java.text.SimpleDateFormat; 18 | import java.util.Date; 19 | import javax.servlet.http.HttpSession; 20 | 21 | 22 | @WebServlet(name = "Login", urlPatterns = {"/login"}) 23 | public class Login extends HttpServlet { 24 | 25 | static Connection con = null; 26 | PreparedStatement pst = null; 27 | ResultSet rs, rst = null; 28 | String userid = null; 29 | String name = null; 30 | String utype = null; 31 | String otp = null; 32 | String result = ""; 33 | 34 | @Override 35 | protected void doPost(HttpServletRequest request, HttpServletResponse response) 36 | throws ServletException, IOException { 37 | 38 | HttpSession session = request.getSession(true); 39 | userid = request.getParameter("userid"); 40 | otp = request.getParameter("otp"); 41 | 42 | /*Self generated algorithm */ 43 | BigInteger ciphertxt = new BigInteger(userid); 44 | byte[] byteArray2 = ciphertxt.toByteArray(); 45 | String s2 = new String(byteArray2); 46 | userid = s2.substring(3, s2.length()); 47 | 48 | 49 | 50 | try { 51 | con = connection.dbConnection.makeConnection(); 52 | String query = "SELECT name,utype FROM users WHERE userid = '" + userid + "' AND u_status = '1'"; 53 | pst = con.prepareStatement(query); 54 | rst = pst.executeQuery(); 55 | if (rst.next()) { 56 | name = rst.getString(1); 57 | utype = rst.getString(2); 58 | 59 | //check otp is exits or not 60 | try { 61 | 62 | Date dNow = new Date(); 63 | SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd"); 64 | String curDate = ft.format(dNow); 65 | 66 | String mysql_query = "SELECT * FROM user_login WHERE userid = '" + userid + "' AND otp = '" + otp + "' AND created = '" + curDate + "'"; 67 | pst = con.prepareStatement(mysql_query); 68 | rs = pst.executeQuery(); 69 | if (rs.next()) { 70 | session.setAttribute("ID", userid); 71 | session.setAttribute("NAME", name); 72 | session.setAttribute("UTYPE", utype); 73 | response.sendRedirect("myaccount.jsp"); 74 | } else { 75 | session.setAttribute("MSG", "OTP is wrong. Please try again."); 76 | response.sendRedirect("login.jsp"); 77 | } 78 | } catch (Exception e) { 79 | } 80 | 81 | } else { 82 | session.setAttribute("MSG", "Userid does not exits."); 83 | response.sendRedirect("login.jsp"); 84 | } 85 | } catch (Exception e) { 86 | session.setAttribute("MSG", "Userid does not exits."); 87 | response.sendRedirect("login.jsp"); 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/java/org/Logout.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Subhadeep Dan 3 | * All Rights Reserved. 4 | */ 5 | package org; 6 | 7 | import java.io.IOException; 8 | import javax.servlet.RequestDispatcher; 9 | import javax.servlet.ServletException; 10 | import javax.servlet.annotation.WebServlet; 11 | import javax.servlet.http.HttpServlet; 12 | import javax.servlet.http.HttpServletRequest; 13 | import javax.servlet.http.HttpServletResponse; 14 | import javax.servlet.http.HttpSession; 15 | 16 | @WebServlet(name = "Logout", urlPatterns = {"/logout"}) 17 | public class Logout extends HttpServlet { 18 | 19 | @Override 20 | protected void doGet(HttpServletRequest request, HttpServletResponse response) 21 | throws ServletException, IOException { 22 | 23 | HttpSession session = request.getSession(); 24 | session.setAttribute("ID", null); 25 | session.setAttribute("UTYPE", null); 26 | session.setAttribute("NAME", null); 27 | session.setAttribute("MSG", null); 28 | session.removeAttribute("ID"); 29 | session.removeAttribute("UTYPE"); 30 | session.removeAttribute("NAME"); 31 | session.removeAttribute("MSG"); 32 | session.invalidate(); 33 | HttpSession sess = request.getSession(true); 34 | sess.setAttribute("LOGIN", "Logout Successfuly !!"); 35 | RequestDispatcher rd = request.getRequestDispatcher("login.jsp"); 36 | rd.forward(request, response); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/java/org/MyAccount.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Subhadeep Dan 3 | * All Rights Reserved. 4 | */ 5 | package org; 6 | 7 | import java.io.*; 8 | import java.sql.Connection; 9 | import java.sql.PreparedStatement; 10 | import java.sql.ResultSet; 11 | import javax.servlet.ServletException; 12 | import javax.servlet.annotation.WebServlet; 13 | import javax.servlet.http.HttpServlet; 14 | import javax.servlet.http.HttpServletRequest; 15 | import javax.servlet.http.HttpServletResponse; 16 | import javax.servlet.http.HttpSession; 17 | 18 | 19 | @WebServlet(name = "MyAccount", urlPatterns = {"/myAccount"}) 20 | public class MyAccount extends HttpServlet { 21 | 22 | static Connection con = null; 23 | PreparedStatement pst = null; 24 | ResultSet rst = null; 25 | String name = null; 26 | String email = null; 27 | String mobile = null; 28 | String dob = null; 29 | String gender = null; 30 | String id = null; 31 | int i = 0; 32 | 33 | @Override 34 | protected void doPost(HttpServletRequest request, HttpServletResponse response) 35 | throws ServletException, IOException { 36 | 37 | HttpSession session = request.getSession(true); 38 | 39 | 40 | //connection from database 41 | try { 42 | con = connection.dbConnection.makeConnection(); 43 | } catch (Exception e) { 44 | } 45 | 46 | name = request.getParameter("name"); 47 | email = request.getParameter("email"); 48 | gender = request.getParameter("gender"); 49 | dob = request.getParameter("dob"); 50 | mobile = request.getParameter("mobile"); 51 | id = (String) session.getAttribute("ID"); 52 | 53 | try { 54 | String sqlquery = "update users set name=?,email=?,gender=?,dob=?,mobile=? where userid = '" + id + "'"; 55 | pst = con.prepareStatement(sqlquery); 56 | pst.setString(1, name); 57 | pst.setString(2, email); 58 | pst.setString(3, gender); 59 | pst.setString(4, dob); 60 | pst.setString(5, mobile); 61 | i = pst.executeUpdate(); 62 | } catch (Exception e) { 63 | e.printStackTrace(); 64 | } 65 | 66 | //success or failure message 67 | if (i > 0) { 68 | 69 | session.setAttribute("MSG", "Your profile has been successfully update."); 70 | response.sendRedirect("myaccount.jsp"); 71 | } else { 72 | session.setAttribute("MSG", "Your profile has not been update."); 73 | response.sendRedirect("myaccount.jsp"); 74 | } 75 | 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/java/org/Register.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Subhadeep Dan 3 | * All Rights Reserved. 4 | */ 5 | package org; 6 | 7 | import java.io.*; 8 | import java.sql.Connection; 9 | import java.sql.PreparedStatement; 10 | import java.sql.ResultSet; 11 | import javax.servlet.ServletConfig; 12 | import javax.servlet.ServletException; 13 | import javax.servlet.annotation.WebServlet; 14 | import javax.servlet.http.HttpServlet; 15 | import javax.servlet.http.HttpServletRequest; 16 | import javax.servlet.http.HttpServletResponse; 17 | import javax.servlet.http.HttpSession; 18 | 19 | @WebServlet(name = "Register", urlPatterns = {"/register"}) 20 | public class Register extends HttpServlet { 21 | 22 | static Connection con = null; 23 | PreparedStatement pst = null; 24 | ResultSet rst = null; 25 | String name = null; 26 | String email = null; 27 | String mobile = null; 28 | String dob = null; 29 | String gender = null; 30 | String userid = null; 31 | int i = 0; 32 | 33 | @Override 34 | protected void doGet(HttpServletRequest request, HttpServletResponse response) 35 | throws ServletException, IOException { 36 | 37 | userid = request.getParameter("reg_id"); 38 | HttpSession session = request.getSession(true); 39 | 40 | try { 41 | con = connection.dbConnection.makeConnection(); 42 | String query = "delete from users WHERE userid= '" + userid + "' "; 43 | pst = con.prepareStatement(query); 44 | i = pst.executeUpdate(); 45 | 46 | } catch (Exception e) { 47 | } 48 | 49 | if (i > 0) { 50 | session.setAttribute("MSG", "User has been successfuly deleted !!"); 51 | response.sendRedirect("usrelist.jsp"); 52 | } else { 53 | session.setAttribute("MSG", "User has not been deleted !!"); 54 | response.sendRedirect("usrelist.jsp"); 55 | } 56 | } 57 | 58 | @Override 59 | protected void doPost(HttpServletRequest request, HttpServletResponse response) 60 | throws ServletException, IOException { 61 | 62 | HttpSession session = request.getSession(true); 63 | PrintWriter out = response.getWriter(); 64 | response.setContentType("text/html"); 65 | ServletConfig config = getServletConfig(); 66 | String context = config.getServletContext().getRealPath("/"); 67 | 68 | //connection from database 69 | try { 70 | con = connection.dbConnection.makeConnection(); 71 | } catch (Exception e) { 72 | } 73 | 74 | userid = connection.AutoID.globalGenId("registration"); 75 | name = request.getParameter("name"); 76 | email = request.getParameter("email"); 77 | mobile = request.getParameter("mobile"); 78 | dob = request.getParameter("dob"); 79 | gender = request.getParameter("gender"); 80 | 81 | try { 82 | String sqlquery = "INSERT INTO users(userid,name,email,mobile,dob,gender,created) VALUES(?,?,?,?,?,?, NOW())"; 83 | pst = con.prepareStatement(sqlquery); 84 | pst.setString(1, userid); 85 | pst.setString(2, name); 86 | pst.setString(3, email); 87 | pst.setString(4, mobile); 88 | pst.setString(5, dob); 89 | pst.setString(6, gender); 90 | i = pst.executeUpdate(); 91 | 92 | } catch (Exception e) { 93 | e.printStackTrace();; 94 | } 95 | 96 | if (i > 0) { 97 | connection.AutoID.updateAutoID("registration", userid); 98 | response.sendRedirect("keyexchange.jsp?userid=" + userid); 99 | } else { 100 | session.setAttribute("MSG", "Your data has not been registered."); 101 | response.sendRedirect("register.jsp"); 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /web/META-INF/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /web/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | /securecloud 5 | 6 | 7 | 8 | Keep a copy of the generated servlet class' java code. 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /web/adminlogin.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : adminlogin 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | 7 | 8 | 9 | 10 | Login - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 11 | 12 | 29 | 30 | 31 | 32 | 33 | 36 | 37 | 38 | 89 | 90 | 91 | 94 | 95 |
34 | <%@include file="header.jsp" %> 35 |
39 |
40 |
41 | 42 | 43 | 48 | 49 | <% 50 | String msg = null; 51 | msg = (String) session.getAttribute("MSG"); 52 | if (msg != null) { 53 | %> 54 | 55 | 56 | 57 | <% 58 | session.removeAttribute("MSG"); 59 | } else { 60 | session.setAttribute("MSG", ""); 61 | 62 | } 63 | %> 64 | 65 | 68 | 69 | 70 | 71 | 72 | 73 | 76 | 77 | 78 | 79 | 80 | 81 | 84 | 85 |
44 |
45 | Login 46 |
47 |
<%=msg%>
66 | Userid 67 |
74 | Password 75 |
82 | 83 |
86 |
87 |
88 |
96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /web/description.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : description 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | 7 | 8 | <% response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1 9 | response.setHeader("Pragma", "no-cache"); //HTTP 1.0 10 | response.setDateHeader("Expires", 0); //prevents caching at the proxy server 11 | response.setHeader("Cache-Control", "no-store"); //HTTP 1.1 12 | String id = null; 13 | id = (String) session.getAttribute("ID"); 14 | if (id != null) { 15 | %> 16 | 17 | 18 | 19 | Decryption - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 20 | 21 | 22 | 38 | 39 | 40 | 41 | 42 | 45 | 46 | 47 | 88 | 89 | 90 | 93 | 94 |
43 | <%@include file="header.jsp" %> 44 |
48 |
49 |
50 | 51 | 52 | 57 | 58 | <% 59 | String msg = null; 60 | msg = (String) session.getAttribute("MSG"); 61 | if (msg != null) { 62 | %> 63 | 64 | 65 | 66 | <% 67 | session.removeAttribute("MSG"); 68 | } else { 69 | session.setAttribute("MSG", ""); 70 | 71 | } 72 | %> 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 83 | 84 |
53 |
54 | Decryption 55 |
56 |
<%=msg%>
81 | 82 |
85 |
86 |
87 |
95 | 96 | 97 | <% } else { 98 | session.setAttribute("MSG", "You must be login."); 99 | response.sendRedirect("login.jsp"); 100 | } 101 | %> -------------------------------------------------------------------------------- /web/download.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : download 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | 7 | 8 | <% response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1 9 | response.setHeader("Pragma", "no-cache"); //HTTP 1.0 10 | response.setDateHeader("Expires", 0); //prevents caching at the proxy server 11 | response.setHeader("Cache-Control", "no-store"); //HTTP 1.1 12 | String id = null; 13 | id = (String) session.getAttribute("ID"); 14 | if (id != null) { 15 | %> 16 | 17 | 18 | 19 | Download - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 20 | 21 | 22 | 23 | 24 | 25 | 28 | 29 | 30 | 55 | 56 | 57 | 60 | 61 |
26 | <%@include file="header.jsp" %> 27 |
31 |
32 |
33 | 34 | 35 | 40 | 41 | 42 | 49 | 50 | 51 |
36 |
37 | Download 38 |
39 |
43 | <% 44 | String filename = request.getParameter("filename"); 45 | %> 46 | Your file has been successfully decrypted.

47 | Click here to download decrypted file

48 |
52 |
53 |
54 |
62 | 63 | 64 | <% } else { 65 | session.setAttribute("MSG", "You must be login."); 66 | response.sendRedirect("login.jsp"); 67 | } 68 | %> -------------------------------------------------------------------------------- /web/download_file.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : download 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | 7 | 8 | <% response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1 9 | response.setHeader("Pragma", "no-cache"); //HTTP 1.0 10 | response.setDateHeader("Expires", 0); //prevents caching at the proxy server 11 | response.setHeader("Cache-Control", "no-store"); //HTTP 1.1 12 | String id = null; 13 | id = (String) session.getAttribute("ID"); 14 | if (id != null) { 15 | %> 16 | 17 | 18 | 19 | Download - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 20 | 21 | 22 | 23 | 24 | 25 | 28 | 29 | 30 | 56 | 57 | 58 | 61 | 62 |
26 | <%@include file="header.jsp" %> 27 |
31 |
32 |
33 | 34 | 35 | 40 | 41 | 42 | 50 | 51 | 52 |
36 |
37 | Download 38 |
39 |
43 | <% 44 | String filename = request.getParameter("filename"); 45 | String aes_key = request.getParameter("aes_key"); 46 | %> 47 | Your AES key has been successfully decrypted.
Your AES KEY is <%=aes_key%>
48 | Click here to download encrypted file

49 |
53 |
54 |
55 |
63 | 64 | 65 | <% } else { 66 | session.setAttribute("MSG", "You must be login."); 67 | response.sendRedirect("login.jsp"); 68 | } 69 | %> -------------------------------------------------------------------------------- /web/downloadfile.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : downloadfile 3 | Author : Subhadeep Dan 4 | --%> 5 | 6 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 7 | <%@page import="java.sql.Connection"%> 8 | <%@page import="java.sql.Statement"%> 9 | <%@page import="java.sql.ResultSet"%> 10 | 11 | <% 12 | Connection conn = null; 13 | Statement st = null; 14 | ResultSet result = null; 15 | response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1 16 | response.setHeader("Pragma", "no-cache"); //HTTP 1.0 17 | response.setDateHeader("Expires", 0); //prevents caching at the proxy server 18 | response.setHeader("Cache-Control", "no-store"); //HTTP 1.1 19 | String id = null; 20 | id = (String) session.getAttribute("ID"); 21 | if (id != null) { 22 | %> 23 | 24 | 25 | 26 | Download File - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 103 | 104 | 105 | 108 | 109 |
33 | <%@include file="header.jsp" %> 34 |
38 | 39 | 40 | 45 | 46 | <% 47 | String msg = null; 48 | msg = (String) session.getAttribute("MSG"); 49 | if (msg != null) { 50 | %> 51 | 52 | 55 | 56 | <% 57 | session.removeAttribute("MSG"); 58 | } else { 59 | session.setAttribute("MSG", ""); 60 | 61 | } 62 | %> 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | <% 71 | int i = 0; 72 | try { 73 | conn = connection.dbConnection.makeConnection(); 74 | String query = "SELECT id,file_name,file_path,created FROM files WHERE userid='" + id + "' ORDER BY id DESC"; 75 | st = conn.prepareStatement(query); 76 | result = st.executeQuery(query); 77 | while (result.next()) { 78 | String fileid = result.getString(1); 79 | String fname = result.getString(2); 80 | String filepath = result.getString(3); 81 | String adding_date = result.getString(4); 82 | i++; 83 | %> 84 | 85 | 86 | 87 | 88 | 91 | 94 | 95 | <% } 96 | 97 | } catch (Exception e) { 98 | e.printStackTrace(); 99 | } 100 | %> 101 |
41 |
42 | Download File 43 |
44 |
53 |
<%=msg%>
54 |
S.NoFile NameAdding DateDownloadDelete
<%=i%>.<%=fname%><%=adding_date%>. 89 | Download 90 | 92 | Delete 93 |
102 |
110 | 111 | 112 | <% } else { 113 | session.setAttribute("MSG", "You must be login."); 114 | response.sendRedirect("login.jsp"); 115 | } 116 | %> -------------------------------------------------------------------------------- /web/encryption.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : encryption 3 | Author : Subhadeep Dan 4 | --%> 5 | 6 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 7 | 8 | <% 9 | response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1 10 | response.setHeader("Pragma", "no-cache"); //HTTP 1.0 11 | response.setDateHeader("Expires", 0); //prevents caching at the proxy server 12 | response.setHeader("Cache-Control", "no-store"); //HTTP 1.1 13 | String id = null; 14 | id = (String) session.getAttribute("ID"); 15 | if (id != null) { 16 | %> 17 | 18 | 19 | 20 | Encryption - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 21 | 22 | 23 | 41 | 42 | 43 | 44 | 45 | 48 | 49 | 50 | 91 | 92 | 93 | 96 | 97 |
46 | <%@include file="header.jsp" %> 47 |
51 |
52 |
53 | 54 | 55 | 60 | 61 | <% 62 | String msg = null; 63 | msg = (String) session.getAttribute("MSG"); 64 | if (msg != null) { 65 | %> 66 | 67 | 68 | 69 | <% 70 | session.removeAttribute("MSG"); 71 | } else { 72 | session.setAttribute("MSG", ""); 73 | 74 | } 75 | %> 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 86 | 87 |
56 |
57 | Encryption 58 |
59 |
<%=msg%>
84 | 85 |
88 |
89 |
90 |
98 | 99 | 100 | <% } else { 101 | session.setAttribute("MSG", "You must be login."); 102 | response.sendRedirect("login.jsp"); 103 | } 104 | %> -------------------------------------------------------------------------------- /web/filelist.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : filelist 3 | Author : Subhadeep Dan 4 | --%> 5 | 6 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 7 | <%@page import="java.sql.Connection"%> 8 | <%@page import="java.sql.Statement"%> 9 | <%@page import="java.sql.ResultSet"%> 10 | 11 | <% 12 | Connection conn = null; 13 | Statement st = null; 14 | ResultSet result = null; 15 | response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1 16 | response.setHeader("Pragma", "no-cache"); //HTTP 1.0 17 | response.setDateHeader("Expires", 0); //prevents caching at the proxy server 18 | response.setHeader("Cache-Control", "no-store"); //HTTP 1.1 19 | String id = null; 20 | id = (String) session.getAttribute("ID"); 21 | if (id != null) { 22 | %> 23 | 24 | 25 | 26 | File List- Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 103 | 104 | 105 | 108 | 109 |
33 | <%@include file="header.jsp" %> 34 |
38 | 39 | 40 | 45 | 46 | <% 47 | String msg = null; 48 | msg = (String) session.getAttribute("MSG"); 49 | if (msg != null) { 50 | %> 51 | 52 | 55 | 56 | <% 57 | session.removeAttribute("MSG"); 58 | } else { 59 | session.setAttribute("MSG", ""); 60 | 61 | } 62 | %> 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | <% 71 | int i = 0; 72 | try { 73 | conn = connection.dbConnection.makeConnection(); 74 | String query = "SELECT u.name,f.id,f.file_name,f.created,f.file_path FROM users u, files f WHERE u.userid = f.userid ORDER BY f.id DESC"; 75 | st = conn.prepareStatement(query); 76 | result = st.executeQuery(query); 77 | while (result.next()) { 78 | 79 | String username = result.getString(1); 80 | String fileid = result.getString(2); 81 | String fname = result.getString(3); 82 | String adding_date = result.getString(4); 83 | String file_path = result.getString(5); 84 | i++; 85 | %> 86 | 87 | 88 | 89 | 90 | 91 | 94 | 95 | <% } 96 | 97 | } catch (Exception e) { 98 | e.printStackTrace(); 99 | } 100 | %> 101 |
41 |
42 | File List 43 |
44 |
53 |
<%=msg%>
54 |
S.NoUser NameFile NameDateDelete
<%=i%>.<%=username%><%=fname%><%=adding_date%>. 92 | Delete 93 |
102 |
110 | 111 | 112 | <% } else { 113 | session.setAttribute("MSG", "You must be login."); 114 | response.sendRedirect("login.jsp"); 115 | } 116 | %>%> -------------------------------------------------------------------------------- /web/footer.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : footer 3 | Author : Subhadeep Dan 4 | --%> 5 | Design & Developed By: Subhadeep Dan, Vikash Kumar & Ankit Mishra -------------------------------------------------------------------------------- /web/header.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 8 | 9 | <% 10 | if (null != session.getAttribute("UTYPE")) { 11 | %> 12 | 13 | 41 | 42 | <% } else {%> 43 | 44 | 54 | 55 | <% }%> 56 |
4 |

Secure File Storage using Hybrid Cryptography

5 |
7 |
14 |  My Account | 15 | <% 16 | String utype = (String) session.getAttribute("UTYPE"); 17 | if (utype.equals("admin")) { 18 | %> 19 | User List| 20 | File List| 21 | Encryption| 22 | Decryption| 23 | Download File 24 | <% } else { 25 | %> 26 | Encryption| 27 | Decryption| 28 | Download File 29 | <% } 30 | %> 31 | <% 32 | if (null != session.getAttribute("ID")) { 33 | %> 34 | 35 | Welcome, 36 | <%=(String) session.getAttribute("NAME")%>  37 | (Logout) 38 | 39 | <% }%> 40 |
45 |  Home | 46 |  Register | 47 |  Login  48 | 49 | 50 | Efficient & Secure Data Storage & Access Scheme in Cloud Computing using Elliptic Curve Cryptography and AES 51 | 52 | 53 |
-------------------------------------------------------------------------------- /web/images/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/web/images/background.jpg -------------------------------------------------------------------------------- /web/images/header_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/web/images/header_bg.jpg -------------------------------------------------------------------------------- /web/images/header_bg1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/web/images/header_bg1.png -------------------------------------------------------------------------------- /web/images/rightside.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/web/images/rightside.gif -------------------------------------------------------------------------------- /web/images/user_login.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/web/images/user_login.jpg -------------------------------------------------------------------------------- /web/index.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : index 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | 7 | 8 | 9 | 10 | Welcome to Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 48 | 49 | 50 | 53 | 54 |
17 | <%@include file="header.jsp" %> 18 |
22 | 23 | 24 | 29 | 30 | 31 | 45 | 46 |
25 |
26 | About the project 27 |
28 |
32 |

The primary goal of this project is to provide and simulate an effective solution to 33 | face the challenges and solve security issues that exists in cloud computing. 34 | Cloud Computing is the impending need of computing which is used for the IT Industries 35 | It is one of the hottest topic in research areas. Scalability and Flexibility increases 36 | for the computing services. Cloud Computing is the fastest growing technology for IT Industry. 37 | The Information is being transmitted via the network therefore security is one of the main 38 | problems or issue. The Application is deployed on the Cloud and for the secure transmission 39 | of the data we will be using ECC Algorithm in our project because of its advantages in terms 40 | of CPU utilization, time for Encryption and Key Size. This Project will explore the deployment 41 | of Application on the Cloud and increases the security level by implementing ECC & ECDH Algorithm, 42 | and AES Algorithm for secure file handling and Encryption.

43 | 44 |
47 |
55 | 56 | 57 | -------------------------------------------------------------------------------- /web/jarfile/bcprov-1.45.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/web/jarfile/bcprov-1.45.jar -------------------------------------------------------------------------------- /web/jarfile/commons-fileupload-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/web/jarfile/commons-fileupload-1.1.jar -------------------------------------------------------------------------------- /web/jarfile/commons-io-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/web/jarfile/commons-io-1.1.jar -------------------------------------------------------------------------------- /web/jarfile/fileupload-progress.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/web/jarfile/fileupload-progress.jar -------------------------------------------------------------------------------- /web/jarfile/mail.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/web/jarfile/mail.jar -------------------------------------------------------------------------------- /web/jarfile/mysql-connector-java-3.0.11-stable-bin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subhadeepdan/Secure-File-Storage-using-Hybrid-Cryptography/b3419696685c6713890f0c80e1534a2704e028d0/web/jarfile/mysql-connector-java-3.0.11-stable-bin.jar -------------------------------------------------------------------------------- /web/keydescription.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : description 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | 7 | 8 | <% response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1 9 | response.setHeader("Pragma", "no-cache"); //HTTP 1.0 10 | response.setDateHeader("Expires", 0); //prevents caching at the proxy server 11 | response.setHeader("Cache-Control", "no-store"); //HTTP 1.1 12 | String id = null; 13 | id = (String) session.getAttribute("ID"); 14 | if (id != null) { 15 | %> 16 | 17 | 18 | 19 | Decrypt AES Key - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 20 | 21 | 22 | 38 | 39 | 40 | 41 | 42 | 45 | 46 | 47 | 94 | 95 | 96 | 99 | 100 |
43 | <%@include file="header.jsp" %> 44 |
48 |
49 |
50 | 51 | 52 | 57 | 58 | <% 59 | String msg = null; 60 | String fileid = request.getParameter("fileid"); 61 | msg = (String) session.getAttribute("MSG"); 62 | if (msg != null) { 63 | %> 64 | 65 | 66 | 67 | <% 68 | session.removeAttribute("MSG"); 69 | } else { 70 | session.setAttribute("MSG", ""); 71 | 72 | } 73 | %> 74 | 75 | 78 | 79 | 80 | 84 | 85 | 86 | 89 | 90 |
53 |
54 | Decrypt AES key and Download file 55 |
56 |
<%=msg%>
76 | Enter public key for downloading file and decrypting AES Key. 77 |
81 | 82 | 83 |
87 | 88 |
91 |
92 |
93 |
101 | 102 | 103 | <% } else { 104 | session.setAttribute("MSG", "You must be login."); 105 | response.sendRedirect("login.jsp"); 106 | } 107 | %> -------------------------------------------------------------------------------- /web/keyexchange.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : keyexchange 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | 7 | <% 8 | String userid = request.getParameter("userid"); 9 | %> 10 | 11 | 12 | 13 | Key Exchange - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 14 | 15 | 25 | 26 | 27 | 28 | 29 | 32 | 33 | 34 | 85 | 86 | 87 | 90 | 91 |
30 | <%@include file="header.jsp" %> 31 |
35 |
36 |
37 | 38 | 39 | 44 | 45 | <% 46 | String msg = null; 47 | msg = (String) session.getAttribute("MSG"); 48 | if (msg != null) { 49 | %> 50 | 51 | 52 | 53 | <% 54 | session.removeAttribute("MSG"); 55 | } else { 56 | session.setAttribute("MSG", ""); 57 | 58 | } 59 | %> 60 | 61 | 64 | 65 | 66 | 67 | 68 | 69 | 72 | 73 | 74 | 75 | 76 | 77 | 80 | 81 |
40 |
41 | Key Exchange 42 |
43 |
<%=msg%>
62 | Your Registration id is 63 |
70 | Enter your secret private key for ECDH key exchange 71 |
78 | 79 |
82 |
83 |
84 |
92 | 93 | 94 | -------------------------------------------------------------------------------- /web/login.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : login 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | 8 | 9 | 10 | 11 | Login - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 12 | 13 | 65 | 66 | 67 | 68 | 69 | 72 | 73 | 74 | 120 | 121 | 122 | 125 | 126 |
70 | <%@include file="header.jsp" %> 71 |
75 |
76 |
77 | 78 | 79 | 84 | 85 | <% 86 | String msg = null; 87 | msg = (String) session.getAttribute("MSG"); 88 | if (msg != null) { 89 | %> 90 | 91 | 92 | 93 | <% 94 | session.removeAttribute("MSG"); 95 | } else { 96 | session.setAttribute("MSG", ""); 97 | 98 | } 99 | %> 100 | 101 | 102 | 103 | 104 | 107 | 108 | 109 | 110 | 111 | 112 | 115 | 116 |
80 |
81 | Login 82 |
83 |
<%=msg%>
105 | Request for OTP 106 |
113 | 114 |
117 |
118 |
119 |
127 | 128 | 129 | -------------------------------------------------------------------------------- /web/secretkey.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : secretkey 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | <% 7 | String userid = request.getParameter("userid"); 8 | String secretkey = request.getParameter("secretkey"); 9 | %> 10 | 11 | 12 | 13 | 14 | Secrete Key - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 15 | 16 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 90 | 91 | 92 | 95 | 96 |
32 | <%@include file="header.jsp" %> 33 |
37 |
38 |
39 | 40 | 41 | 46 | 47 | <% 48 | String msg = null; 49 | msg = (String) session.getAttribute("MSG"); 50 | if (msg != null) { 51 | %> 52 | 53 | 54 | 55 | <% 56 | session.removeAttribute("MSG"); 57 | } else { 58 | session.setAttribute("MSG", ""); 59 | 60 | } 61 | %> 62 | 63 | 66 | 67 | 68 | 72 | 73 | 74 | 77 | 78 | 79 | 80 | 81 | 82 | 85 | 86 |
42 |
43 | Generate User ID 44 |
45 |
<%=msg%>
64 | Your ECDH key is 65 |
69 | 70 | 71 |
75 | OTP has been sent to your email id 76 |
83 |
84 |
87 |
88 |
89 |
97 | 98 | 99 | -------------------------------------------------------------------------------- /web/sucess_registration.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : secretkey 3 | Author : Subhadeep Dan 4 | --%> 5 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 6 | <% 7 | String userid = request.getParameter("userid"); 8 | String secretkey = request.getParameter("secretkey"); 9 | %> 10 | 11 | 12 | 13 | 14 | Secrete Key - Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 15 | 16 | 32 | 33 | 34 | 35 | 36 | 39 | 40 | 41 | 84 | 85 | 86 | 89 | 90 |
37 | <%@include file="header.jsp" %> 38 |
42 |
43 |
44 | 45 | 46 | 51 | 52 | <% 53 | String msg = null; 54 | msg = (String) session.getAttribute("MSG"); 55 | if (msg != null) { 56 | %> 57 | 58 | 59 | 60 | <% 61 | session.removeAttribute("MSG"); 62 | } else { 63 | session.setAttribute("MSG", ""); 64 | 65 | } 66 | %> 67 | 68 | 71 | 72 | 73 | 74 | 75 | 76 | 79 | 80 |
47 |
48 | User ID 49 |
50 |
<%=msg%>
69 | Your user id is 70 |
77 | Click here to login 78 |
81 |
82 |
83 |
91 | 92 | 93 | -------------------------------------------------------------------------------- /web/usrelist.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Document : usrelist 3 | Author : Subhadeep Dan 4 | --%> 5 | 6 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 7 | <%@page import="java.sql.Connection"%> 8 | <%@page import="java.sql.Statement"%> 9 | <%@page import="java.sql.ResultSet"%> 10 | 11 | <% 12 | Connection conn = null; 13 | Statement st = null; 14 | ResultSet result = null; 15 | response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1 16 | response.setHeader("Pragma", "no-cache"); //HTTP 1.0 17 | response.setDateHeader("Expires", 0); //prevents caching at the proxy server 18 | response.setHeader("Cache-Control", "no-store"); //HTTP 1.1 19 | String id = null; 20 | id = (String) session.getAttribute("ID"); 21 | if (id != null) { 22 | %> 23 | 24 | 25 | 26 | Users List- Efficient & Secure Data Storage & Access Scheme in Cloud Computing using AES 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 104 | 105 | 106 | 109 | 110 |
33 | <%@include file="header.jsp" %> 34 |
38 | 39 | 40 | 45 | 46 | <% 47 | String msg = null; 48 | msg = (String) session.getAttribute("MSG"); 49 | if (msg != null) { 50 | %> 51 | 52 | 55 | 56 | <% 57 | session.removeAttribute("MSG"); 58 | } else { 59 | session.setAttribute("MSG", ""); 60 | 61 | } 62 | %> 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | <% 72 | int i = 0; 73 | try { 74 | conn = connection.dbConnection.makeConnection(); 75 | String query = "SELECT userid,NAME,email,mobile FROM users WHERE utype != 'admin'"; 76 | st = conn.prepareStatement(query); 77 | result = st.executeQuery(query); 78 | while (result.next()) { 79 | 80 | String userid = result.getString(1); 81 | String name = result.getString(2); 82 | String email = result.getString(3); 83 | String mobile = result.getString(4); 84 | i++; 85 | %> 86 | 87 | 88 | 89 | 90 | 91 | 92 | 95 | 96 | <% } 97 | 98 | } catch (Exception e) { 99 | e.printStackTrace(); 100 | } 101 | %> 102 |
41 |
42 | Users List 43 |
44 |
53 |
<%=msg%>
54 |
S.NoIDNameEmailMobileDelete
<%=i%>.<%=userid%><%=name%><%=email%><%=mobile%> 93 | Delete 94 |
103 |
111 | 112 | 113 | <% } else { 114 | session.setAttribute("MSG", "You must be login."); 115 | response.sendRedirect("login.jsp"); 116 | } 117 | %>%> --------------------------------------------------------------------------------