<?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: Miguel</title>
    <description>The latest articles on DEV Community by Miguel (@miguelenred).</description>
    <link>https://dev.to/miguelenred</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%2F4268625%2Fad5ed220-c0bc-455b-8490-178b56c9e115.png</url>
      <title>DEV Community: Miguel</title>
      <link>https://dev.to/miguelenred</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/miguelenred"/>
    <language>en</language>
    <item>
      <title>I built an open-source alternative to ionCube — here's what shipping encrypted PHP actually takes</title>
      <dc:creator>Miguel</dc:creator>
      <pubDate>Fri, 27 Nov 2026 10:09:11 +0000</pubDate>
      <link>https://dev.to/miguelenred/i-built-an-open-source-alternative-to-ioncube-heres-what-shipping-encrypted-php-actually-takes-3akf</link>
      <guid>https://dev.to/miguelenred/i-built-an-open-source-alternative-to-ioncube-heres-what-shipping-encrypted-php-actually-takes-3akf</guid>
      <description>&lt;p&gt;Hi DEV! I'm Miguel, and I've spent the last months building &lt;strong&gt;Envelock&lt;/strong&gt;: an offline encoder and a PHP extension that let you distribute PHP projects without shipping their files as readable text — an open-source (Apache-2.0) take on what ionCube and SourceGuardian do commercially, for PHP 8.2–8.5.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/miguelenred" rel="noopener noreferrer"&gt;
        miguelenred
      &lt;/a&gt; / &lt;a href="https://github.com/miguelenred/envelock" rel="noopener noreferrer"&gt;
        envelock
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Envelock: offline encoder and loader that protects PHP source (PHP 8.2-8.5). Version 1.1.2.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;p&gt;
  &lt;a rel="noopener noreferrer" href="https://github.com/miguelenred/envelock/docs/img/envelock-icon-256.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fmiguelenred%2Fenvelock%2FHEAD%2Fdocs%2Fimg%2Fenvelock-icon-256.png" alt="Envelock logo" width="140" height="140"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Envelock&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Offline encoder and loader extension for PHP 8.2–8.5.&lt;/strong&gt;&lt;br&gt;
Version &lt;strong&gt;1.1.2&lt;/strong&gt; · Python + C + OpenSSL 3 · Apache-2.0 license.&lt;br&gt;
Project page: &lt;strong&gt;&lt;a href="https://miguelenred.es/envelock" rel="nofollow noopener noreferrer"&gt;miguelenred.es/envelock&lt;/a&gt;&lt;/strong&gt; · Source: &lt;strong&gt;&lt;a href="https://github.com/miguelenred/envelock" rel="noopener noreferrer"&gt;github.com/miguelenred/envelock&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Distribute PHP projects without shipping their files in readable text. A &lt;strong&gt;generic&lt;/strong&gt; extension (with no embedded keys) verifies each file's signature, unwraps the content key with the recipient's private key, decrypts in memory and hands the result to PHP's normal compiler. The private key and the trusted signer are read from an external identity file pointed to by &lt;code&gt;envelock.identity&lt;/code&gt; in &lt;code&gt;php.ini&lt;/code&gt;. A single host can serve several projects from different folders, each encrypted with different keys.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;It is not a compiler to machine code, nor an invulnerable system.&lt;/strong&gt; Its aim is to keep PHP out of readable text and to stop the public engine, or another developer's keys, from decrypting packages meant for other recipients — subject to the cryptographic assumptions and…&lt;/p&gt;
&lt;/blockquote&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/miguelenred/envelock" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;If you sell or deploy PHP software onto servers you don't control, your realistic options have long been two proprietary products with closed loaders you have to trust, priced per server. I wanted the auditable version: a documented binary format, a loader anyone can build from public source, and modern cryptography instead of obfuscation alone. This post is about the decisions that took.&lt;/p&gt;

&lt;h2&gt;
  
  
  First decision: define what it is NOT
&lt;/h2&gt;

&lt;p&gt;Before writing a line of crypto, I wrote the threat model. Envelock is &lt;strong&gt;not&lt;/strong&gt; a compiler to machine code and &lt;strong&gt;not&lt;/strong&gt; DRM against the server's own operator — someone with root can still read fragments of process memory. What it does do, within cryptographic assumptions and a correct implementation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;keep PHP out of readable text on disk and in transit;&lt;/li&gt;
&lt;li&gt;stop the public engine, or another customer's keys, from decrypting packages meant for other recipients.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything else — every feature, every trade-off — flows from that honest scope. Saying it publicly in the README has cost me nothing and has prevented every "unbreakable DRM" argument before it starts.&lt;/p&gt;

&lt;h2&gt;
  
  
  The crypto, layer by layer
&lt;/h2&gt;

&lt;p&gt;On the packaging machine (keys never leave it; private keys are scrypt-encrypted by default):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the source is encrypted with &lt;strong&gt;AES-256-GCM&lt;/strong&gt;, a fresh content key per &lt;code&gt;pack&lt;/code&gt;, unique nonces by counter;&lt;/li&gt;
&lt;li&gt;the content key is &lt;strong&gt;wrapped per recipient&lt;/strong&gt; with X25519 + HKDF-SHA256 — repeat &lt;code&gt;--recipient&lt;/code&gt; and the same package is encrypted for several customers;&lt;/li&gt;
&lt;li&gt;the whole package is signed with &lt;strong&gt;Ed25519&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On the server, a generic extension (C + OpenSSL 3, &lt;strong&gt;no embedded keys&lt;/strong&gt;) does things in this strict order: verify the signature → unwrap the content key with the server's private key (from an identity file configured in &lt;code&gt;php.ini&lt;/code&gt;) → decrypt in memory → hand the code to PHP's normal compiler. Nothing decrypted is ever written to disk, no external service is called, and explicit buffers are cleared after compiling.&lt;/p&gt;

&lt;p&gt;Two details I'm fond of: the loader is generic — the same binary serves any identity, so one host can run several projects encrypted with different keys — and it &lt;strong&gt;fails closed&lt;/strong&gt;: if the OPcache blacklist is missing or wrong, it refuses to run rather than cache decrypted opcodes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. The real price of encrypted PHP is memory, not CPU.&lt;/strong&gt; Protected files can't be cached by OPcache, so every request compiles the ones it uses into its own memory, in every PHP worker. Measured on a real Laravel app under PHP-FPM 8.4: protecting only the application code costs about &lt;strong&gt;1 MB per request&lt;/strong&gt; (the same as unprotected); protecting &lt;code&gt;vendor/&lt;/code&gt; too, &lt;strong&gt;22 MB&lt;/strong&gt;. The &lt;code&gt;pack&lt;/code&gt; command now warns about encrypted vendor directories and states the measured memory ceiling (3–9× the original source) before you ship. Nobody talks about this, and it's the number one thing that decides whether encrypted PHP survives production.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Signatures protect you from attackers, not from yourself.&lt;/strong&gt; An end-to-end audit of the loader, the crypto core and the encoder found &lt;strong&gt;no attacker-reachable defect&lt;/strong&gt; — every finding sat behind the Ed25519 signature verified before any decrypt or deserialize — and still closed real defense-in-depth gaps: the bytecode deserializer now treats a signed image as hostile (it validates that every jump target lands on an aligned opline, rejects NULL interface/trait names, refuses stray pointers), a sealed package refuses to run if its &lt;code&gt;eval()&lt;/code&gt; gate was replaced after module init, and the file nonce domain is kept disjoint from the vault-wrap domain. The audit made the format stricter without changing it: 1.1.x packages interoperate and nothing had to be repacked.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Fuzz the deserializer as if the signature didn't exist.&lt;/strong&gt; It's fuzzed continuously under &lt;strong&gt;ASan/UBSan on every supported PHP version&lt;/strong&gt;. The mindset: today the signature guards the image; the day someone finds a signature bypass, the deserializer is already the second line of defense, not an open door.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. The supply chain is part of the product.&lt;/strong&gt; Every released loader is attested (&lt;code&gt;gh attestation verify &amp;lt;file&amp;gt; --repo miguelenred/envelock&lt;/code&gt;), release artifacts are hash-listed and enforced by script, and CI builds that use demonstration keys are marked &lt;code&gt;DEMO_ONLY&lt;/code&gt; in the artifact itself. A protection tool whose own binary you can't trust is worth exactly nothing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Platform honesty is a feature.&lt;/strong&gt; Linux x86-64 and Windows x64 are built and tested natively across PHP 8.2–8.5 (including ZTS); macOS and ARM64 build and pass their suites in CI, but no prebuilt loader ships for them yet and the README says exactly that. Machine-bound licences are Linux-only. Users forgive "not yet" — they don't forgive surprises.&lt;/p&gt;

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



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run ghcr.io/miguelenred/envelock
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Packaging a project is four commands (keys, recipient, project, pack) and there's a windowed assistant for the whole flow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python encoder/envelock.py init-owner --out private/owner.enc.json --with-recovery
python encoder/envelock.py init-recipient --out private/cliente.enc.json --label cliente-001
python encoder/envelock.py export-public --recipient private/cliente.enc.json --out release/cliente-001.pub.json
python encoder/envelock.py pack --owner private/owner.enc.json --recipient release/cliente-001.pub.json --project &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;uuid&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; --source my-app --output release/cliente-001/my-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On each server: &lt;code&gt;pie install envelock/loader&lt;/code&gt;, create the identity file, point &lt;code&gt;envelock.identity&lt;/code&gt; at it from &lt;code&gt;php.ini&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repo: &lt;a href="https://github.com/miguelenred/envelock" rel="noopener noreferrer"&gt;https://github.com/miguelenred/envelock&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Project page: &lt;a href="https://miguelenred.es/envelock" rel="noopener noreferrer"&gt;https://miguelenred.es/envelock&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The honest limits, written down in the README and &lt;code&gt;docs/SEGURIDAD.md&lt;/code&gt;: no online revocation yet, no TPM/DPAPI sealing of the server identity, control-flow flattening still unfinished, and PHAR/&lt;code&gt;__halt_compiler()&lt;/code&gt; code has no guaranteed compatibility.&lt;/p&gt;

&lt;p&gt;How I work, for transparency: I direct the project — architecture, spec, design decisions, review — and the implementation is produced with the help of several AI models under that spec and reviewed by me before shipping. Every trade-off above was decided by a human.&lt;/p&gt;

&lt;p&gt;What would you need from a tool like this before shipping it to production — an independent audit, specific platform support, a feature I haven't thought of? Feedback is very welcome, and I'm happy to answer any question about the format or the crypto.&lt;br&gt;
``&lt;/p&gt;

</description>
      <category>php</category>
      <category>opensource</category>
      <category>security</category>
      <category>showdev</category>
    </item>
    <item>
      <title>I implemented the RDP protocol in pure PHP — a browser remote desktop client with no database and no daemons</title>
      <dc:creator>Miguel</dc:creator>
      <pubDate>Fri, 27 Nov 2026 10:04:04 +0000</pubDate>
      <link>https://dev.to/miguelenred/i-implemented-the-rdp-protocol-in-pure-php-a-browser-remote-desktop-client-with-no-database-and-1l4g</link>
      <guid>https://dev.to/miguelenred/i-implemented-the-rdp-protocol-in-pure-php-a-browser-remote-desktop-client-with-no-database-and-1l4g</guid>
      <description>&lt;p&gt;Hi DEV! I'm Miguel, and for the last months I've been building &lt;strong&gt;MuDeskClient&lt;/strong&gt;: a full remote desktop (RDP) client that runs in the browser, powered by a single PHP application. No database, no Composer packages, no daemons — it installs on ordinary shared hosting. It's free software, Apache-2.0.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/miguelenred" rel="noopener noreferrer"&gt;
        miguelenred
      &lt;/a&gt; / &lt;a href="https://github.com/miguelenred/mudeskclient" rel="noopener noreferrer"&gt;
        mudeskclient
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Remote desktop (RDP) client in the browser, with a gateway in plain PHP 8.1-8.5. No database, no dependencies, no build step.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;MuDeskClient&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;Remote desktop (RDP) client that runs in the browser. The browser only uses HTML, CSS and JavaScript; a gateway written in plain PHP speaks RDP to the remote computers. Nothing has to be installed on the remote computers and no database is needed: all data is kept in JSON files.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/miguelenred/mudeskclient/README.es.md" rel="noopener noreferrer"&gt;Leer en español&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Screenshots&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/miguelenred/mudeskclient/docs/images/connections.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fmiguelenred%2Fmudeskclient%2FHEAD%2Fdocs%2Fimages%2Fconnections.png" alt="Connections of a user, in groups"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Connecting: password and options&lt;/th&gt;
&lt;th&gt;Administration&lt;/th&gt;
&lt;th&gt;Dark mode&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a rel="noopener noreferrer" href="https://github.com/miguelenred/mudeskclient/docs/images/connect.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fmiguelenred%2Fmudeskclient%2FHEAD%2Fdocs%2Fimages%2Fconnect.png" alt="Connect dialog with the options of the session"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a rel="noopener noreferrer" href="https://github.com/miguelenred/mudeskclient/docs/images/admin.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fmiguelenred%2Fmudeskclient%2FHEAD%2Fdocs%2Fimages%2Fadmin.png" alt="Administration: users"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a rel="noopener noreferrer" href="https://github.com/miguelenred/mudeskclient/docs/images/connections-dark.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fmiguelenred%2Fmudeskclient%2FHEAD%2Fdocs%2Fimages%2Fconnections-dark.png" alt="Connections in dark mode"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;p&gt;Demo data: invented names and documentation addresses.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Features&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Bulk compression (MPPC, NCRUSH, XCRUSH) end to end and drawing orders with the bitmap cache: both links carry compressed data.&lt;/li&gt;
&lt;li&gt;RDP with TLS and NLA (CredSSP with Kerberos or NTLMv2) and, for Windows XP and Server 2003, &lt;em&gt;Standard RDP Security&lt;/em&gt;; RDS licensing, 15/16/24/32-bit color. User names as &lt;code&gt;user&lt;/code&gt;, &lt;code&gt;DOMAIN\user&lt;/code&gt;, &lt;code&gt;HOST\user&lt;/code&gt;, &lt;code&gt;.\user&lt;/code&gt; (local account of the server) or &lt;code&gt;user@domain&lt;/code&gt; (UPN).&lt;/li&gt;
&lt;li&gt;Sign-in: users and administrator, optional TOTP and &lt;strong&gt;passkeys&lt;/strong&gt; (passwordless, or a second step after the password: the…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/miguelenred/mudeskclient" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;This post is the story of the two decisions that shaped everything, what implementing RDP in pure PHP actually looked like, and the bugs that taught me the most.&lt;/p&gt;

&lt;h2&gt;
  
  
  The constraint that shaped the architecture
&lt;/h2&gt;

&lt;p&gt;Every browser RDP gateway I know needs infrastructure: Guacamole needs guacd (a C daemon) and usually a database; commercial ones need Java, .NET or Node layers. I wanted to deploy for my clients on cheap shared hosting where you get exactly two things: &lt;strong&gt;PHP and MySQL&lt;/strong&gt;. I decided to give up MySQL and see how far plain PHP goes.&lt;/p&gt;

&lt;p&gt;That produces this architecture:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Browser                        PHP app                          Remote computers
────────                       ────────                         ────────────────
&amp;lt;canvas&amp;gt; + WebCodecs   ⇄   rdp.php (long-lived request)  ⇄   Windows / xrdp :3389
keyboard, mouse, POSTs       speaks RDP natively, TLS            (NLA, RD Gateway...)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The long-lived HTTP request to &lt;code&gt;rdp.php&lt;/code&gt; &lt;strong&gt;is&lt;/strong&gt; the RDP client: PHP opens the TLS connection to the remote computer and speaks the protocol itself. Graphics stay compressed on the wire all the way to the browser (H.264/AVC420 is decoded with WebCodecs; RemoteFX, ClearCodec and the rest in JavaScript on a canvas). Input, clipboard, drives and printers come back through short POSTs.&lt;/p&gt;

&lt;p&gt;No daemon means: upload the files, point a domain, sign in. The trade-off — holding one PHP-FPM request open per session — was the most interesting engineering problem: output buffering, timeouts and process-per-connection limits vary on every host, and the documentation explains how to check and configure each one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementing the protocol, layer by layer
&lt;/h2&gt;

&lt;p&gt;The client is written against Microsoft's specifications (MS-RDPBCGR, MS-RDPGFX, MS-NLMP, MS-TSGU...):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Transport and security&lt;/strong&gt;: TLS 1.0–1.3 from PHP streams; NLA with CredSSP v6 — Kerberos (AES or RC4) or NTLMv2 — and, for Windows XP and Server 2003, the old &lt;em&gt;Standard RDP Security&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Graphics&lt;/strong&gt;: the RDPGFX pipeline with AVC420, RemoteFX, RemoteFX progressive, ClearCodec and planar, plus the surface cache; and the classic path with MPPC/NCRUSH/XCRUSH bulk compression and drawing orders with a bitmap cache — &lt;strong&gt;both links carry compressed data&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Everything else&lt;/strong&gt;: full clipboard (text, HTML, images, files, drag &amp;amp; drop, a Win+V-style history), drive redirection (a server folder plus a folder of the user's own machine), a virtual PDF printer, remote audio, microphone and camera redirection, multi-monitor with dynamic layout, RemoteApp (RAIL), Wake-on-LAN, session recording and shareable session links.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The boring-but-hard parts&lt;/strong&gt;: an RD Gateway (MS-TSGU over HTTPS, including the RPC-over-HTTP transport of Windows Server 2008) in plain PHP, and following a connection broker's redirection. Import/export of &lt;code&gt;.rdp&lt;/code&gt; files, TOTP and passkeys, OpenID Connect sign-in, and Windows-account sign-in validated through NLA without LDAP or any extension.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stored RDP passwords are encrypted (AES-256-GCM) with a key derived from each user's own password, so not even the administrator can read them.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. The hardest part wasn't the protocol — it was the keyboard.&lt;/strong&gt; Windows' own Notepad drops or repeats characters when its spell checker underlines a word, and it races you on Enter. The gateway now waits for each character's pause and keeps the order, and pastes instead of typing bursts. That single problem generated more test cases than half the protocol.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Old Windows servers are a museum.&lt;/strong&gt; Server 2003 speaks RC4 &lt;em&gt;Standard RDP Security&lt;/em&gt;, 2008 R2 needs TLS 1.0 and CredSSP version 3, and each era reports its capabilities differently. Supporting 2003 → 2022 meant building a compatibility table instead of assuming one protocol.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Fuzzing pays for itself immediately.&lt;/strong&gt; The gateway and the browser decoders are fuzzed on every push (and nightly, 10–20k cases per target). So far it found &lt;strong&gt;9 real bugs — 4 in the gateway, 5 in the browser decoders&lt;/strong&gt; — all fixed. NTLMv2 is unit-tested against Microsoft's own MS-NLMP test vectors.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. JSON files can replace a database&lt;/strong&gt; for this kind of app: users, connections, audit logs (with tamper detection and signed export) all live in JSON files. For the target deployment — a handful of teams per host — it keeps the install to "upload and go".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Honest testing beats brave claims.&lt;/strong&gt; Tested against real machines: Windows 11, Server 2022 (its RD Gateway with all three transports, its connection broker, Active Directory with Kerberos, RD licensing), 2012 R2, 2012, 2008 R2, 2008, 2003, xrdp and the FreeRDP 3 server. &lt;strong&gt;Not&lt;/strong&gt; tested yet: broker redirection to a second session host, a real Hyper-V console, and Safari (I own no Apple device) — all written down in &lt;code&gt;docs/TESTING.md&lt;/code&gt;, which I keep updated as coverage grows.&lt;/p&gt;

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



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run -d -p 8443:443 -v mudesk-data:/var/www/html/data ghcr.io/miguelenred/mudeskclient
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Repo: &lt;a href="https://github.com/miguelenred/mudeskclient" rel="noopener noreferrer"&gt;https://github.com/miguelenred/mudeskclient&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is not a Guacamole replacement — it only does RDP — and it's young (first stable release days ago). What I need most now is people trying it in real environments: odd hosts, real RD Gateways, Hyper-V, whatever breaks.&lt;/p&gt;

&lt;p&gt;What would you want it to do (or do differently)? I'd love your feedback — and I'm happy to answer questions about the protocol or the architecture. Thanks for reading!&lt;br&gt;
``&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>php</category>
      <category>opensource</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
