Coder Social home page Coder Social logo

cryptographicencryp's Introduction

Encryption and Decryption using Hill Cipher and One-Time Pad

This repository contains Java and Python programs for encrypting and decrypting messages using the Hill Cipher and One-Time Pad encryption techniques.

Table of Contents

Introduction

The Hill Cipher is a polygraphic substitution cipher that is based on linear algebra. It uses a matrix as a key to encrypt and decrypt messages. Each character in the plaintext is transformed into its numerical equivalent, and then the entire message is divided into blocks and encrypted using the matrix key.

The One-Time Pad, on the other hand, is a symmetric key encryption algorithm that uses a random key as long as the message itself. This key is used only once, and the ciphertext is created by XORing the message with the key.

Both of these techniques are known for their security when used correctly, and this repository provides implementations for both.

Prerequisites

Before using the programs in this repository, you will need to have the following installed:

  • Java Development Kit (JDK) for running the Java programs.
  • Python for running the Python programs.

Hill Cipher

Usage

  1. Hill Cipher Java Implementation:

    1. Compile the Java program using the following command:

      javac HillCipherImp.java
    2. Run the program with the desired action (encrypt or decrypt) and provide the necessary inputs.

      • To encrypt a message:

        java HillCipherImp encrypt
      • To decrypt a message:

        java HillCipherImp decrypt
    3. Follow the prompts to enter the matrix key and the message you want to encrypt or decrypt.

  2. Hill Cipher Python Implementation:

    • Run the Python program:

      python HillCipher.py

File Descriptions

  • HillCipherImp.java: Java implementation of the Hill Cipher algorithm.

  • HillCipher.py: Python implementation of the Hill Cipher algorithm.

One-Time Pad

Usage

  1. One-Time Pad Java Implementation:

    1. Compile the Java program using the following command:

      javac OneTimePad.java
    2. Run the program with the desired action (encrypt or decrypt) and provide the necessary inputs.

      • To encrypt a message:

        java OneTimePad encrypt
      • To decrypt a message:

        java OneTimePad decrypt
    3. Follow the prompts to enter the key (for encryption) or ciphertext (for decryption) and the message.

  2. One-Time Pad Python Implementation:

    • Run the Python program:

      python OneTimePad.py

File Descriptions

  • OneTimePad.java: Java implementation of the One-Time Pad encryption algorithm.

  • OneTimePad.py: Python implementation of the One-Time Pad encryption algorithm.

License

This project is licensed under the MIT License. See the LICENSE file for details.

cryptographicencryp's People

Contributors

adityakr49 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.