SafePaste is an open-source service similar to Pastebin where you are able to store any piece of text and generate links for easy cross platform sharing.
What makes SafePaste stand out is its lack of a database. It is 100% frontend (client side).
- Your links cannot be deleted
- Your links cannot be censored
- The server hosting SafePaste (including any fork using the same encode process) have no access to your data
- Your data will be accessible forever (as long as you have the link)
- Data is decoded on your device
- AES256 + Base64 encoding
Make sure your editor string starts with either --left
or --right
to change the text alignment. Otherwise it
defaults to center
.
The only currently supported markdown use case is [title](link)
.
When you click on "Generate URL", SafePaste generates a link based on your input: paste.misobarisic.com/<your data>
When you open a link, SafePaste reads and decodes whatever comes after the first /
upon which the appropriate data is
displayed in the editor.
SafePaste links can be easily created or read with a HTTP GET request:
Make sure to use x-www-form-urlencoded
to pass data.
The accept header should include application/json
or */*
.
data
refers to the original (redirect) URL, whereas
link
refers to the part of the URL after paste.misobarisic.com/
GET /api/encode
Body should contain: data
Example response:
{
"data": "this is an example",
"link": "dGhpcyBpcyBhbiBleGFtcGxl"
}
GET /api/encode
Body should contain: data, pass
// Password is not sent back in the response
Example response:
{
"data": "this is an example",
"link": "dGhpcyBpcyBhbiBleGFtcGxl"
}
GET /api/decode
Body should contain: link
Example response:
{
"data": "another example",
"link": "YW5vdGhlciBleGFtcGxl"
}
GET /api/decode
Body should contain: link, pass
// Password is not sent back in the response
Example response:
{
"data": "another example",
"link": "YW5vdGhlciBleGFtcGxl"
}
If you wish for all SafePaste links to be accessible on your fork of this project make sure not to edit these fields
config.js
module.exports.base = {
key: "safepaste"
}
utils/urlUtils.js
module.exports.generateURL = input => base64.encode(aes256.encrypt(key, input))
module.exports.decodeURL = input => aes256.decrypt(key, base64.decode(input))
👤 Mišo Barišić
- Website: https://www.misobarisic.com
- GitHub: @misobarisic
Give a ⭐️ if this project helped you!
Copyright © 2021 misobarisic.
This project is MIT licensed.