Lock It Up
Publish a page only the people with the password can read. The secret is encrypted in your browser before it ever leaves your machine — pastehtml.dev stores nothing but scrambled bytes.
Every paste on pastehtml.dev is served from its own isolated origin — a real
https://<token>.pastehtml.dev/ page where your scripts actually run. That one fact is
all we need to build a vault: ship a page that carries an encrypted blob plus a tiny
unlock screen, and let the reader's own browser do the decryption once they type the password.
The plaintext and the password never touch the server. You encrypt locally, publish only the ciphertext, and share the link plus the password through a separate channel. Lose the link and the password and there is genuinely nothing to recover — which is exactly the point.
How it works
The whole scheme rides on the browser's built-in Web Crypto API — no libraries, no CDN:
- Your password is stretched into a 256-bit key with PBKDF2 (SHA-256, 250,000 iterations) over a random salt. Stretching makes brute-forcing a weak password slow.
- Your content is encrypted with AES-256-GCM using a fresh random IV. GCM is authenticated, so a wrong password (or any tampering) fails loudly instead of silently returning garbage.
- The salt, IV, and ciphertext are base64-encoded and baked into a self-contained HTML file alongside a comic-styled unlock screen.
- You publish that file. The reader opens it, types the password, and the page decrypts the blob and renders your real content in a sandboxed frame — all client-side.
Below is a working forge that does steps 1–3 for you, right here on this page (it uses your browser's crypto, nothing is uploaded). Paste your secret, pick a password, and download a ready-to-publish locked page.
The Locker Forge
This is real cryptography, but its strength is entirely your password. A short or guessable password can be cracked offline by anyone who has the link, because they hold the ciphertext. Use a long, random passphrase for anything that matters. This protects against casual snooping and shoulder-surfing search engines — it is not a replacement for a secrets manager.
Publish it
However you built the file, publishing is the same two-button affair:
Option A — Drag & drop
Open pastehtml.dev and drop the .html file onto the
zone. You get back a private https://<token>.pastehtml.dev/ link instantly. Share that
link one place, the password another.
Option B — The API (great for agents & scripts)
Pipe the file straight up with curl:
curl -F "[email protected]" https://pastehtml.dev/api/pastes
You get 201 with the live_url to share and a one-time update_token
— save the token if you ever want to re-encrypt and PATCH the same link in place. Full contract
at pastehtml.dev/llms.txt.
What's inside the locked page
No magic — just the mirror image of the forge. The published file embeds your blob in a
<script type="application/json"> tag and runs this on unlock. Here is the exact template the
forge ships (read it, audit it, tweak it):
Loading template…
When the password is right, the decrypted bytes are dropped into a sandboxed <iframe> via
srcdoc, so even full HTML documents render correctly while staying isolated. When it is wrong,
AES-GCM's authentication tag rejects it and the unlock screen shakes — no plaintext leaks either way.
أقفِلها بإحكام
انشُر صفحةً لا يقرؤها إلا من يملك كلمة المرور. يُشفَّر السرّ داخل متصفِّحك قبل أن يغادر جهازك أصلًا — فلا يُخزِّن pastehtml.dev سوى بايتاتٍ مُبعثَرة.
لكلّ صفحة على pastehtml.dev أصلٌ مستقلٌّ خاصٌّ بها — صفحةٌ
حقيقيّة على العنوان https://<token>.pastehtml.dev/ تعمل فيها سكربتاتك فعليًّا. هذه الحقيقة
وحدها تكفي لبناء خزنة: انشُر صفحةً تحمل كتلةً مُشفَّرة وشاشة فتحٍ صغيرة، ودَع متصفِّح
القارئ يتولّى فكّ التشفير بمجرّد أن يُدخل كلمة المرور.
لا يلمس النصّ الأصليّ ولا كلمة المرور الخادمَ إطلاقًا. تُشفِّر محليًّا، وتنشر النصّ المُشفَّر وحده، وتشارك الرابط وكلمة المرور عبر قناتين منفصلتين. وإن فقدتَ الرابط وكلمة المرور معًا فلا سبيل لاستعادة شيء — وهذا هو المقصود تمامًا.
كيف تعمل الحيلة
تقوم الفكرة كلّها على واجهة Web Crypto المدمجة في المتصفِّح — بلا مكتبات ولا شبكات توصيل محتوى (CDN):
- تُمَدَّد كلمة مرورك إلى مفتاحٍ بطول 256 بِت باستخدام PBKDF2 (بخوارزمية SHA-256 و250,000 تكرار) مع مِلحٍ عشوائيّ. وهذا التمديد يُبطئ محاولات تخمين كلمات المرور الضعيفة.
- يُشفَّر محتواك بخوارزمية AES-256-GCM مع متّجه تهيئة (IV) عشوائيّ جديد. وبما أنّ GCM موثَّقة، فإنّ كلمة المرور الخاطئة (أو أيّ عبثٍ بالملف) تفشل بوضوح بدلًا من أن تُعيد خليطًا لا معنى له بصمت.
- يُرمَّز المِلح والـ IV والنصّ المُشفَّر بترميز base64، وتُدمَج جميعًا في ملفّ HTML مكتفٍ ذاتيًّا بجانب شاشة فتحٍ بأسلوب الكوميكس.
- تنشُر ذلك الملفّ. يفتحه القارئ ويُدخل كلمة المرور، فتفكّ الصفحة تشفير الكتلة وتعرض محتواك الحقيقيّ داخل إطارٍ معزول — كلّ ذلك داخل المتصفِّح.
في الأسفل أداةٌ عاملة تنفّذ الخطوات 1–3 نيابةً عنك، هنا على هذه الصفحة (تستخدم تشفير متصفِّحك، ولا تُرفَع أيّ بيانات). الصِق سرّك، اختَر كلمة مرور، ونزِّل صفحةً مقفلةً جاهزةً للنشر.
مِسبَك الأقفال
هذا تشفيرٌ حقيقيّ، لكنّ قوّته مستمدّةٌ بالكامل من قوّة كلمة مرورك. كلمة المرور القصيرة أو سهلة التخمين يمكن كسرها دون اتصالٍ بالإنترنت من قِبَل أيّ شخصٍ يملك الرابط، لأنّه يحوز النصّ المُشفَّر. استخدم عبارة مرورٍ طويلةً وعشوائيّةً لأيّ شيءٍ مهمّ. هذا يحميك من التطفّل العابر ومن فهرسة محرّكات البحث — وهو ليس بديلًا عن مدير أسرار.
انشُرها
أيًّا كانت طريقة بنائك للملفّ، فالنشر يتمّ بالخطوتين ذاتهما:
الخيار (أ) — السحب والإفلات
افتح pastehtml.dev وأفلِت ملفّ .html في المنطقة
المخصّصة. ستحصل فورًا على رابطٍ خاصّ بالشكل https://<token>.pastehtml.dev/. شارِك الرابط
في مكان، وكلمة المرور في مكانٍ آخر.
الخيار (ب) — واجهة الـ API (مثاليّة للوكلاء والسكربتات)
ارفع الملفّ مباشرةً باستخدام curl:
curl -F "[email protected]" https://pastehtml.dev/api/pastes
ستحصل على 201 يتضمّن live_url للمشاركة ورمز تحديثٍ update_token
يُكشَف مرّةً واحدة — احفظه إن أردتَ يومًا إعادة التشفير وتحديث الرابط نفسه بـ PATCH. الدليل
الكامل في pastehtml.dev/llms.txt.
ما الذي بداخل الصفحة المقفلة
لا سحر هنا — مجرّد صورةٍ معكوسة للمِسبَك. يُضمِّن الملفّ المنشور كتلتك داخل وسم
<script type="application/json"> ويُنفِّذ هذه الشيفرة عند الفتح. وهذا هو القالب نفسه الذي تنتجه
الأداة (اقرأه، دقِّقه، عدِّله):
Loading template…
عندما تكون كلمة المرور صحيحة، تُوضَع البيانات بعد فكّ تشفيرها في إطار <iframe> معزول عبر
srcdoc، فتُعرَض حتى مستندات HTML الكاملة عرضًا سليمًا مع بقائها معزولة. وعندما تكون خاطئة،
يرفضها وسم التوثيق في AES-GCM فترتجّ شاشة الفتح — ولا يتسرّب أيّ نصٍّ صريحٍ في الحالتين.