Skip to content

A self-made cipher that derivate a key from Hasse's algorithm.

License

Notifications You must be signed in to change notification settings

Lcram33/collatz-cipher

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Collatz cipher

A polyalphabetic cipher that derivate a key from Hasse's algorithm.

About The Project

A polyalphabetic cipher that uses Hasse's algorithm with a huge number to substitute characters from a randomly mixed charset. See paper for more details on how it works.

Warning !

I do not provide any warranty that this cipher is in any way reliable.
DO NOT USE WITH CRITICAL DATA !

No research was made on it so far. Your welcome to contribute in any way !

Technical part (how it works) & security considerations

These parts have been moved to the unofficial paper. See pdf document in the repo.

Break me !

In challenge/challenge.py, you will find a message encrypted with an unknown key. If you manage to find the original message, it would be a pleasure to know how you did it ! See the contact section.

Please note however that the project changed since. See challenge/params-challenge.py and challenge/collatzcipher-v1.0.py for more details.

Built With

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

python3 (should come with your favorite distro)

sudo apt update && sudo apt install python3

Installation

  1. Clone the repo

    git clone https://github.com/lcram33/collatz-cipher.git
  2. cd into the created folder

    cd collatz-cipher
  3. Test that everything works as expected (and you meet all depedencies)

    ./test.py && cd test_samples/ && ./test_all.sh && cd ..
  4. See the help of the command line tool

    ./main.py --help

Usage

The program is to be runned as follow :

./main.py <command> <required args> <optional args>

Use :

./main.py <command> --help

to get the arguments and a description of what a command does.

Commands:

  • list
  • gen
  • seededkey
  • enc
  • dec
  • encf
  • decf
  • export
  • import
  • delete
  • check

Other programs in this repo

  • seeded_key.py allows to create keys using a random passphrase, allowing an easier key sharing and key recovery.
  • secure_pwd_gen_api.py comes from one of my other projects. It can be used to generate passwords and passphrases for cryptographic use.
  • test_randomness.py is to test how "randomly" are the shiftings distributed.
  • unicode_list.py was used to produce the latest params.py file.

Changelog

v3

  • Encryption of messages through command line
  • Data integrity check
  • Strong password hashing (using bcrypt for CPU cost)

v2

  • Finally a command line !

v1.1

  • Added null char to the charset, meaning it is now encrypted. To avoid any problem in decryption, it is removed from the initial message before encryption.
  • Randomized "confusing threshold" (prevalence of useless chars).
  • Randomized noise at the begining and the end of the message.
  • First version of paper.

See the open issues for a full list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the GPL-3.0 license. See LICENSE for more information.

Contact

✉️ lcram33@pm.me

Project Link: https://github.com/lcram33/collatz-cipher

Credits

Caesar cipher icons created by Pixelmeetup - Flaticon
Warning icons created by Freepik - Flaticon
Safe icons created by Assia Benkerroum - Flaticon
Technology icons created by Smashicons - Flaticon
Idea icons created by Good Ware - Flaticon

About

A self-made cipher that derivate a key from Hasse's algorithm.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages