ameasere / kato

NetCloud24 Cryptographic POC

Home Page:https://londonmet.ac.uk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Logo

Kato (NetCloud24)

A Rijndael-inspired cryptographic proof-of-concept algorithm.

View Demo · Report Bug · Request Feature

Contributors Forks Stargazers Issues GPL3 License

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

FOSSA Status

About The Project

FOSSA Status

Kato is a cryptographic proof-of-concept algorithm inspired by AES (Rijndael), or the Advanced Encryption Standard. As a symbol of power, Kato serves as a hybridization focusing on efficiency and versatility without compromising security. We welcome any and all contributions towards the implementation and empowerment of the algorithm, aiming to become more than just a conceptualized technology.

(Back to top)

Built With

  • Python

(Back to top)

Getting Started

This is a minimal example of getting Kato operating locally. You may require additional steps, modification or a customized implementation to suit your needs.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

Installation

  1. Clone the repo

    git clone https://github.com/your_username_/Project-Name.git

    OR

    Install using pip from the Python Package Index (PyPI)

     pip install kato
  2. Import into your script

    from kato import Kato

(Back to top)

Usage

Below are the minimal usage examples, as well as the returned types from Kato.

Encrypting

ECB Mode:

from kato import Kato

key = bytes(random.sample(range(256), 16))
k = Kato(key)
ciphertext = k.encrypt(bytes("abcdefghijklmnop","utf-8"))

CBC Mode:

from kato import Kato

key = bytes(random.sample(range(256), 16))
iv = bytes(random.sample(range(256), 16))
k = Kato(key, iv)
ciphertext = k.encrypt(bytes("abcdefghijklmnop","utf-8"))
Decrypting
plaintext = k.decrypt(ciphertext)

Each Kato class instance will have a key (and optionally, an Initialization Vector) as an attribute. This means you will have to create new Kato instances for each key (and IV pair) you wish to use.

Types
  • Kato.init():

    • key: 16 bytes
    • iv (Optional): 16 bytes
  • Kato.encrypt(): Returns a 2D Array (list of lists)

    • plaintext: 16 bytes
    • Example Return: [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
  • Kato.decrypt(): Returns a bytes object or 2D Array (list of lists)

    • ciphertext: 16 bytes
    • Example Return: b'abcdefghijklmnop' or [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
      • Note: If any digit in the state matrix cannot be decoded into hex bytes, the function will return a 2D Array.
  • Kato.cipher_block_chaining(): Returns a bytes object.

    • block: 16 bytes
    • IV (Optional): 16 bytes
    • Example Return: b'\xxx\xxx\xxx\xxx'
      • Note: This CBC implementation is NOT true CBC, instead a mock-CBC simplying XORing the IV with the block before encryption and after decryption.
  • Kato.transpose_matrix(): Returns a 2D Array (list of lists)

    • matrix: 4x4 2D Array
    • Example Return: [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
  • Kato.omflip_matrix(): Returns a 2D Array (list of lists)

    • matrix: 4x4 2D Array
    • key: Array of 4 digits (default is [3, 1, 0, 2])
    • Example Return: [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
  • Kato.omflip_decrypt_matrix(): Returns a 2D Array (list of lists)

    • matrix: 4x4 2D Array
    • key: Array of 4 digits (default is [3, 1, 0, 2])
    • Example Return: [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
  • Kato.__add_round_key(): Returns a 2D Array (list of lists)

    • state: 4x4 2D Array
    • round_key: 16 bytes
    • Example Return: [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]

(Back to top)

Roadmap

  • Add true CBC mode.
  • C implementation.

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

(Back to top)

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

(Back to top)

License

Distributed under the GPL3 License. See LICENSE.txt for more information.

(Back to top)

Credits

Leighton Brooks - leigh@ameasere.com
Milena Bosiacka - social
Riza Demirbas - social
Sam Truss - social
Yuliia Yavorska - social

Project Link: https://github.com/ameasere/kato

(Back to top)

Acknowledgments

Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!

(Back to top)

About

NetCloud24 Cryptographic POC

https://londonmet.ac.uk

License:GNU General Public License v3.0


Languages

Language:Python 100.0%