<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aleksandr Smirnov</title>
    <description>The latest articles on DEV Community by Aleksandr Smirnov (@alxsm).</description>
    <link>https://dev.to/alxsm</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4190105%2F22a787d7-fb13-4b60-bda7-364606bea4c8.jpg</url>
      <title>DEV Community: Aleksandr Smirnov</title>
      <link>https://dev.to/alxsm</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alxsm"/>
    <language>en</language>
    <item>
      <title>Putting the key in the URL fragment: an E2E design for SecretBolt (RFC)</title>
      <dc:creator>Aleksandr Smirnov</dc:creator>
      <pubDate>Thu, 22 Oct 2026 17:36:28 +0000</pubDate>
      <link>https://dev.to/alxsm/putting-the-key-in-the-url-fragment-an-e2e-design-for-secretbolt-rfc-1da6</link>
      <guid>https://dev.to/alxsm/putting-the-key-in-the-url-fragment-an-e2e-design-for-secretbolt-rfc-1da6</guid>
      <description>&lt;h2&gt;
  
  
  Why this post
&lt;/h2&gt;

&lt;p&gt;In &lt;a href="https://dev.to/alxsm/how-a-one-time-secret-link-actually-works-the-design-of-secretbolt-4c5o"&gt;part 1&lt;/a&gt; I described how a SecretBolt link works today. The short version: secrets are encrypted at rest with AES-256-GCM, but the server decrypts them when someone opens the link. That is a trust-the-operator design, and I said so.&lt;/p&gt;

&lt;p&gt;In the comments, a reader suggested the obvious next step: put the key in the URL fragment and decrypt in the browser, so the server never holds anything it can read. They also gave a piece of advice I want to build around: keep the decrypt page tiny and static, with no third-party scripts, so people can actually check what runs.&lt;/p&gt;

&lt;p&gt;This post is the design, written before the code. I'd like you to poke holes in it. Anything you find now is cheaper to fix than after it ships.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the server sees, today and with E2E
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Today&lt;/th&gt;
&lt;th&gt;E2E mode&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Secret content&lt;/td&gt;
&lt;td&gt;Encrypted at rest, decrypted by the server on view&lt;/td&gt;
&lt;td&gt;Ciphertext only; the server never has the key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Encryption key&lt;/td&gt;
&lt;td&gt;Rails Active Record Encryption keys on the server&lt;/td&gt;
&lt;td&gt;256-bit key generated in the sender's browser&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Where the key travels&lt;/td&gt;
&lt;td&gt;Never leaves the server&lt;/td&gt;
&lt;td&gt;Only in the link fragment (&lt;code&gt;#...&lt;/code&gt;), which browsers don't send to servers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A database or backup leak exposes&lt;/td&gt;
&lt;td&gt;Plaintext of live secrets, if the encryption keys leaked too. Destroyed secrets are already erased&lt;/td&gt;
&lt;td&gt;Ciphertext of live secrets only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Passphrase&lt;/td&gt;
&lt;td&gt;bcrypt hash, checked by the server&lt;/td&gt;
&lt;td&gt;Mixed into the key in the browser; the server never sees it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Event log&lt;/td&gt;
&lt;td&gt;Created, viewed, expired, destroyed; IP and user agent on views&lt;/td&gt;
&lt;td&gt;Same; content, key and passphrase are never logged&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The fragment trick is not new: &lt;a href="https://privatebin.info" rel="noopener noreferrer"&gt;PrivateBin&lt;/a&gt;, &lt;a href="https://bitwarden.com/products/send/" rel="noopener noreferrer"&gt;Bitwarden Send&lt;/a&gt; and &lt;a href="https://github.com/jhaals/yopass" rel="noopener noreferrer"&gt;Yopass&lt;/a&gt; all keep the key after the &lt;code&gt;#&lt;/code&gt;. What I want to get right is the part around it: who can spend a view, what the passphrase protects, and the page that does the decryption.&lt;/p&gt;

&lt;h2&gt;
  
  
  The flow
&lt;/h2&gt;

&lt;p&gt;In v1, E2E is a checkbox on both web forms: the no-account form on the home page and the form in the dashboard. Here is what happens when it is ticked.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Generate a key.&lt;/strong&gt; The browser generates a random 256-bit master key with WebCrypto. If the sender sets a passphrase, it is stretched with PBKDF2-SHA256 (600,000 iterations, random 128-bit salt) and mixed in.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Derive two values.&lt;/strong&gt; HKDF turns the master key into two independent values: &lt;code&gt;enc_key&lt;/code&gt; for encryption and &lt;code&gt;access_token&lt;/code&gt; for the server. Knowing &lt;code&gt;access_token&lt;/code&gt; tells you nothing about &lt;code&gt;enc_key&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Encrypt.&lt;/strong&gt; AES-256-GCM with a random 96-bit IV. The format version goes in as additional authenticated data, so the version label can't be swapped without breaking decryption.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Upload.&lt;/strong&gt; The server receives the ciphertext, the IV, a hash of &lt;code&gt;access_token&lt;/code&gt; and the usual settings (views, expiry). It never sees the master key, &lt;code&gt;enc_key&lt;/code&gt; or the passphrase.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build the link.&lt;/strong&gt; The sender gets &lt;code&gt;https://secretbolt.io/s/&amp;lt;token&amp;gt;#v1.&amp;lt;key&amp;gt;&lt;/code&gt;, or &lt;code&gt;#v1.p.&amp;lt;salt&amp;gt;.&amp;lt;key&amp;gt;&lt;/code&gt; when there is a passphrase. The token finds the record; everything after &lt;code&gt;#&lt;/code&gt; stays in the browser. The &lt;code&gt;v1&lt;/code&gt; prefix lets the format change later without breaking old links. The &lt;code&gt;p&lt;/code&gt; flag tells the static page to ask for a passphrase, and the salt travels with it: a salt isn't secret, and this way the page needs nothing from the server before Reveal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open the link.&lt;/strong&gt; For an E2E secret, &lt;code&gt;/s/&amp;lt;token&amp;gt;&lt;/code&gt; serves a prebuilt static HTML file, outside the Rails layout and importmap, so the page runs with no inline scripts at all. It removes the key from the address bar with &lt;code&gt;history.replaceState&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reveal.&lt;/strong&gt; Nothing is fetched until the recipient presses Reveal, and enters the passphrase if there is one. The browser derives &lt;code&gt;access_token&lt;/code&gt; and sends it in a POST. The server hands out the ciphertext only if the hash matches, and only then counts the view. Link-preview bots never get that far.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decrypt.&lt;/strong&gt; The browser decrypts and shows the secret. The server erases the ciphertext under the same rules as today.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  What a wrong key or passphrase does
&lt;/h3&gt;

&lt;p&gt;If a chat app cut off the end of the link, or the passphrase is wrong, the derived &lt;code&gt;access_token&lt;/code&gt; doesn't match. The server refuses, and the view is not spent: the recipient can ask for the full link and try again. A token that leaks on its own, from a log for example, can't open the secret or burn it. Wrong attempts will be rate-limited per secret and per IP. After a wrong passphrase, keep the tab open to retry: the key is no longer in the address bar, so a reload needs the link again.&lt;/p&gt;

&lt;p&gt;Each secret has its own key, so a ciphertext moved into another record simply fails to decrypt.&lt;/p&gt;

&lt;h3&gt;
  
  
  The passphrase
&lt;/h3&gt;

&lt;p&gt;Because the passphrase is part of the key, a compromised server learns nothing from it, and there is no bcrypt hash to attack. The price is that a forgotten passphrase can't be recovered by anyone, including us.&lt;/p&gt;

&lt;p&gt;I chose PBKDF2 over Argon2 on purpose. Argon2 isn't in WebCrypto and would need a WASM bundle, which goes against a tiny decrypt page. PBKDF2-SHA256 is built into every browser, and 600,000 iterations follows the current &lt;a href="https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html" rel="noopener noreferrer"&gt;OWASP guidance&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Size limits
&lt;/h3&gt;

&lt;p&gt;The server no longer sees the text, so limits apply to the ciphertext. It is about a third larger than the text (base64 plus the GCM tag), and the 10 KB limit for no-account secrets will be counted on the ciphertext. In practice that means about 7.5 KB of text.&lt;/p&gt;

&lt;h2&gt;
  
  
  The decrypt page: tiny, static, verifiable
&lt;/h2&gt;

&lt;p&gt;With E2E, the code that runs in your browser is the security boundary. So the page that runs it should be small enough to read in a few minutes. Encryption happens on the home page and in the dashboard, which stay regular Rails pages: the code that touches the key there is the same kind of static script file, loaded on its own, but the page around it is rendered by Rails. Only the decrypt page is fully static.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Static.&lt;/strong&gt; One HTML file and one JavaScript file, served as they are, outside the Rails layout and importmap. No templates, no framework, no build step that changes the output between deploys.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No third-party code.&lt;/strong&gt; No analytics, fonts, CDNs or chat widgets on the create and decrypt pages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strict CSP.&lt;/strong&gt; &lt;code&gt;script-src 'self'&lt;/code&gt;, no inline scripts, &lt;code&gt;connect-src 'self'&lt;/code&gt;, &lt;code&gt;frame-ancestors 'none'&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;Referrer-Policy: no-referrer&lt;/code&gt;&lt;/strong&gt;, as a second layer on top of the fragment never being sent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Published source and hash.&lt;/strong&gt; The source of the decrypt page and of the encryption script will be public, and the SHA-256 of the served script will be listed in the docs. You can compare what your browser received with what you reviewed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A note on Subresource Integrity: the page will use it, but it buys little here. The HTML and the script come from the same server, so whoever can swap the script can swap the &lt;code&gt;integrity&lt;/code&gt; attribute too. SRI here mainly pins the HTML to one exact script version; it does not defend against our own server.&lt;/p&gt;

&lt;p&gt;The published hash doesn't make the page trustless either. It makes a quiet change noticeable, which is about as far as a web page can go.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this does not protect against
&lt;/h2&gt;

&lt;p&gt;I'd rather list these up front than have someone find them in the comments.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A malicious or compromised server.&lt;/strong&gt; If the server sends different JavaScript, it can read the key and the passphrase. The published hash helps you notice, but most people won't check every time. This is the honest limit of any browser-based E2E.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Browser extensions&lt;/strong&gt; with access to the page can read the secret after decryption.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wherever the link was pasted.&lt;/strong&gt; The key lives in the full link, so it sits in the chat or email you sent it through, and possibly in the sender's browser history. One-time viewing limits the damage: after the first view there is no ciphertext left to decrypt.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The recipient's browser history.&lt;/strong&gt; &lt;code&gt;replaceState&lt;/code&gt; runs only after the page has loaded, so the full link with the key may already be in the recipient's history, and synced to their browser account. One-time viewing limits this too.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Whoever opens the link first.&lt;/strong&gt; If someone intercepts the link, they get the secret and the real recipient sees "already viewed". A passphrase sent over a different channel closes most of that gap.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Link scanners that click.&lt;/strong&gt; Email security scanners and some preview bots open links in a real browser, fragment included. They see only the static page, because nothing is fetched before Reveal. A scanner that also presses buttons could burn the view; a passphrase sent separately stops that.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Abuse handling never relied on reading content, so it doesn't change: rate limits, size limits and the Report abuse link work the same for E2E secrets.&lt;/p&gt;

&lt;h2&gt;
  
  
  What stays the same in v1
&lt;/h2&gt;

&lt;p&gt;E2E is opt-in on both web forms. The API, the CLI examples and the &lt;code&gt;/export&lt;/code&gt; endpoint keep working exactly as described in part 1. An E2E secret requested through the API returns a clear error instead of ciphertext. Doing the decryption in a shell without leaking the key is a separate design problem, and I'd rather solve it properly later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Open questions
&lt;/h2&gt;

&lt;p&gt;These are the parts I'm least sure about. Replies in the comments are very welcome.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;PBKDF2 cost on phones.&lt;/strong&gt; 600,000 iterations takes a noticeable moment on older phones. Is that fine for a one-off reveal, or is a lower count with stricter server-side rate limits the better trade?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IP and user agent in E2E mode.&lt;/strong&gt; Today the event log keeps the IP and user agent of each view, for abuse handling, and deletes them with the record, 30 days after the secret is destroyed. Should E2E secrets log less, or is the abuse case worth keeping it?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hash verification.&lt;/strong&gt; Is a published SHA-256 plus public source enough? A saved local copy of the page would be stronger, but opened from &lt;code&gt;file://&lt;/code&gt; its requests run into CORS and &lt;code&gt;connect-src&lt;/code&gt;, so it isn't a free win.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can try the current version without an account at &lt;a href="https://secretbolt.io/?ref=devto" rel="noopener noreferrer"&gt;secretbolt.io&lt;/a&gt;. If you'd like to hear when E2E ships, follow this series; part 3 will cover what changed after your feedback.&lt;/p&gt;

</description>
      <category>security</category>
      <category>webdev</category>
      <category>devops</category>
      <category>showdev</category>
    </item>
    <item>
      <title>How a one-time secret link actually works: the design of SecretBolt</title>
      <dc:creator>Aleksandr Smirnov</dc:creator>
      <pubDate>Sun, 18 Oct 2026 16:49:07 +0000</pubDate>
      <link>https://dev.to/alxsm/how-a-one-time-secret-link-actually-works-the-design-of-secretbolt-4c5o</link>
      <guid>https://dev.to/alxsm/how-a-one-time-secret-link-actually-works-the-design-of-secretbolt-4c5o</guid>
      <description>&lt;p&gt;Every team has done it: pasted a database password or an API key into Slack "just this once". That message now lives in search, in backups, and on every laptop that synced it. I built &lt;a href="https://secretbolt.io/?ref=devto" rel="noopener noreferrer"&gt;SecretBolt&lt;/a&gt; to replace those messages with a link that works once and then disappears. This post walks through how it stores a secret, what it logs, how it deletes, and where its limits are.&lt;/p&gt;

&lt;h2&gt;
  
  
  The flow
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;You create a secret in the browser or with one API call, and choose how many views it allows and when it expires, within your plan's limits.&lt;/li&gt;
&lt;li&gt;SecretBolt returns a link. You send it over any channel.&lt;/li&gt;
&lt;li&gt;The recipient opens the link and clicks &lt;strong&gt;Reveal&lt;/strong&gt;. Once the view limit or the expiry is reached, the secret stops being served and its encrypted content is erased.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsS&lt;/span&gt; https://secretbolt.io/api/v1/secrets &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer &lt;/span&gt;&lt;span class="nv"&gt;$KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"name": "prod-db", "content": "postgres://...", "max_views": 1, "expires_in_hours": 24}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"prod-db"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://secretbolt.io/s/&amp;lt;token&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"token"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;token&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"expires_at"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Opening a link doesn't spend a view
&lt;/h2&gt;

&lt;p&gt;Slack, Teams and mail scanners fetch every link they see to build a preview. If opening the link returned the secret, a bot would burn it before the recipient ever saw it. So &lt;code&gt;GET /s/&amp;lt;token&amp;gt;&lt;/code&gt; only renders a page with a Reveal button. The view is spent by the POST that button sends, and the content comes back in that response, marked &lt;code&gt;no-store&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;One gap remains: some scanners, Microsoft Defender among them, submit forms themselves in a sandbox. Against those, only a passphrase helps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Encryption at rest
&lt;/h2&gt;

&lt;p&gt;Secret content is encrypted with AES-256-GCM through Rails Active Record Encryption, with a fresh random IV every time it is encrypted. GCM is authenticated, so a tampered ciphertext fails to decrypt instead of returning garbage.&lt;/p&gt;

&lt;p&gt;The encryption keys live in the app's encrypted credentials. The key that unlocks those credentials is handed to the server at deploy time and is never stored in the repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links and passphrases
&lt;/h2&gt;

&lt;p&gt;Each link carries a random 192-bit token, so guessing one is not a realistic attack. A secret can also have a passphrase, which you send through a different channel. SecretBolt stores only a bcrypt hash of it, and passphrase attempts are rate-limited.&lt;/p&gt;

&lt;p&gt;To be precise about what a passphrase does: it is an access check, not an encryption key. It stops someone who intercepted the link. It does not protect against someone who holds both the database and the server's keys. That case is covered below.&lt;/p&gt;

&lt;h2&gt;
  
  
  What gets logged
&lt;/h2&gt;

&lt;p&gt;Every secret has an event log: created, viewed, expired, destroyed. Views record the viewer's IP address and user agent, so you can tell whether the person you sent it to opened it, or someone else did first. The event log never records the content, the passphrase or the link.&lt;/p&gt;

&lt;p&gt;The event log isn't the only place a link could leak, so here is what the server logs keep:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The request log replaces the token in every path with &lt;code&gt;[FILTERED]&lt;/code&gt; (&lt;code&gt;Started POST "/s/[FILTERED]/reveal"&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;It doesn't record the client's IP address, and the web servers in front of the app run with request logging off.&lt;/li&gt;
&lt;li&gt;The one exception is a request rejected by rate limiting. It is logged with its IP address, so abuse can be traced, but its path is still masked.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Deletion, honestly
&lt;/h2&gt;

&lt;p&gt;When a secret stops being served (its last view, its owner deleting it, or its expiry), its encrypted content and passphrase hash are erased in the same database write. The database itself rejects a destroyed secret that still holds content, so a code path that forgets to erase fails loudly instead of leaking quietly. An expired secret is never served past its expiry, and its content is erased within 10 minutes of it.&lt;/p&gt;

&lt;p&gt;What stays is the metadata (name, view count, timestamps) and the event log, so you can still see who opened the secret. They are permanently deleted 30 days later.&lt;/p&gt;

&lt;p&gt;Database backups are kept for 30 days, so ciphertext can remain in a backup for up to 30 days after it was erased. I'd rather state this than promise "gone forever".&lt;/p&gt;

&lt;h2&gt;
  
  
  Not end-to-end encrypted
&lt;/h2&gt;

&lt;p&gt;SecretBolt is not end-to-end encrypted. The server holds the keys, and while serving a secret it handles the plaintext. That is the trade-off that makes the API useful: a CI job or a script can fetch a secret with a plain HTTP call, with no client-side crypto. If your threat model includes the server operator, use a tool that encrypts in the browser, such as Yopass.&lt;/p&gt;

&lt;h2&gt;
  
  
  Loading a secret into your shell
&lt;/h2&gt;

&lt;p&gt;To fetch a secret from a script, the recipient needs a read-only API key from a free account. Secrets created on the homepage without an account can only be opened in the browser.&lt;/p&gt;

&lt;p&gt;The export endpoint turns a &lt;code&gt;KEY=value&lt;/code&gt; secret into shell &lt;code&gt;export&lt;/code&gt; lines. Every value is single-quoted, so loading it only assigns variables and never runs embedded commands. Variables that can make the shell, the dynamic linker or a language runtime execute code (such as &lt;code&gt;PATH&lt;/code&gt; or &lt;code&gt;LD_PRELOAD&lt;/code&gt;) are replaced with comments. That list can't be exhaustive, so only load secrets from people you trust.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recommended: write to a private file, read it, then load it&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;umask &lt;/span&gt;077 &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; curl &lt;span class="nt"&gt;-fsS&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; .env.secretbolt &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer &lt;/span&gt;&lt;span class="nv"&gt;$READ_ONLY_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  https://secretbolt.io/api/v1/secrets/&lt;span class="nv"&gt;$TOKEN&lt;/span&gt;/export &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"X-Passphrase: &lt;/span&gt;&lt;span class="nv"&gt;$PASSPHRASE&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;   &lt;span class="c"&gt;# leave $PASSPHRASE empty if the secret has none&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; .env.secretbolt          &lt;span class="c"&gt;# check what you're about to load&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; ./.env.secretbolt&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;set&lt;/span&gt; +a
&lt;span class="nb"&gt;rm&lt;/span&gt; .env.secretbolt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In a CI pipeline, drop the &lt;code&gt;cat&lt;/code&gt; line, since it prints the values into the build log. Keep the file out of git.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Shortcut: &lt;code&gt;eval&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;secret_env&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-fsS&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer &lt;/span&gt;&lt;span class="nv"&gt;$READ_ONLY_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  https://secretbolt.io/api/v1/secrets/&lt;span class="nv"&gt;$TOKEN&lt;/span&gt;/export &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"X-Passphrase: &lt;/span&gt;&lt;span class="nv"&gt;$PASSPHRASE&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;   &lt;span class="c"&gt;# leave $PASSPHRASE empty if the secret has none&lt;/span&gt;
  &lt;span class="nb"&gt;eval&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$secret_env&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is quicker, but &lt;code&gt;eval&lt;/code&gt; means trusting every server response without looking at it. Thanks to a reader in the comments for pushing me to make the file route the default.&lt;/p&gt;

&lt;p&gt;Each fetch uses up one view, so this suits one-off handoffs rather than repeated pipeline reads. Docker needs a different format; see the &lt;a href="https://secretbolt.io/docs?ref=devto#docker" rel="noopener noreferrer"&gt;docs&lt;/a&gt; for &lt;code&gt;docker run&lt;/code&gt;, &lt;code&gt;docker stack&lt;/code&gt; and &lt;code&gt;docker compose&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;You can create a secret on the &lt;a href="https://secretbolt.io/?ref=devto" rel="noopener noreferrer"&gt;homepage&lt;/a&gt; without an account: one view, one-hour expiry. It's tied to no account, and your IP address isn't stored with it. The address is only used to count recent secrets for rate limiting. A free account adds the API, up to 24 hours and 2 views per secret, 10 active secrets, and the event log.&lt;/p&gt;

&lt;p&gt;One question I'd really like answered in the comments: would you &lt;code&gt;eval&lt;/code&gt; a response from a remote server, and what would it take to convince you it's safe?&lt;/p&gt;

</description>
      <category>security</category>
      <category>devops</category>
      <category>showdev</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
