Dev.to WebDev 🛠 Dev 👁 0 📖 3 min read

Endec: Rethinking How We Share Sensitive Information Online.

We share information online every single day. Messages, documents, passwords, API keys, and sometimes even confidential files. But have you ever thought about how securely that information is actually being shared? I s

We share information online every single day. Messages, documents, passwords, API keys, and sometimes even confidential files.

But have you ever thought about how securely that information is actually being shared?

I started thinking about this problem when I came across the idea of making everyday message sharing more private and secure. I wanted to build something that would allow people to share sensitive information without having to blindly trust the platform handling it.

That idea eventually turned into Endec.

What is Endec?

Endec is a privacy-focused secret-sharing application that allows users to securely share messages, confidential information, and PDF documents through encrypted links or images.

The core idea is simple:

Your secrets should remain yours, even when you're sharing them online.

Instead of sending plain-text information to a server, Endec encrypts the content on the client side. The server stores only encrypted data, while the recipient decrypts it using the corresponding key.

GitHub: https://github.com/prem-programs/Endec

Live Demo: https://endec.onrender.com/

What can you do with Endec?

I wanted Endec to be more than just another text encryption tool. So I worked on a few different ways of sharing confidential information.

1. Secure message sharing

Write a message, encrypt it, and generate a shareable link.

The recipient can open the link and decrypt the message using the key embedded in the URL fragment.

2. PDF encryption and sharing

Sometimes the information we want to share isn't just text.

Endec supports encrypted PDF attachments, allowing users to share confidential documents alongside their messages.

3. Image Steganography

This was one of the most interesting parts of the project.

What if you could hide a secret message inside an ordinary image?

Endec uses image steganography to embed encrypted information into images. The recipient can upload the image to extract the hidden payload and decrypt the message.

4. Burn After Reading

Not every message needs to exist forever.

Endec supports one-time secret sharing, where a secret can be destroyed after it has been viewed.

It also supports configurable expiration periods.

How does Endec work internally?

Building Endec gave me an opportunity to understand how encryption, backend systems, and image processing can work together.

Here's a simplified overview of its architecture.

Client-side encryption

Endec uses the Web Crypto API with AES-256-GCM for authenticated encryption and PBKDF2 for key derivation.

The encryption happens inside the browser before the data reaches the backend.

Key isolation

One interesting implementation detail is how the decryption key is shared.

The key is placed in the URL fragment (#key). Browsers do not include URL fragments in HTTP requests, meaning the server doesn't receive the decryption key through the request URL.

Backend storage

The Flask backend handles encrypted payload storage, retrieval, expiration, and deletion.

It uses Flask-SQLAlchemy, with SQLite for local development and PostgreSQL for production.

Image processing

For steganography, I implemented an image encoding and decoding workflow using Python, Pillow, and NumPy.

This allows encrypted payloads to be embedded into and extracted from images.

Tech Stack

Here's what I used to build Endec:

  • Backend: Python, Flask, Flask-SQLAlchemy
  • Frontend: HTML, CSS, JavaScript
  • Cryptography: Web Crypto API, AES-256-GCM, PBKDF2
  • Image Processing: Pillow, NumPy
  • PDF Security: PyPDF
  • Database: SQLite, PostgreSQL
  • Deployment: Docker, Gunicorn, Render
  • Testing: Pytest

What I learned while building Endec

This project was not just about implementing features. It pushed me to understand how different parts of software engineering fit together.

Some of the things I explored along the way:

  • Implementing client-side encryption using browser cryptography APIs.
  • Understanding encryption keys, initialization vectors, and authenticated encryption.
  • Building REST APIs with Flask.
  • Working with image processing and LSB-based steganography.
  • Handling file uploads and encrypted PDF attachments.
  • Managing database configurations across local and production environments.
  • Writing tests for backend APIs and image-processing functionality.
  • Deploying an application using Docker and Render.

One of my biggest takeaways was that building a feature is one thing, but understanding the security implications of how that feature works is a completely different challenge.

What's next?

Endec is an ongoing project, and there is still plenty of room for improvement.

I want to continue exploring better security practices, improve the user experience, and make the application more reliable.

Final Thoughts

Endec started with a simple question:

Can we make sharing sensitive information online more private without making the experience complicated?

Building it helped me explore cryptography, backend development, image processing, and application security in a single project.

I'm still learning, experimenting, and improving it.

If you're interested in exploring the implementation, contributions, or simply trying it out, check out the project:

GitHub: https://github.com/prem-programs/Endec

Live Demo: https://endec.onrender.com/

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.