Skip to content

dahvde/cryptn.it

Repository files navigation

Cryptn.it - Secure temporary text storage

GitHub License GitHub Actions Workflow Status

A simple and open source temporary text storage. With the use of AES encryption, text stored on the server is only accessable with the correct hash and or password. The public webapp allows url hash sizes from 4-32 characters, which can be changed to be smaller or larger when locally hosted. All sensitive text is stored either as a hash or an encrypted string.

Overview

How does it work?

// Variables are all caps
// Variables surrounded by brackets indicate new variables equal to their adjacent function
// Variables with a questionmark are optional

[TEXT] - getText()

// Url Generation
[Client] (payload: STRLENGTH) -> Server
[Server] Generates a new random url [URL] - randomStr(STRLENGTH)
[Server] URL is hashed then stored in a temp database
[Server] (payload: URL) -> Client

// Encryption
[Client] Uses AES to encrypt text and uses URL as the key [ENCTEXT] - aes(TEXT, RNDSTR+PASSWORD?)
[Client] URL is hashed [HASHURL] - HASH(URL)
[Client] (payload: ENCTEXT, STRLENGTH, HASHURL, ...) -> Server
[Server] Validates that HASHURL is in temp database
[Server] Sql command get executed to store data - SQL(ENCTEXT, HASH, ...)
[Client] Combines URL with the url to direct the users to the stored text - https://cryptn.it/URL

Installation

Requirements:

git clone https://github.com/dahvde/cryptn.it
cd cryptn.it
docker-compose up -d

Uninstall

cd cryptn.it
docker-compose down --rmi all --volumes --remove-orphans

HTTPS Requirement

⚠️ Important: The Web Crypto API requires a secure context (HTTPS) to function. The application will not work when served over HTTP. If you are running and accessing the application from a single machine then this does not apply.

Hosting Options

To run the application locally with HTTPS, you can use one of these methods:

  1. Using a Local SSL Certificate

    mkcert -install
    mkcert localhost
  2. Using a Reverse Proxy (e.g., Caddy)

    # Caddyfile
    localhost {
        reverse_proxy localhost:{PORT}
    }
    
  3. Using Local SSL Proxy

    npm install -g local-ssl-proxy
    local-ssl-proxy --source {APPLICATION_PORT} --target {FORWARD_PORT}

Features

Completed

  • End-to-End Encryption
  • Text Viewing Interface
  • Syntax Highlighting

In Progress

  • Public Sharing
  • File Uploads (mp3, jpg, ...)
  • Tags

About

Temporary and private text storage

Topics

Resources

License

Stars

Watchers

Forks

Contributors