Skip to content

Latest commit

 

History

History
29 lines (16 loc) · 1.78 KB

README.md

File metadata and controls

29 lines (16 loc) · 1.78 KB

Java Encryption and Decryption Program

This is a simple Java program that demonstrates encryption and decryption of messages using a key-value pair for each alphabet. It provides functionality to encrypt a message and decrypt an encrypted code back to the original message.

Features

  • Encryption: The program takes a user input message and encrypts it using a predefined key-value pair for each alphabet character. It converts each character of the message to its corresponding integer value.
  • Decryption: The program allows the user to input an encrypted code and decrypts it back to the original message using the reverse mapping of the key-value pairs.
  • Customizable Key: The key-value pairs for encryption and decryption can be customized according to specific requirements.
  • Input Validation: The program handles input validation to ensure that only valid messages and encrypted codes are accepted.

Usage

  1. Compile the Program: Compile the Java program (EncryptionDecryption.java) using any Java compiler.

  2. Run the Program: Execute the compiled program to start the encryption and decryption process. Follow the instructions provided in the console.

  3. Input Message: Enter the message that you want to encrypt. You can include any characters, including whitespace.

  4. Encrypted Code: The program will generate an encrypted code based on the input message and display it to the user.

  5. Input Encrypted Code: Enter the encrypted code when prompted by the program.

  6. Decrypted Message: The program will decrypt the encrypted code and display the original message to the user.

Key-Value Pairs

The encryption and decryption process relies on key-value pairs for each alphabet character. By default, the program provides the following key-value pairs: