Skip to main content

npaste – a simple paste bin

At work, I often need to share secrets and other important information with my colleagues. We use Slack to communicate with each other, and that’s good enough for the most part. Now and then, we share secret stuff. Like, top secret. There are many paste bins on the internet that we could use, but I don’t really trust them for these things. So I created my own: npaste.

npaste is a very simple paste bin that supports both images and text. It uses GPG to encrypt pastes before they are uploaded to the server. The encryption key is appended to the URL after a hashbang on the client uploading the paste, so the server never knows about the key. In the browser, the paste is decrypted using OpenGPG.

The npaste cli client supports downloading pastes, both encrypted and non-encrypted. I haven’t spent much time perfecting the project, so contributions to it are very welcome. Let’s have a look at how it works!

Uploading text

Let’s say you have some super secret text that you’d like to share with your colleague. You store it in a file named super-secret.txt and then run the following command:

npaste --encrypt --no-archive=1 -age=1h super-secret.txt

The npaste client will do all the dirty work and return a URL (it’s also copied to the clipboard automatically):

https://paste.yourdomain.com/68678632939f75e9bbd0a4f8#e61ac5c997098e59337b653a27fcff27

By specifying the --no-archive=1 flag, you tell the server to physically delete this paste after it expires, as opposed to just archiving it. The --age=1h flag tells the server to set the expiration of the paste to one hour in the future.

Uploading images

There’s really nothing else you’d have to do if you wanted to upload an image instead. The CLI script will take care of all the dirty work, so the command is exactly the same:

npaste --encrypt --no-archive=1 -age=1h super-secret.jpg

Behind the scenes, the image will be Base64 encoded before being encrypted, and in the browser it will be decoded after being decrypted.

Downloading a paste

If someone sends you an npaste link and you’d like to download it to your computer, it’s as simple as this:

npaste --get https://paste.yourdomain.com/68678632939f75e9bbd0a4f8#e61ac5c997098e59337b653a27fcff27

The CLI script will figure out that this paste needs to be decrypted and it will store it in a file with the same name as the paste ID. You can then open it in your editor of choice to edit it.

Contributions are welcome

If you’re interested in contributing to the project, feel free to do so. It lives over on my private Gitea server:

https://src.grytoyr.io/kim/npaste/

Next steps

Here are a few things you can do:

2026

September

  • Note

    As quite evident by looking at my brand new reading page, I haven't read very much this year. Going forward I will do my very best to finish the books I'm currently reading and find some new exciting books to read. Currently only finished three, the goal is 10!

  • Note

    I just ordered a Fairphone 6+, Fairbuds and Fairbuds XL.

    I have an iPhone 17 as my daily driver, but I couldn't help but order this phone and headsets once I became aware it was a thing.

    My plan is to switch to all of these things, replacing my iPhone 17, AirPods Pro 3 and Bose QuietComfort Ultra. These will either be sold or given to someone who needs them.

    The initiative is great and their values even better. We need companies trying to counter the enormous pressure laid upon all of us to keep buying stuff all the time.

    I will post a thorough review of these items once I've used them for a while.

  • Tømmerneset rock carvings

2025

April

  • Note

    I will be posting changes to my website simply as notes tagged with changelog. This is the very first changelog of this site, and it summarizes the most important changes I've done since I started wiping the dust of this site in April this year.

    • I've added a Buttondown newsletter integration. Whenever I publish a new post on my blog, an email will be sent to my subscribers.
    • I've added a «Reply by email» button to all content. Do not hestitate to contact me if you have comments or feedback. Getting feedback is a big part of why I blog in the first place — I enjoy hearing from readers and being part of a thoughtful exchange now and then.
    • I've added a Search feature using Pagefind. It's not yet fully configured or customized, but it's working.
    • Added links to previous and next post, note and link.
    • Added a 404 page.
    • Reduced the size of uncompressed resources being loaded on the front page to 66 kB. Submitted a PR to be added to the 512kb.club website.
  • Our dog: Kento
  • Note

    This is the very first note on my new website. It's a GREAT note.

    It doesn't say much, but still – it marks the beginning of a new note-hosting era for this website.

  • Back to basics – again..