Giter VIP home page Giter VIP logo

bin's Introduction

Bin

Bin is an AES 128/256-bit encrypted, GitHub Gists-inspired, anonymous pastebin. All data on the server is encrypted such that the operators of the server have no knowledge of what data is stored on it. This tool was designed to be a replacement for my old debug information server that DiscordSRV uses. The problem with the old system was that while I am by no means a malicious actor, it raises a security concern that I was in possession of lots of debug information from the plugin and the servers using it, all in plain text. I don't really like that and I don't think it's fair to server owners either thus Bin was made.

How it works

When DiscordSRV or any other client uploads to Bin, it uploads the data after it's already been encrypted. The client just sends the encrypted data, without the key. It's the client's responsibility to make sure the encrypted data is able to be decrypted properly as the server has no way of knowing the contents of anything on it. When data is uploaded, the server gives back the bin UUID- the view URL is in the format https://host/UUID#KEY.

Notice how the key is after a #.

This is how you're able to have a URL that includes the decryption key without exposing the key to the server. Browsers don't send anything after # in URLs because that information is only really used for telling the browser to show a given element on the page. The cool part about that though is that the browser's JavaScript engine has access to this data and thus the decryption key. This lets the browser fetch the encrypted data from the server and decrypt it itself.

Developers

Bin exposes a few endpoints that're useful if you're making a client. Be sure to set a proper user agent.

GET /UUID.(json|xml) -> /api/UUID.(json|xml)
GET /api/UUID.(json|xml) -> /[latest API]/UUID.(json|xml)
GET /v1/UUID.(json|xml) -> JSON or XML dump of the bin data

POST /post
{
    // when generating the 16 or 32-byte key, only use alphanumeric characters
    // you can technically use whatever bytes you want in the key but that will restrict the bin to custom clients only
    // when encrypting data, it should be in the format "initializationVector[0-15]encryptedData[16...]"
    // in other words, the "encrypted data" should be the IV plus the actual encrypted data
    // and please- do not use the same IV for every encryption. it should be randomly generated for every encryption.

    "description": base64(aes("optional bin description")),
    "expiration": -43200, // optional expiration in minutes; negative number = minutes since creation,
                          //                                 positive number = minutes since last access
    "files": [
        {
            "name": base64(aes("file-name.txt")),
            "content": base64(aes("file content")),
            "description": base64(aes("optional file description")),
            "type": base64(aes("MIME type- if not defined, view page defaults to application/octet-stream"))
        },
        ...
    ]
}

Contributing

I'm not the best at front end design. If you want to add some visual improvements to Bin's UI, feel free to make a pull request.

bin's People

Contributors

scarsz avatar vankka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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