This is a simple web application that allows users to encrypt and decrypt text using AES-256-CBC encryption. It's built with PHP and can be deployed on an Nginx web server.
Follow these steps to set up the Encryption and Decryption web application on your Nginx server:
- PHP installed on your server. You can install PHP using your package manager. For example, on Ubuntu, you can run:
sudo apt-get update
sudo apt-get install php
- Nginx web server installed and configured. If Nginx is not installed, you can install it using your package manager.
-
Clone this repository to your server using Git: git clone https://github.com/s8rr/encryption-decryption-website.git
-
Place your logo image file in the directory and name it
logo.png
. Ensure it's a suitable size for the layout.
-
Open the
index.php
file in a text editor. -
Replace
"YourSecretKey"
with your desired secret key. This key will be used for encryption and decryption. Make sure it's a strong and secure key.
- Create a new server block configuration file for your domain in the Nginx
sites-available
directory. For example:
sudo nano /etc/nginx/sites-available/yourdomain.com
Replace yourdomain.com
with your actual domain name.
-
Add the following configuration to the file, replacing
yourdomain.com
with your actual domain name and the path to the directory where the web application is located:server { listen 80; server_name yourdomain.com;
root /path/to/encryption-decryption-web; index index.php;
location / { try_files $uri $uri/ /index.php?$args; }
location ~ .php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.4-fpm.sock; # Adjust PHP version if necessary }
-
Save and close the file.
-
Create a symbolic link to enable the server block:
sudo ln -s /etc/nginx/sites-available/yourdomain.com /etc/nginx/sites-enabled/
-
Test the Nginx configuration for syntax errors:
-
If the test is successful, reload Nginx to apply the changes:
sudo systemctl reload nginx
You can now access the Encryption and Decryption web application by navigating to your domain in a web browser.
-
Enter the text you want to encrypt or decrypt in the respective text fields.
-
Click the "Encrypt" button to encrypt text or the "Decrypt" button to decrypt text.
-
The result will be displayed below the form. You can click the "Copy" button to copy the encrypted or decrypted text to the clipboard.
This project is licensed under the MIT License - see the LICENSE file for details.