Skip to content

iluzioDev/ChaCha20-cipher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ChaCha20 Cipher

License: MIT Twitter

Introduction 📋

The next program is an implementation of the ChaCha20 Stream Cipher written in Python, the objective is to generate a key stream from an specific input in order to encrypt/decrypt any kind of text.

Stream ciphers are symmetric key cipher where plaintext digits are combined with a pseudorandom cipher digit stream (keystream).

ChaCha20 is a stream cipher designed by Daniel J. Bernstein. The secret key is 256 bits long (32 bytes). The cipher requires a nonce, which must not be reused across encryptions performed with the same key.

ChaCha20 and XChaCha20 - PyCryptodome's documentation

Daniel J. Bernstein    Input

Features ✨

  • Encryption and Decryption of any text.
  • Customized inputs.
  • Ascii Code-Text Convertion.
  • Support Keys of variable length.
  • Support for Hexadecimal or Decimal Formats.

Install 🔧

git clone https://github.com/iluzioDev/ChaCha20-cipher
cd ChaCha20-cipher
python3 ChaCha20-cipher.py

Usage 💡

Once executed, a menu will prompt asking for desired option:

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
■              WELCOME TO THE CHACHA20 CIPHER TOOL!               ■
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
What would you want to do?
[1] Cipher Message.
[2] Cipher Ascii Code of Message.
[3] Cipher Message in Hexadecimal.
[4] Convert Ascii Code to Text.
[5] Convert Text to Ascii Code.
[0] Exit.
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
Option  ->
  1. Encrypts/Decrypts a message after inserting key, counter and nonce values. The program will generate a key stream to make a XOR operation with the message.
  2. Similar to option 1, encrypts/decrypts a message giving its ascii code (no plain text!).
  3. Similar to option 1, encrypts/decrypts a message in hexadecimal form (no plain text).
  4. Converts a given ascii code to its corresponding string. It's important to notice that the ascii code of each character has 3 digits!
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
Introduce ascii code: 072101108108111
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
OUTPUT TEXT: Hello
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  1. Similar to option 4, converts a string to its corresponding ascii code

Maintainers 👷

IluzioDev
IluzioDev

💻

License ⚖️

Distributed under the MIT License. Click here for more information.