Giter Site home page Giter Site logo

dkushche / crypto Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 34.19 MB

Crypto's a learning project that contains the realization of all my university cryptology labs.

License: MIT License

Python 96.77% Makefile 0.51% C 2.71%
crypto cryptoanalysis-algorithms cryptology-labs openssl-library openssl microsoft-cryptoapi linux windows cross-platform university-course

crypto's Introduction

Hi there, I am Dimka

About me

  • ๐Ÿ‘จโ€๐Ÿ”ฌ I'm a Master of Science in Cybersecurity.

  • ๐Ÿฅผ I'm currently working on the private kuberenetes lab hosted in Yggdrasil network and accessed using Alfis domain.

  • More about me:

    • Linkedin
    • Gmail

GitHub Stats

Mei's github stats GitHub Streak

crypto's People

Contributors

antonhaiduk avatar dependabot[bot] avatar dkushche avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

crypto's Issues

Processing function shouldn't contain UI calls

The processing function should be able to be used by other software. This software won't need to init interface which is part of crypto UI, so all cterm calls shouldn't be in the processing function.

Example:

def cryptoapi_aes_processing(data, key_length, key,
                            mode, provider, encrypt):

    if platform.system() != "Windows":
        return f"Unsupported on your platform {platform.system()}"

    cryptoapi_aes_pre_processing(key, key_length)

    if provider == "standard":
        result = crypto_native.ms_cryptoapi_standard_aes(
            data, key, encrypt
        )
    else:
        result = crypto_native.ms_cryptoapi_nextgen_aes(
            data, key, mode, encrypt
        )

    crypto_tools.cterm("output", f"Hashed key: {result['hashed_key']}", "inf")
    crypto_tools.cterm("output", f"Session key: {result['session_key']}", "inf")

    return result["result"]

If I try to import cryptoapy_aes and call just its processor I will get an Exception because the color palette for cterm is not defined.

Help padding drifted

How to reproduce:

  • Install crypto
  • Run crypto
  • Run help command

How I want it to look like:

dsa                         ->              dsa_little_doc
dummy_rsa                   ->              dummy_rsa it's super dummy rsa for easier analysis
elgamal                     ->              encrypt/decrypt using elgamal algo
elliptic                    ->              encrypt/decrypt using elliptic algo
generate_ca                 ->              generate_ca_little_doc
generate_client_cert        ->              generate_client_cert_little_doc
hash                        ->             generate hash from data

How it looks now:

dsa                         ->              dsa_little_doc
dummy_rsa                   ->              dummy_rsa it's super dummy rsa for easier analysis
elgamal                     ->              encrypt/decrypt using elgamal algo
elliptic                    ->              encrypt/decrypt using elliptic algo
generate_ca                 ->              generate_ca_little_doc
generate_client_cert   ->              generate_client_cert_little_doc
hash                        ->             generate hash from data

Hint: issue in crypto_commands/help.py

Generate CA: add the ability to have more than one CA

For now, when we generate CA it creates in crypto CA. It's not good for testing and can interfere with user workflow. Also during improving this module, we need to improve the issued cert and add the ability to choose CA.

Add module.processor for all modules

For now, not all modules have a defined processor function that could be used for running them without UI. Let's fix it.
Example:
This is good, it's how it should be:

caesar.little_doc = caesar_little_doc
caesar.full_doc = caesar_full_doc
caesar.processor = caesar_processing

This is bad and needs to be fixed:

diffie_hellman.little_doc = diffie_hellman_little_doc
diffie_hellman.full_doc = diffie_hellman_full_doc

Actually, this issue will be fixed after writing the test for all of the modules, but let's fix it now. I already improved modules creator to add processor automatically. So this issue won't happen in the future.

Add typization for all processing functions

What we have now:
def issue_cert_processing(cert_info, cert_exts, username):

What I want to see(or something like this):
def issue_cert_processing(cert_info: list, cert_exts: list, username: string) -> None:

Add fancy dependency check mechanism

Sometimes we explicitly run the processor functions of modules we depend on, but for example, with issue cert, it doesn't happen and we have implicitly dependency which is bad and should be fixed and made explicit by some interface

Add 2 revokes 1 refund test for refund_cert

I added a basic test that check does the functionality works well, but we need more. On the list, let's create 2 certs, revoke both of them, and then refund one of them. As the result, you should get CRL with 1 cert inside of it.

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.