Giter Club home page Giter Club logo

stegosecrets's Introduction

StegoSecretS

StegoSecretS combines AES-256 encryption, Shamir's Secret Sharing (SSS) and steganography!

It helps you sharing a secret among other trusted peers, keeping a minimum threshold of keys to recover the original one. The partial keys will be also hidden inside images, adding an additional layer of "security".

Note: the project is under active development. The APIs are subject to change!

Quickstart

TLDR. Go to the usage section for more details

stego encrypt --file mysecret.txt --parts 5 --threshold 3
stego decrypt --file mysecret.txt.enc --img 1.jpg --key 2.key --img 3.jpg

How does it work?

Alice wants to protect her new "patent pending nuclear blender project" from EvilCompany.
They want it, so she asks her friends Bob, Charlie and Dave to keep it safe.
She trusts them, but to add an additional layer of security she email them an encrypted file, and an image of a cat containing a special key. ๐Ÿˆ

With this special key Bob alone is not able to decrypt the secret, so even if someone from EvilCompany gets the hands on his secret it will be useless. They will still need to get also Charlie and Dave keys.

Ok, but.. how does it work?

An input file (or message) will be encrypted using AES-256 with a crypto secure random 32 bit key. This key will be then splitted in p parts with the Shamir's Secret Sharing algorithm (SSS).
A t threshold of partial keys is needed to recover the original one, and decrypt the secret.

IMG

For example, encrypting the file having 5 parts with a threshold of 3 will split the master-key into 5 pieces. These pieces will be also hidden into 5 images. To reconstruct the original master key at least 3 partial keys and/or images are needed.

IMG

Usage

encrypt

To encrypt a file you can explicit the filename:

stego encrypt --file mysecret.txt -p 5 -t 3

or you can write the message:

-> % stego encrypt -p 5 -t 3
Enter text: my secret message

This will generate (a lot) of files:

# out
mysecret.txt.checksum
mysecret.txt.enc
mysecret.txt.enc.checksum
mysecret.txt.key

1.jpg
1.jpg.checksum
1.key
2.jpg
2.jpg.checksum
2.key
...
5.jpg
5.jpg.checksum
5.key

Main files:

  • mysecret.txt.checksum is the sha256 checksum of the mysecret.txt file (used to check a successful decryption)
  • mysecret.txt.enc is the encrypted file
  • mysecret.txt.enc.checksum is the sha256 checksum of the mysecret.txt
  • mysecret.txt.key is the master key used to encrypt/decrypt the secret

Partial files:

  • n.key the n partial key
  • n.jpg the n image where the n partial key is hidden
  • n.jpg.checksum is the sha256 checksum of the n.jpg image

Note: If no parts are specified the master-key will not be splitted. Keep it safely stored, or delete it.

Checksums can be used to check the integrity of the files:

-> % sha256sum --check mysecret.txt.enc.checksum
mysecret.txt.enc: OK

decrypt

To decrypt a file just use enough keys and/or images:

stego decrypt --file mysecret.txt.enc --key 1.key --key 2.key --img 3.jpg

also the master key alone can be used to decrypt the file:

stego decrypt --file mysecret.txt.enc --master-key mysecret.txt.key

images

To hide the partial keys with steganography you will need a folder with some images.
To get some random images from https://picsum.photos/ the images command can be used. They will be stored in the images folder.

stego images

stegosecrets's People

Contributors

enrichman 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.