Short answer: drop the PDF, type the password, download. The file comes back encrypted with AES-256 and the page confirms the encryption dictionary is in the output. Nothing is uploaded and no password is stored, so a forgotten password cannot be recovered — not by you and not by this site.
Why a real security handler
Encrypting a PDF properly means the standard security handler: key derivation, the encryption dictionary, per-object streams and strings. Getting it subtly wrong produces a file that opens without a password in one reader and not at all in another. This page uses a library that implements that handler rather than a homegrown approximation, and it proves the result by re-reading its own output.
What the page verifies
After encryption the output is scanned for /Encrypt. If it is missing, the page says the operation failed instead of handing you a file that only looks locked. The same check — in reverse — is what makes the unlock tool trustworthy.