This project is a web application and a Telegram bot that allows users to encrypt and decrypt text using AES (Advanced Encryption Standard) and DES (Data Encryption Standard) algorithms. The backend is built with Golang, and the frontend is developed using HTML and CSS.
- Encrypt text using AES and DES algorithms.
- Decrypt text using AES and DES algorithms.
- User-friendly web interface and formulas for encryption and decryption.
- Interactive Telegram bot for encryption and decryption.
- HTML, CSS, JavaScript
- CryptoJS, Bootstrap
- Go
- Go (https://golang.org/doc/install)
- A web browser
-
Clone the repository:
git clone https://github.com/realtemirov/encryption-bsc.git cd encryption-bsc
-
Set up the Go environment and dependencies:
go mod init encryption-bsc go mod tidy
-
Open
index.html
in your web browser. -
Use the form to select an encryption algorithm (AES or DES), enter the text to encrypt, and submit.
-
Copy the encrypted text and paste it into the decryption form to decrypt.
-
Run the Go program:
go run main.go
-
The program will output the encrypted and decrypted text for both AES and DES algorithms.
- The key and IV are defined as 16 bytes for AES and 8 bytes for DES.
- PKCS7 padding is used.
- Encryption and decryption are performed in CBC mode.
- The
pad
andunpad
functions handle PKCS7 padding. - The
encryptAES
anddecryptAES
functions handle AES encryption and decryption. - The
encryptDES
anddecryptDES
functions handle DES encryption and decryption. - Base64 encoding is used for ciphertext to ensure compatibility with CryptoJS.
/aes_encrypt <text>
: Encrypts the provided text using AES./aes_decrypt <encrypted_text>
: Decrypts the provided AES encrypted text./des_encrypt <text>
: Encrypts the provided text using DES./des_decrypt <encrypted_text>
: Decrypts the provided DES encrypted text.
- Padding: Implements PKCS7 padding to ensure the text fits the block size.
- Encryption/Decryption Functions: Implements AES and DES encryption and decryption in CBC mode with PKCS7 padding.
- Telegram Bot: Handles commands to encrypt and decrypt text using the provided algorithms. It uses the tgbotapi package to interact with the Telegram Bot API.
With this setup, your Telegram bot @encryption_robot
should be able to encrypt and decrypt text using AES and DES algorithms.
- Bot: @encryption_robot
- Website here
This project is licensed under the MIT License. See the LICENSE file for details.