#encryption-key #rocket-web #web-framework #pastebin #secure #clone #stored

app pastabin

A pastebin clone written in Rust. Allows encrypting by returning a password string that can be passed like /<id>/<password>

3 releases

0.1.2 Nov 15, 2023
0.1.1 Nov 15, 2023
0.1.0 Nov 15, 2023

#1012 in HTTP server

33 downloads per month

MIT license

15KB
119 lines

Pastabin

A Pastebin clone written in Rust using the Rocket web framework. It is:

  • Fast: Rocket is one of the fastest web frameworks available for Rust.

  • Correct: No unwraps were used in the making of this program.

  • Secure: Pastas can be encrypted by calling the "newPastaSecure" endpoint. The encryption key is never stored on the server.

Usage

Start the server by building the project and running the binary. The server will listen on port 8000 by default.

Endpoints

GET /:id

Returns the contents of the pasta with the given id. If the pasta is encrypted, the encrypted string will be returned, obviously without a password

Get /:id/:password

Returns the contents of the pasta with the given id, decrypted with the given password. If the pasta is not encrypted, the password is ignored.

POST /newPasta

Creates a new pasta with the given contents. Returns the id of the new pasta.

POST /newPastaSecure

Creates a new pasta with the given contents. Returns the id of the pasta, and the encryption key in JSON format. The encryption key is never stored on the server. So if you lose it, you're sol.

Dependencies

~17–53MB
~855K SLoC