Giter Site home page Giter Site logo

imageinj's Introduction

ImageInj

CS50

This was my final project for conclude the CS50 course

CS, python, flask, flask web framework, web development, CS50, Image Injection, Steganography

Features

I've used Flask web framework based in Python its was necessary flask-sqlalchemy for manage SQL database with sqlite and flask-wtf for upload files and forms extensions

Explaining the project and the database

My final project is a website that allow the registered users to Inject Text inside Images using steganography, and then share this images with other users, the users can see the images and if they want, they can extract the text from the image.

All information about users, cases and selected cases for each people are stored in site.db.

I used sqlalchemy extension to connect the database to the application and sqlite3 for managing.

Injecting text inside images

@app.route("/inject", methods=["GET", "POST"])
@login_required
def inject():
    form = InjectImageForm()
    if form.validate_on_submit():
        image = form.image.data
        text = form.text.data
        filename = image.filename

        # Read the image file into memory
        image_bytes = BytesIO(image.read())
        img = Image.open(image_bytes)

        # Inject the text into the image
        secret = lsb.hide(img, text)

        # Save the modified image
        secret.save(filename)

        return redirect(url_for("home"))
    return render_template("inject.html", form=form)

if you do not select any file or not write any text the program warns you through messages

<div class="container">
        {% with messages = get_flashed_messages() %}
            {% if messages %}
                <div class="alert alert-danger" role="alert">
                    {% for message in messages %}
                        {{ message }}
                    {% endfor %}
                </div>
            {% endif %}
        {% endwith %}
        <div class="flex-container">
      {% block content %}
      {% endblock %}
   </div>
    </div>

Walkthrough on youtube

My Final Project presentation

Documentation

https://flask.palletsprojects.com/en/1.1.x/

https://flask-sqlalchemy.palletsprojects.com/en/2.x/

https://flask-wtf.readthedocs.io/en/stable/form.html#module-flask_wtf.file

About CS50

CS50 is a openware course from Havard University and taught by David J. Malan

Introduction to the intellectual enterprises of computer science and the art of programming. This course teaches students how to think algorithmically and solve problems efficiently. Topics include abstraction, algorithms, data structures, encapsulation, resource management, security, and software engineering. Languages include C, Python, and SQL plus students’ choice of: HTML, CSS, and JavaScript (for web development).

imageinj's People

Contributors

berganzio avatar

Watchers

 avatar

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.