Skip to content

StoneSteel27/The-Magic-Methods

Repository files navigation

Code_Stego

  • Code_Stego implements a Steganography algorithm to save source code into Image of the styled code snippet.
  • Code_Stego is the project made by The Magic Methods team, for Python Discord Code Jam 2023

Explanation

Invite our Discord Bot for testing the functionalities : Invite Bot

Features

  • Code snippet Images generated by Code_Stego, would contain the source code within itself.
  • This could help lots of people to view thier code easily, with code highlighting.
  • Posting thier highlighted code in internet would be made much easier, and there is no character limit for images

Implementations

For displaying Code_Stego's reliability, this project has 3 implementations within it:

  • A Python Module
  • Django website
  • A Discord Bot

Installation Guide 1 ( Using Docker )

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Docker installed on your system.

Installation

Steps To install and run Codestego's Website , follow these steps:

  1. Clone the repository to your local machine:

    git clone https://github.com/StoneSteel27/The-Magic-Methods.git
  2. Change your working directory to the project's django-files folder:

    cd The-Magic-Methods
    cd django-files
  3. Build the Docker image for Codestego:

    docker build -t codestego .
  4. Run Codestego as a Docker container in detached mode, mapping port 8000 on your local machine to port 8000 in the container:

    docker run -d -p 8000:8000 codestego
  5. Access Codestego in your web browser by navigating to http://127.0.0.1:8000/

Installation Guide 2 ( Using python )

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Python 3.11 installed on your system.

Installation

Steps To install and run Codestego's Website , follow these steps:

  1. Clone the repository to your local machine:

    git clone https://github.com/StoneSteel27/The-Magic-Methods.git
  2. Change your working directory to the project's django-files folder:

    cd The-Magic-Methods
    cd django-files
  3. Install the required Python packages using pip: ( it is recommended to do pip install inside a virtual environment. )

    pip install -r requirements.txt
  4. Run the Django development server:

    python manage.py runserver
  5. Access Codestego in your web browser by navigating to http://127.0.0.1:8000/

Steps To install and run Codestego's Discord bot , follow these steps:

  1. Clone the repository to your local machine:

    git clone https://github.com/StoneSteel27/The-Magic-Methods.git
  2. Change your working directory to the project's bot folder:

    cd The-Magic-Methods
    cd bot
  3. Install the required Python packages using pip: ( it is recommended to do pip install inside a virtual environment. )

    pip install discord.py
    pip install code_stego
    pip install python-dotenv
  4. Go to Discord Developers Website and create a new application

    • Go to OAuth2=>General section and change default Authorization Link to in-app Authorization and check these options

      • Scopes:
        • bot
      • Permissions:
        • Read Messages/View Channels
        • Send Messages
        • Attach Files
        • Read Message History
        • Use External Emojis
    • Go to Bot section and click on Reset token confirm and copy the token and save it somewhere safe.

    • Go to Oauth2=>URL Generator section and check these options

      • Scopes:
        • bot
      • Permissions:
        • Read Messages/View Channels
        • Send Messages
        • Attach Files
        • Read Message History
        • Use External Emojis
    • Copy the GENERATED URL and open it in your browser and add the bot to your server

  5. Create file .env without any file extension and add the below text:

    TOKEN = "Put your discord token here that you have saved earlier"
  6. Make sure you are in the bot directory and run the bot using this command:

    python discord_bot.py
  7. Now go to your discord server where you have added the bot and use these commands:

    • For Encode type !encode following with your code like below example
    !encode print("hello")
    
    • For Decode type !decode and upload your image and send it
    !decode
    

The Magic Methods Team

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •